Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5401278ybv; Mon, 17 Feb 2020 19:20:53 -0800 (PST) X-Google-Smtp-Source: APXvYqw9Mea9pOxHsHDzzn0sQTNCmirsPnCWNEuSNq4G4hUcL0peBLJ8r/pcCXAjpk30HSOD682o X-Received: by 2002:a9d:842:: with SMTP id 60mr2055163oty.318.1581996053514; Mon, 17 Feb 2020 19:20:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581996053; cv=none; d=google.com; s=arc-20160816; b=ayvJ8euNrl9zgYhvpRUnc06EYgGf9RLyYy5HUcv4N4sSTkyZ2ds33euPm5TQrqkp0N Ouu/PHLorpSuYZc0ivceLkgNP7HM5rZagURB+oMlZ6JRIoC9LnifZRD4Nq2LVEUGr/ar iivvtMrEbTBxNv8MTz4Qgicg6DecIOsEIBUUjdV3roIBl3nJgOcl9YLZAcwQRZ8jY/MR Y8+NTvWI03+pHcgv1MjsIC8Bpe6JTc2pIrKRDRWYiwCld+6FdDI+wCe1rpacHk0ugUjx 7RAMvJZj1EcAwu+IGy1plxbhx/5LDkJHMXPfo3sm31SqW6uMgnmj0ww2ylAVmjcW7Gv1 mGgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=StMZNHKXbBJ69Oh8z+WNA9q5sXxgPWX09GGF+xje3tw=; b=lN+4RiIq1OAegX1kIiLtBT0CWq/BO4mn57VGcmkDUXw7ypQjQdD2iEc1QqMP3lfbrP GCsyGTgittKmCPA+P02ED6aiskLiL3pgTIKraNaHSAcGwiyXx8DUiZP1xUfTZMgnSC/x hNf9cehAUrhDrIdxq0y2cQU9mjB8OsuxYJaxZBFoLYJUCAx/qNAawuJ5MNoFHNOfTvw3 91NttVZ6UnX4L9/VI1fZDOku+ZNoFApsXJfUK1k0KS+c0FLdqIguUeFbFLckayWpC9vh KGzZK6zkIrEbdexYrmiNOSRo2RV85OKGiUyQdBqFGjvFQFJkbXxXsrfWzO6RoYOutgUt cGqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=AonWIDoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t185si7687418oib.39.2020.02.17.19.20.40; Mon, 17 Feb 2020 19:20:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=AonWIDoU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbgBRDUc (ORCPT + 99 others); Mon, 17 Feb 2020 22:20:32 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:28094 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgBRDUc (ORCPT ); Mon, 17 Feb 2020 22:20:32 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200218032029epoutp0275ee5f2a29e208f74e6c53f5ffe2f633~0YQHgq4Kr0051800518epoutp027 for ; Tue, 18 Feb 2020 03:20:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200218032029epoutp0275ee5f2a29e208f74e6c53f5ffe2f633~0YQHgq4Kr0051800518epoutp027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1581996029; bh=StMZNHKXbBJ69Oh8z+WNA9q5sXxgPWX09GGF+xje3tw=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=AonWIDoUofWw2IR1QozA+wdIHDAk5FkKFELFO2DX2xJiqr593yLjeRl4UHiaONYyD 742dznehJ016rmA59GbG76AWUG6ggV8W2dHMpsPAwikGSe8kPibKjsJ/i0d+Wtpvbl H0Q7XzUErylOYMHtaXYffvMPqcesMlXMZNi4jwq4= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20200218032029epcas1p4ddada4e22f314b802c39120acf648584~0YQHDhCgi0030300303epcas1p4y; Tue, 18 Feb 2020 03:20:29 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.158]) by epsnrtp1.localdomain (Postfix) with ESMTP id 48M5hV68K0zMqYlt; Tue, 18 Feb 2020 03:20:26 +0000 (GMT) Received: from epcas1p3.samsung.com ( [182.195.41.47]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id B3.19.51241.3F75B4E5; Tue, 18 Feb 2020 12:20:19 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200218032018epcas1p176974bd788f674e27e774eb67387a417~0YP9M60PT1144111441epcas1p1i; Tue, 18 Feb 2020 03:20:18 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200218032018epsmtrp20e4bfdb21e0dc749b63d95ae61e1887d~0YP9MPOKm3142831428epsmtrp2E; Tue, 18 Feb 2020 03:20:18 +0000 (GMT) X-AuditID: b6c32a39-14bff7000001c829-f7-5e4b57f345cc Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 3F.3B.06569.2F75B4E5; Tue, 18 Feb 2020 12:20:18 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200218032018epsmtip2148ba399e6caf0a15ec2fff29035d76d~0YP9Aje7i0560105601epsmtip2O; Tue, 18 Feb 2020 03:20:18 +0000 (GMT) Subject: Re: [PATCH v3] extcon: palmas: hide error messages if gpio returns -EPROBE_DEFER To: "H. Nikolaus Schaller" , MyungJoo Ham Cc: linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, linux-omap@vger.kernel.org From: Chanwoo Choi Organization: Samsung Electronics Message-ID: Date: Tue, 18 Feb 2020 12:28:25 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA01SWUwTURTN67TDgFQfReRKouIQohBZhlIcjCUYjaniR4NRRBNwpJOW0M1O QRY/QIkU3ECiiVWiEY2CBGPFio2KwQ1wwSUS3DX4oUYkCFXcEtsORv7OPffc5bx3KULRREZR hWY7bzNzRpoMkbpvxCUljOVk5SVfd4WzE26vhH3s3c5e/P2YZJ94jpLskZP7peyLqjNkJqlp G+kjNNUHPEGa8eqdhGZfRyvSjLnmamUbi5YaeE7H26J5c4FFV2jWq+mstfnL81VpyUwCk84u pqPNnIlX0yvWaBNWFhp9C9DRJZyx2EdpOUGgkzKW2izFdj7aYBHsapq36ozWdGuiwJmEYrM+ scBiWsIkJ6eofMLNRYbBoVaZ9WNoad+z7qBK5AmpQ8EU4FRwt5+W1aEQSoE7EbQ0jhFi8BVB w/CJycw3BH92u9G/EkfL+UnVVQRXXg9OBiMI3Bd3SPyqcLwJJg488lVQ1EycC7fGU/w0gUvA O+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lpZbrFSfmFpfmpesl5+duYgRHkJbWDsYTJ+IP MQpwMCrx8K6Y4BUnxJpYVlyZe4hRgoNZSYTXWxwoxJuSWFmVWpQfX1Sak1p8iFGag0VJnFc+ /1ikkEB6YklqdmpqQWoRTJaJg1OqgTF0/7ml4urd15g4bW7pphlxx5x18OpJtvR2MttTHFf7 v2PSt/jHvfYx/m4bX2e9n2ydVMD8XiVSfZLjmakqExXSqpsW+/Td5+lzqeuYYB02dcvN1dbe W5fPlYwXfGX8ccaHL5mrDd9fs5198CBfgKrpev654Qc2MPR3Z2lcPX5J4fl+K7XVD5RYijMS DbWYi4oTAXqy/WGcAgAA X-CMS-MailID: 20200218032018epcas1p176974bd788f674e27e774eb67387a417 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200217133832epcas1p329af393e88fa76189ca141d2534f9ad2 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/17/20 10:38 PM, H. Nikolaus Schaller wrote: > If the gpios are probed after this driver (e.g. if they > come from an i2c expander) there is no need to print an > error message. > > Signed-off-by: H. Nikolaus Schaller > --- > drivers/extcon/extcon-palmas.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c > index edc5016f46f1..cea58d0cb457 100644 > --- a/drivers/extcon/extcon-palmas.c > +++ b/drivers/extcon/extcon-palmas.c > @@ -205,14 +205,18 @@ static int palmas_usb_probe(struct platform_device *pdev) > > palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id", > GPIOD_IN); > - if (IS_ERR(palmas_usb->id_gpiod)) { > + if (PTR_ERR(palmas_usb->id_gpiod) == -EPROBE_DEFER) { > + return -EPROBE_DEFER; > + } else if (IS_ERR(palmas_usb->id_gpiod)) { > dev_err(&pdev->dev, "failed to get id gpio\n"); > return PTR_ERR(palmas_usb->id_gpiod); > } > > palmas_usb->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus", > GPIOD_IN); > - if (IS_ERR(palmas_usb->vbus_gpiod)) { > + if (PTR_ERR(palmas_usb->vbus_gpiod) == -EPROBE_DEFER) { > + return -EPROBE_DEFER; > + } else if (IS_ERR(palmas_usb->vbus_gpiod)) { > dev_err(&pdev->dev, "failed to get vbus gpio\n"); > return PTR_ERR(palmas_usb->vbus_gpiod); > } > I think that it is enough to handle the -EPROBE_DEFER. Also, I prefer to use single if/else statement instead of the nested if/else statement. Applied it. -- Best Regards, Chanwoo Choi Samsung Electronics