Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5707276ybv; Tue, 18 Feb 2020 02:28:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyWt7uC/ZLiEx23mpjRy8uLMzR/YLOydl85egJK/7SmgVlZBRqVS93SG0PsC7nAWGRzx5kg X-Received: by 2002:a05:6830:128e:: with SMTP id z14mr10188817otp.184.1582021685591; Tue, 18 Feb 2020 02:28:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582021685; cv=none; d=google.com; s=arc-20160816; b=HTqZo2taqZh8apIrIePBGxi6dd9V5yLZ/2eRw0tsKOEAJRpzkiQZtFHjEGWn9ScmPT pFb/vnuOLbCNVXghsX6FFDDzp6/HPMlagIsiN/La2SyU8DGj+n2QXAWKDFqfqLANV0UU wyu/hrvlSNbpnNvRUMZWqVFO2qF5pq890uiC8dm61eAq1+RIDRHfumH162ZocFsiByOs HrZ4KB4IobT4kACljfIwn0tLR6OHz3nPFajGY262Si/UvhTT0X52sCU8OKLXuC7NfiPR cHoRVPkmZZScxv8af6SKINOtcfOZYIsWWl3+Usss7qf/j/TQ5DcbETFjyPE2gbffYxXL WaYQ== 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=vKSMlfIkqirRTQYXX9qnJW4/hzJAeYLc6csS5YeRX2A=; b=iEP8rI+nkfJg0a197V/QGhF85FJEuJKdxeDUs3ETEQ3mH2lKkYTa7iqfGhhi/rCUOM PFE8cfCZRuNJn0IG+GyEkZJQr4wJu2pFCnu3D6Mr10EX9cpWAcoslShzw60/+NWfEz+4 aF/XLy1AHYc4bxRCN52jHjUYDEZpJnwP94+Lk5FsjUKmqTCZSJJai81a143a+iCNKuIM 9K9MnU2iOurA+tyyLT9HU1pgEWDFMLO8hF7yCewTtGluzitKvEW1qXANmvs7KfW3OCyW bfTb1IOrDC2xZ1dfskv1VBEcPJn50O7rEzFxpufinqq/IkhVEOym8udMBdxnO8KRAUVf WvFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="FAR85Sx/"; 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 o1si1514832otk.154.2020.02.18.02.27.52; Tue, 18 Feb 2020 02:28:05 -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="FAR85Sx/"; 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 S1726360AbgBRK1q (ORCPT + 99 others); Tue, 18 Feb 2020 05:27:46 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:44077 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbgBRK1p (ORCPT ); Tue, 18 Feb 2020 05:27:45 -0500 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200218102743epoutp04ec8f6f3e6008b5116ac645d180b4ac7d~0eFI-Nd-s3090430904epoutp04G for ; Tue, 18 Feb 2020 10:27:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200218102743epoutp04ec8f6f3e6008b5116ac645d180b4ac7d~0eFI-Nd-s3090430904epoutp04G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1582021663; bh=vKSMlfIkqirRTQYXX9qnJW4/hzJAeYLc6csS5YeRX2A=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=FAR85Sx/Z7fD67K00arVYNY1MQN9XemQQKgyQ9fsMQpOlbrrEVBScD0cBqD1nq/ox cCcXqNBKvEjz1q7EG482CX3Q1HPEuBpdQW59O1zrXherDB8uQ8zn1g8BMk8LXFHE13 cGYy+wsPjLQf+Pe/6Ad7cwCBT2R1GQjkBrTljs1I= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20200218102743epcas1p251c7b769d756f1c5052bdb58ee99c96b~0eFIpSwYb0296402964epcas1p2J; Tue, 18 Feb 2020 10:27:43 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.40.152]) by epsnrtp2.localdomain (Postfix) with ESMTP id 48MH9S6sQvzMqYkV; Tue, 18 Feb 2020 10:27:40 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id E5.97.57028.C1CBB4E5; Tue, 18 Feb 2020 19:27:40 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20200218102740epcas1p4717d159cb0fd53fd9feac7c382af43dd~0eFF87-xX0978109781epcas1p4W; Tue, 18 Feb 2020 10:27:40 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200218102740epsmtrp1a2167198b7f4d63c2451ea224e73066b~0eFF8QI890549005490epsmtrp1C; Tue, 18 Feb 2020 10:27:40 +0000 (GMT) X-AuditID: b6c32a35-50bff7000001dec4-94-5e4bbc1c5910 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id CF.2C.10238.C1CBB4E5; Tue, 18 Feb 2020 19:27:40 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200218102740epsmtip293ff206bcaf707bfb3fc8cff3b56981d~0eFFsUUlW0922309223epsmtip2v; Tue, 18 Feb 2020 10:27:40 +0000 (GMT) Subject: Re: [PATCH v3] extcon: palmas: hide error messages if gpio returns -EPROBE_DEFER To: Ladislav Michl Cc: "H. Nikolaus Schaller" , MyungJoo Ham , 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 19:35:47 +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: <20200218102140.GA193069@lenoch> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJJsWRmVeSWpSXmKPExsWy7bCmrq7MHu84g3//TSx+bPvKZHHpa43F 7JWTmSy2/rnEZnF51xw2i9lL+lksbjeuYHNg91jz/hSzx9GVa5k8WibtYvf40tLM7NG3ZRWj x+dNcgFsUdk2GamJKalFCql5yfkpmXnptkrewfHO8aZmBoa6hpYW5koKeYm5qbZKLj4Bum6Z OUCnKCmUJeaUAoUCEouLlfTtbIryS0tSFTLyi0tslVILUnIKLAv0ihNzi0vz0vWS83OtDA0M jEyBChOyM2ZeeMpUsFW44vfPqawNjLf4uxg5OSQETCS+Nc1i7GLk4hAS2MEoMe3CdijnE6PE 8ymX2SGcb4wS73tBMhAtV+6vharayyhx9cErqKr3jBIn1r9kBqkSFoiW+DHpIlAVB4eIgKbE nT/6IDXMAucZJY6uncYOUsMmoCWx/8UNNhCbX0BR4uqP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paX2P52DvMERuFZSNpnIWmZhaRlFpKWBYwsqxglUwuKc9Nziw0LDPNSy/WKE3OLS/PS9ZLz czcxguNKS3MH4+Ul8YcYBTgYlXh4V0zwihNiTSwrrsw9xCjBwawkwustDhTiTUmsrEotyo8v Ks1JLT7EKM3BoiTO+zTvWKSQQHpiSWp2ampBahFMlomDU6qBMbcrx8CXs/ol/4s9xr87r3R3 PjwZwiEuXZEYnxZ3ovJLM8+leqbnp2fabl/9cNGZK502aXtObWG/MHXTv473HkvjFx5++opL ZuL7De+P2FWdDbVcOX/2xjnTdy71Ev/H4dLC4Gxu/YNVUrsn2jL0Ar/egqN3Av6qGPUv4z9x l+/KC9Yl9eWPE5RYijMSDbWYi4oTAQyz9JqnAgAA X-CMS-MailID: 20200218102740epcas1p4717d159cb0fd53fd9feac7c382af43dd 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: <20200218102140.GA193069@lenoch> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/18/20 7:21 PM, Ladislav Michl wrote: > On Tue, Feb 18, 2020 at 12:28:25PM +0900, Chanwoo Choi wrote: >> 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. > > Uh... As it is? Then it is matter of time it triggers someones cocci > script pointing to else after return. Could you at least fix this? Sorry. I don't understand. Do you mean that this patch has the some issue of cocci script? I think that it fixes the probe sequence issue between extcon-palmas and gpio driver. It is not related to any result from cocci script. If the extcon-palmas.c has the issue by cocci or checkpatch, anyone can send the other patch for fixup. I think that it is enough to fix the issue which is only related to the probe sequence between gpio and extcon-palmas.c > > Thanks, > ladis > > -- Best Regards, Chanwoo Choi Samsung Electronics