Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6020906imu; Tue, 13 Nov 2018 15:54:36 -0800 (PST) X-Google-Smtp-Source: AJdET5ekGsKhaUv8Wx1E8ET7tBaGjmUtKeS4peo+bswKAk3gNbdk+ghID/2RyY979TQKMNSZwQlP X-Received: by 2002:a62:a218:: with SMTP id m24-v6mr7067376pff.99.1542153276599; Tue, 13 Nov 2018 15:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542153276; cv=none; d=google.com; s=arc-20160816; b=e+9VlDeN4zuhT/8YzCDkBaA0ki8Vv+8YNdRy+A0C57bLaPZo0rE0D5eANkKc81ylnx a0ev6seN4SxQa+sMtZnrdooMFjIZdvsIUPFc+L39zEmc+Z+ymFrU1tbNdHzrQio61VIP QXmBX3r2zu8UZnqcVSQxIhSvTDqWbc0xRhNOnXpHXLQkPvv1vt9w/ZIW8dpip0AzJJ4e URUmhTjyisQ7hcqpvo0ojC3QYt5Q93jEF5/gsRoyTtTLlfY6gA079QvZABjJB21wOeio jVupEFlqaVGgjOFUC4hH0MAK/+h4h15pxgONOTCzjXooWktdODX74J91hGqd1Vg2I28C gvfg== 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 :in-reply-to:subject:to:user-agent:organization:from:date:message-id :content-transfer-encoding:mime-version:dkim-signature:dkim-filter; bh=ss3PkeJVWYMnzhwrTSSk6d73ovm522wYiYAc+HVckfo=; b=hPRknnOufMS9jsdfO56jaW9Li/QkwuYuwy4kf+zkpwqHz9+si5MKHcH9es/qz50LMC adtn0G21cGBoxpoRSNUilmGexfe7yNkBJjNaaNmSI1ap4BrPMsFi+xgLDaRzk1/rcAm4 Hx9Y20B9MP3/VMxlnerNHLH6jB4Dhtc3okWP8nc2EZg9hSxN+8wKMvpw3ZCFI9E3HXnz tZvKX17oGq8rvXFBtN6z6muR4MH1OvscAG6ZddIuBTavAKQAn6xsQUyoLpqooAR53m++ 2V4Rb2275i7cl8cc4EIco/K6uAIQKH7jsR/EqjDNsJhuFgyqxXhp4hQh+5C08hjK0nOR unwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=DWRkuxSv; 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 x11-v6si22394086pln.425.2018.11.13.15.54.21; Tue, 13 Nov 2018 15:54:36 -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=DWRkuxSv; 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 S1730853AbeKNJxV (ORCPT + 99 others); Wed, 14 Nov 2018 04:53:21 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:56620 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbeKNJxV (ORCPT ); Wed, 14 Nov 2018 04:53:21 -0500 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20181113235239epoutp02fc978d988012323e4ed471ced7b8408f~m1CDExEFF2113321133epoutp02p; Tue, 13 Nov 2018 23:52:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20181113235239epoutp02fc978d988012323e4ed471ced7b8408f~m1CDExEFF2113321133epoutp02p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1542153159; bh=ss3PkeJVWYMnzhwrTSSk6d73ovm522wYiYAc+HVckfo=; h=Date:From:To:Subject:In-reply-to:References:From; b=DWRkuxSvV/7TKySFy5mU0iiEQRg0vrc9myttUYkSWE6tV3tVq4MMqOFQLGY3cdXf1 dBFWYCmQQPyJBFwDdCth9zJkJ+0rMeWeB5LhLEbJLqpBfVE3kn6dfIX28uwNu+Zcgj ihfueAVe8VQ7fnqh4BuwY8S+aMV9pD1sRCCLQkbc= Received: from epsmges2p2.samsung.com (unknown [182.195.40.158]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20181113235236epcas1p11c84c4d9dbae669406fd9bdd9192360c~m1CAVLugr1287712877epcas1p1Q; Tue, 13 Nov 2018 23:52:36 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id F6.12.04407.4C36BEB5; Wed, 14 Nov 2018 08:52:36 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20181113235235epcas2p191c155fc4f89d47125946b71273e263a~m1B-rRAGG0286702867epcas2p1p; Tue, 13 Nov 2018 23:52:35 +0000 (GMT) X-AuditID: b6c32a46-7a1ff70000001137-ab-5beb63c4dd31 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 16.B2.03702.3C36BEB5; Wed, 14 Nov 2018 08:52:35 +0900 (KST) MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset="utf-8" Received: from [10.113.63.77] by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PI5006HDOZN9Z60@mmp2.samsung.com>; Wed, 14 Nov 2018 08:52:35 +0900 (KST) Message-id: <5BEB63C3.1020504@samsung.com> Date: Wed, 14 Nov 2018 08:52:35 +0900 From: Chanwoo Choi Organization: Samsung Electronics User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Andy Shevchenko , MyungJoo Ham , linux-usb@vger.kernel.org, Felipe Balbi , Guenter Roeck , Heikki Krogerus , Roger Quadros , linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Sebastian Reichel , linux-omap@vger.kernel.org, Darren Hart , platform-driver-x86@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Chen-Yu Tsai , Hans de Goede Subject: Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found In-reply-to: <5BE8C821.5080002@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIJsWRmVeSWpSXmKPExsWy7bCmqe6R5NfRBgt3qlj0Nk1nsjjW9oTd omuhgUXz4vVsFm+OA4W6Vu9ksbi8aw6bxewl/SwWn3uPMFosWtbKbPFk4Rkmi9uNK9gsVu95 wWwx98tUZoueR1oWp3eXWPw8dJ7JQdBjw6PVrB6bV2h5bFrVyeYx72Sgx/65a9g93u+7yuax 83sDu0ffllWMHsdvbGfy+LxJLoArKtsmIzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLC XEkhLzE31VbJxSdA1y0zB+gZJYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUmpBSk6BZYFe cWJucWleul5yfq6VoYGBkSlQYUJ2Rv9T04K1whUTFu1lbGC8wd/FyMkhIWAicXjhK9YuRi4O IYEdjBLzu95DOd8ZJc4tesEMU7XyVCMTRGIDo8SKjW/ZQRK8AoISPybfY+li5OBgFpCXOHIp GyTMLKAp8eLLJBaI+ruMEms6PjJC1GtJ/DiygAXEZhFQldi/dSXYAjag+P4XN9hAbH4BRYmr Px6D1YsKREjsnP+NHWSQiEADq8TH622sIAlhgSiJcxf3gBVxCmhL7L76GaxIQmAZu8TZ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NS9dLzs/dxAiMrW2Htfp3MD5eEn+IUYCDUYmH1+L2 q2gh1sSy4srcQ4wSHMxKIrz+0a+jhXhTEiurUovy44tKc1KLDzFKc7AoifPy5x+LFBJITyxJ zU5NLUgtgskycXBKNTDO5OdoN/boE5Zh3P/7iIrAOaO9XyewvVkkm7Q5Oitr4sRvrz4Ilc2R jnyz3qfu9Tam7ni2t8urfqrlLWG23Xpuffwj/x9fymY9YAw5syZq+rs2sYazEQ375uy2fnxu Ds+b4DiZvE8awav2T9z7j7HXzfYHZ7Dk9qxFvpVrKk+Gnb2mFud6ae9EJZbijERDLeai4kQA OetCFakCAAA= X-CMS-MailID: 20181113235235epcas2p191c155fc4f89d47125946b71273e263a X-Msg-Generator: CA CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20181110181155epcas2p1ac9bffb2dc7dd6337db5c37f8a87bd5e References: <20181110181101.24557-1-andriy.shevchenko@linux.intel.com> <20181110181101.24557-2-andriy.shevchenko@linux.intel.com> <5BE8C821.5080002@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, I was thinking about again to change from NULL to EPROBE_DEFER. extcon_get_extcon_dev() function was almost called in the probe function. But, this function might be called on other position instead of probe. ENODEV is more correct error instead of EPROBE_DEFER. Sorry. I'll withdraw my opinion related acked-by tag until we are clarifying it. On 2018년 11월 12일 09:24, Chanwoo Choi wrote: > Hi Andy, > > On 2018년 11월 11일 03:10, Andy Shevchenko wrote: >> All current users of extcon_get_extcon_dev() API considers >> an extcon device a mandatory to appear. Thus, they all convert >> NULL pointer to -EPROBE_DEFER error code. >> >> There is one more caller anticipated with the same requirements. >> >> To decrease a code duplication and a burden to the callers, >> return -EPROBE_DEFER directly from extcon_get_extcon_dev(). >> >> Signed-off-by: Andy Shevchenko >> --- >> drivers/extcon/extcon-axp288.c | 4 ++-- >> drivers/extcon/extcon.c | 2 +- >> drivers/power/supply/axp288_charger.c | 8 ++++---- >> drivers/usb/phy/phy-omap-otg.c | 6 +++--- >> drivers/usb/typec/tcpm/fusb302.c | 4 ++-- >> 5 files changed, 12 insertions(+), 12 deletions(-) > > Acked-by: Chanwoo Choi > > Best Regards, > Chanwoo Choi > >> >> diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c >> index a983708b77a6..3472d3b756ed 100644 >> --- a/drivers/extcon/extcon-axp288.c >> +++ b/drivers/extcon/extcon-axp288.c >> @@ -360,8 +360,8 @@ static int axp288_extcon_probe(struct platform_device *pdev) >> name = acpi_dev_get_first_match_name("INT3496", NULL, -1); >> if (name) { >> info->id_extcon = extcon_get_extcon_dev(name); >> - if (!info->id_extcon) >> - return -EPROBE_DEFER; >> + if (IS_ERR(info->id_extcon)) >> + return PTR_ERR(info->id_extcon); >> >> dev_info(dev, "controlling USB role\n"); >> } else { >> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c >> index 5ab0498be652..2bd0f2f33f05 100644 >> --- a/drivers/extcon/extcon.c >> +++ b/drivers/extcon/extcon.c >> @@ -884,7 +884,7 @@ struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name) >> if (!strcmp(sd->name, extcon_name)) >> goto out; >> } >> - sd = NULL; >> + sd = ERR_PTR(-EPROBE_DEFER); (snip) -- Best Regards, Chanwoo Choi Samsung Electronics