Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5739367ybv; Tue, 18 Feb 2020 03:05:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxLNcDUBiMyTKob1oGtDmRYh4WE6aOeeg6c8kJNaLDQl/COFhzpRJ9u87C5KHTTxVzHst18 X-Received: by 2002:a05:6808:99c:: with SMTP id a28mr795457oic.164.1582023939166; Tue, 18 Feb 2020 03:05:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582023939; cv=none; d=google.com; s=arc-20160816; b=nFCmFCThF6MWT3p6Xa2n5OsklcxP5kWCDNSE5oLFid5aaUNINIcBO6dhgv3GsfFQMZ 3nTYOZ9dZvd0ov3fKIZe8nXUMgM3RKw5lhX54ncyae54JSK5dNJg19D9d8SGO5ihBHZq 3oOY08Ri8oEMwYQAc1X9aKNwwRAwXxY9yFeAyG1gnxiVvwOE68hrHyZCIrm4rC5SUcbO +Qh9g3XMt0a4ESYUpmLBiqmBI6V6UMzI4fuT0XFdB531thN9onZrszdf/8K8CCjnDwD7 Ea8tWjWC/c4uWmwUmHxP4p/s5EEx/0zSXZwyEH/UJSqgCh/nUuWjxeu8xmTSYu9qwKpF W7dA== 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=FIhv7dPv7X+XM6EqLJXa1yaR2OmjNvkfCM5WkZs2Cj0=; b=Z6brFWHPG7tUTPPx6r/cyHQdifjCEzvW69K7N5TshHdM7WEVcg54SV6wBKQYXnkADq bhY9ProGuh71s6UEy5bRbUmmDPdJg6wMH4H2EbU9jeVIj+h3OVLssuVbzQvyan4HCMjT rZfCrV0r3YsTkiTSZjrUdyUi9AyP1eiXihXBNCaE1HLxM03tXMSkPvKRLVpn5svSNdfZ SnLLMx8/7WuedA596tS/lmxdisUS3j+cTqb01sZkhkiKlzkPW8Bl/BCebzY8gNLMgvZ2 mMhABbS7CmOEjGqhorGosbN1riLHRlNpdq8AwunHmXMtGHfoi3ew+PLZgiDSAE1l2bvK 6jcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=fc6Rk+k0; 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 a92si1534416otc.294.2020.02.18.03.05.26; Tue, 18 Feb 2020 03:05:39 -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=fc6Rk+k0; 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 S1726528AbgBRLFM (ORCPT + 99 others); Tue, 18 Feb 2020 06:05:12 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:19158 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726492AbgBRLFL (ORCPT ); Tue, 18 Feb 2020 06:05:11 -0500 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200218110509epoutp02d18192a7e8c609996c7e19baa6a64030~0el0OwG1K1631616316epoutp02l for ; Tue, 18 Feb 2020 11:05:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200218110509epoutp02d18192a7e8c609996c7e19baa6a64030~0el0OwG1K1631616316epoutp02l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1582023909; bh=FIhv7dPv7X+XM6EqLJXa1yaR2OmjNvkfCM5WkZs2Cj0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=fc6Rk+k0IKohJTDPFLFzIHuV2cz0ZgOL6+FIdLfVr4FrZugLpTEz5OSIVzUhhGLMa Gr6LtY8kQ76Wzgq48g+auKTDinzalVbnSbOxa1sGMhaKgftZYQzl+SItgL8CtGD6K1 kdBfc2dvy7ClSJ3beQw+6HjGDX+jINR+1ARMGrOE= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200218110508epcas1p3cbed91084d9cf9a4605dafbb08940fb6~0el0AC-590789107891epcas1p3e; Tue, 18 Feb 2020 11:05:08 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.153]) by epsnrtp1.localdomain (Postfix) with ESMTP id 48MJ0f5bqwzMqYlt; Tue, 18 Feb 2020 11:05:06 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id 96.1E.51241.2E4CB4E5; Tue, 18 Feb 2020 20:05:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20200218110506epcas1p39b01c063cedc7b38255b170c0f89b57b~0elxYKCE01052210522epcas1p3x; Tue, 18 Feb 2020 11:05:06 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200218110506epsmtrp1033e20339671ffdc15c31b0e0012ccbd~0elxXg0z02280322803epsmtrp14; Tue, 18 Feb 2020 11:05:06 +0000 (GMT) X-AuditID: b6c32a39-14bff7000001c829-79-5e4bc4e2c87a Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 3D.D0.06569.1E4CB4E5; Tue, 18 Feb 2020 20:05:06 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200218110505epsmtip175697413a8f014eef1b10a4c9fcf94f9~0elxLh7Hk0371103711epsmtip1q; Tue, 18 Feb 2020 11:05:05 +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: <4b147484-42f2-1e21-9e19-36cc696cef5e@samsung.com> Date: Tue, 18 Feb 2020 20:13:12 +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: H4sIAAAAAAAAA+NgFprHJsWRmVeSWpSXmKPExsWy7bCmru6jI95xBsc7dC1+bPvKZHHpa43F 1j+X2Cwu75rDZjF7ST+Lxe3GFWwObB5r3p9i9miZtIvd40tLM7NH35ZVjB6fN8kFsEZl22Sk JqakFimk5iXnp2TmpdsqeQfHO8ebmhkY6hpaWpgrKeQl5qbaKrn4BOi6ZeYAHaCkUJaYUwoU CkgsLlbSt7Mpyi8tSVXIyC8usVVKLUjJKbAs0CtOzC0uzUvXS87PtTI0MDAyBSpMyM44sV+/ YC5vRe/u2+wNjC+4uhg5OSQETCSO3D/E1sXIxSEksINRoqP1FyuE84lRYueeBewQzjdGiUd3 JzDBtKz80scMkdjLKLFqWg8jhPOeUeLTjIuMIFXCAtESPyaB2BwcIgKREke/GIGEmQXKJL5e 28QMYrMJaEnsf3GDDcT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BC2ONBx85kgbHmJ7W/nME9gFJ6FpH0W kpZZSFpmIWlZwMiyilEytaA4Nz232LDAKC+1XK84Mbe4NC9dLzk/dxMjOIK0tHYwnjgRf4hR gINRiYd3xQSvOCHWxLLiytxDjBIczEoivN7iQCHelMTKqtSi/Pii0pzU4kOM0hwsSuK88vnH IoUE0hNLUrNTUwtSi2CyTBycUg2Mne9ml1wR/NsYvl5iA9fPkuRKvpkNR9cYigY2rBJiajw+ tZxZdf58pso98hKn571RZDp+aI+9/nezppeOVwRUX4fvNOyrkn326LDu7a1nGfW3r37E2/PZ qHLS2+JrvPs6hd0SAu+W5vvM+MnYZz3nwGunykC+tT8bbp2WNnnsM2XV4p07jvDeUmIpzkg0 1GIuKk4EAPUaypScAgAA X-CMS-MailID: 20200218110506epcas1p39b01c063cedc7b38255b170c0f89b57b 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: 20200217135826epcas1p1bd80a3e497ec65c5e715c9f352c4d660 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:58 PM, H. Nikolaus Schaller wrote: > >> Am 17.02.2020 um 14:38 schrieb H. Nikolaus Schaller : >> >> 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)) { > > Hm. > > While looking again at that: why do we need the "{" and "} else "? > > It should be sufficient to have > >> palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id", >> GPIOD_IN); >> + if (PTR_ERR(palmas_usb->id_gpiod) == -EPROBE_DEFER) >> + return -EPROBE_DEFER; >> if (IS_ERR(palmas_usb->id_gpiod)) { > > What do you think is better coding style here? I think that my suggestion is better because 'if' and 'else if' check the error state of same 'palmas_usb->id_gpiod' variable. If 'if' and 'else if' checks the different variable, your suggestion is better. -- Best Regards, Chanwoo Choi Samsung Electronics