Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp1312412rwl; Fri, 4 Nov 2022 12:21:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Sir0P3IXAAgpdZG1w3uYewO3Gw7n2dHgdzjV3PJPCkKKnkzGWy1ziQBffLysQebrQl+mi X-Received: by 2002:a05:6402:530d:b0:463:b0cb:50e5 with SMTP id eo13-20020a056402530d00b00463b0cb50e5mr21316254edb.45.1667589664904; Fri, 04 Nov 2022 12:21:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667589664; cv=none; d=google.com; s=arc-20160816; b=usxjyd5L9TVxoHKYJjibaCqO24MhwHtY9seRlkH6pZemR5nD8I57b31r0MjvDx2RwN 4CjFOCH6jc434qCdl9hIhjROKF/AQjn0i8I6R19g4aXcqkD+zn4gXP/W+p06rgoUBap8 X0geBSZHT6nRjp4VMRAfROhq1d+Kq41RwXws4TjJw4gB9RMbKdacf8me3ggh2dC9F3Lp r2S8+bRVWVVeSWufzCn397A9UasgmAX35gEulKo27bMet1iB3PYMrZwIF6HvUI5UhnH/ LeNXSNXLmnAog5u3x1grFN1y8RvrV/RWW1OqKXz/h38M9cxBetPMdYGUeGO25eNcTshN bgVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=n2Mwd4QW71c+tvL+37iCS2soTDmKTBbW+FMRxkkK/kU=; b=rJtatKALKACBqMBBk5HRNrVZOer0BnsKhrOhf/GGHiVvVGW2NGo0bWLfuUH6VZ4/uz VGopjzPLcqRDLjtcqSK6Fsy7dZSNiIW6mZgMq489rsSyBmb0oGp9S8DjNbnJvsP8usIK hlFGIclot/z8BUxcW6OteXKgGlgPTj0Fz4o9U4ej1D84d2kX+I5OCNOtVlvYE4UnCBdG TXAjAeFCqrn88BnUQeItQSFRl5Q7N/ybQebON3uA/gdiVRCvRz1vaPHozflaKXw/9jL5 iRQ64w5Uins4s4t6Sq/D3FhSA7s4ZtsBGuC04C6AZn41NuYXODrP+7jRG6Mw/7nN8Lmg KHzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rl20-20020a170907217400b007addbdb9fbbsi4630331ejb.558.2022.11.04.12.20.41; Fri, 04 Nov 2022 12:21:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbiKDTKR (ORCPT + 97 others); Fri, 4 Nov 2022 15:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229537AbiKDTKQ (ORCPT ); Fri, 4 Nov 2022 15:10:16 -0400 Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 155CA5985D for ; Fri, 4 Nov 2022 12:10:14 -0700 (PDT) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id r24uozMxztFxAr24uoSTR9; Fri, 04 Nov 2022 20:10:09 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 04 Nov 2022 20:10:09 +0100 X-ME-IP: 86.243.100.34 Message-ID: Date: Fri, 4 Nov 2022 20:10:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] iio: adc: hx711: remove errors during deferred probe Content-Language: fr, en-US To: nate.d@variscite.com Cc: ak@it-klinger.de, eran.m@variscite.com, jic23@kernel.org, lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20221104172243.1004384-1-nate.d@variscite.com> From: Christophe JAILLET In-Reply-To: <20221104172243.1004384-1-nate.d@variscite.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 04/11/2022 à 18:22, Nate Drude a écrit : > This patch removes noisy kernel messages like "failed to sck-gpiod" or > "failed to get dout-gpiod" when the probe is deferred. > > Signed-off-by: Nate Drude > --- > drivers/iio/adc/hx711.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c > index f7ee856a6b8b..8ba4a5b113aa 100644 > --- a/drivers/iio/adc/hx711.c > +++ b/drivers/iio/adc/hx711.c > @@ -482,8 +482,9 @@ static int hx711_probe(struct platform_device *pdev) > */ > hx711_data->gpiod_pd_sck = devm_gpiod_get(dev, "sck", GPIOD_OUT_LOW); > if (IS_ERR(hx711_data->gpiod_pd_sck)) { > - dev_err(dev, "failed to get sck-gpiod: err=%ld\n", > - PTR_ERR(hx711_data->gpiod_pd_sck)); > + if (PTR_ERR(hx711_data->gpiod_pd_sck) != -EPROBE_DEFER) > + dev_err(dev, "failed to get sck-gpiod: err=%ld\n", > + PTR_ERR(hx711_data->gpiod_pd_sck)); > return PTR_ERR(hx711_data->gpiod_pd_sck); > } > > @@ -493,8 +494,9 @@ static int hx711_probe(struct platform_device *pdev) > */ > hx711_data->gpiod_dout = devm_gpiod_get(dev, "dout", GPIOD_IN); > if (IS_ERR(hx711_data->gpiod_dout)) { > - dev_err(dev, "failed to get dout-gpiod: err=%ld\n", > - PTR_ERR(hx711_data->gpiod_dout)); > + if (PTR_ERR(hx711_data->gpiod_dout) != -EPROBE_DEFER) > + dev_err(dev, "failed to get dout-gpiod: err=%ld\n", > + PTR_ERR(hx711_data->gpiod_dout)); > return PTR_ERR(hx711_data->gpiod_dout); > } > Hi, using dev_err_probe() looks like a better candidate for that. It can be can folded with the return (saving some LoC and the {} around the error handling path), and display the error code in a human readable manner. CJ