Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1486141ybk; Sun, 10 May 2020 18:39:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJxx9DtsFtVY/3/lXqTZy011HmyJSfzWr1VFfX6vr1o4UwgGs2xK1cFP7+QSvGehOL/o1jn X-Received: by 2002:a50:9dcd:: with SMTP id l13mr11622201edk.126.1589161172231; Sun, 10 May 2020 18:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589161172; cv=none; d=google.com; s=arc-20160816; b=nBwDiYL3klt6QmUqABpjnH5T5cwwSXh/ijEBnrOXamNy8m7spc2OHi0sNi1bca5OzL Ibd+EM4uhnBoAoCcN1BbNYQo2YLLiPJpxPdtoNMelGz4EjdGyo06oZHidsXbB5rVP2hn Gd2HMyXISe7efwjsKv3NTLmdqPmq6wUli+8AkA2Pn2aZYGbSoU3mlq7Sue08u+H15+QP YXVJzfmhfe2Cs6LNRbMwDOZ940p77VroMQBa1CdvJKIl+dt7a3EOeMzFvKCisMASPwh0 NqQ57CYXt7Kcm5redExRXi070oazxdw9S0sPC3i3vhJPmSbNeB5pzR8NYplgJQLgpBjs LL9w== 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=rStNRMpIxVfgkuMVc5ikSktKP/yld5dPBNbE3U3ruzM=; b=qn4WAdjkjyGX+WDLlhRebs5Q9IhfQ2QlPbAbNpmrgHR8K/nGQ05sgBYRVIAx23J4+a 1X4qscxqz8KnK15QoK2UJmJOKHCToHXkIu9rRRNGH83xRRjgdKtXMOZ19AgtV7LitQPC rm/C0UBG4Oq+a+KC4t6l5Uq/ap0mRxq7ASrHJW6bqJEuqvrdem3ZZS5FC/L1Lir9LutR Kt24GqBmeruplgxL4b22PzoV35cg0VgaZOnoGQBOvjYttjj2bTy2ezrQhaaDRaEYrFew MzYLYDBEA5G0H86pe05Y7FaZEUdCpbhZHmnw2SZzba/3/OWr3wAJIBcXEWmAQpjNBKY1 uxZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=X1kNcKaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id p90si4909786edd.215.2020.05.10.18.39.04; Sun, 10 May 2020 18:39:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=X1kNcKaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729215AbgEKBhP (ORCPT + 99 others); Sun, 10 May 2020 21:37:15 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:29720 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729141AbgEKBhO (ORCPT ); Sun, 10 May 2020 21:37:14 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200511013711epoutp03ed268240a02411d8c8129db9d4212a76~N1YneYgaD2211622116epoutp03f for ; Mon, 11 May 2020 01:37:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200511013711epoutp03ed268240a02411d8c8129db9d4212a76~N1YneYgaD2211622116epoutp03f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1589161031; bh=rStNRMpIxVfgkuMVc5ikSktKP/yld5dPBNbE3U3ruzM=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=X1kNcKaGFNpaX4cVJ/+LaCgIYDPDPhBReNcdkykUPXXWM7/5b/2c6jtsRUoaIvoma UcfffJeOAJjdIphxRiEHsPXCdQaLCcoRi+17f8P02QMnQ5aWe89qFJ6OE8qatt/DQd mgl6I3sW8VpNNh1YYbWguvqUlJGZxvJGw0S75rYY= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20200511013711epcas1p1322a0260f9872eb59bde3f1273d415ae~N1Ym9PZK30619506195epcas1p1k; Mon, 11 May 2020 01:37:11 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.152]) by epsnrtp3.localdomain (Postfix) with ESMTP id 49L3Sz6YX3zMqYkw; Mon, 11 May 2020 01:37:07 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id C8.7F.04544.24CA8BE5; Mon, 11 May 2020 10:37:06 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p3.samsung.com (KnoxPortal) with ESMTPA id 20200511013705epcas1p3977ae590f3e7b43c1feabe2e2efa6a84~N1YiM2rFb1607916079epcas1p3D; Mon, 11 May 2020 01:37:05 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200511013705epsmtrp16a9aaca8dcfa56ca4623794f26e6b930~N1YiKpiyE1890818908epsmtrp1R; Mon, 11 May 2020 01:37:05 +0000 (GMT) X-AuditID: b6c32a36-7ffff700000011c0-78-5eb8ac42a3a0 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id FF.C0.25866.14CA8BE5; Mon, 11 May 2020 10:37:05 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200511013705epsmtip1de04f4042f5d2d2f48f4bf30d675ef67~N1YiBo5YG1462314623epsmtip1O; Mon, 11 May 2020 01:37:05 +0000 (GMT) Subject: Re: [PATCH] extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' To: Christophe JAILLET , myungjoo.ham@samsung.com, anish198519851985@gmail.com, gregkh@linuxfoundation.org, jic23@kernel.org, lars@metafoo.de Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org From: Chanwoo Choi Organization: Samsung Electronics Message-ID: Date: Mon, 11 May 2020 10:47:10 +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: <20200510095303.231635-1-christophe.jaillet@wanadoo.fr> Content-Language: en-US Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCJsWRmVeSWpSXmKPExsWy7bCmrq7Tmh1xBlfaZC0u3+hitth6cC6r RfPi9WwWD5pWMVlsvSVtsWTyfFaLy7vmsFncblzB5sDhsXPWXXaPTas62Tz2z13D7rHkzSFW j74tqxg9Pm+S8/h8dz1rAHtUtk1GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJe Ym6qrZKLT4CuW2YO0FFKCmWJOaVAoYDE4mIlfTubovzSklSFjPziElul1IKUnALLAr3ixNzi 0rx0veT8XCtDAwMjU6DChOyMRbu2shbs5q1YsHIxSwPjRO4uRk4OCQETieZLlxi7GLk4hAR2 MEocX36dDcL5xChxdu8WdgjnM6PEgc83mWBa7lx7zwyR2MUo8XzbTaj+94wSGy6fYgepEhaI lLj0cj1YlYjABkaJiw93M4IkmAUcJb6cOARmswloSex/cYMNxOYXUJS4+uMxWJxXwE5i4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/Oh4vIS29/OYZ7AKDwLSfssJC2zkLTMQtKygJFlFaNkakFxbnpusWGBUV5quV5x Ym5xaV66XnJ+7iZGcLRpae1g3LPqg94hRiYOxkOMEhzMSiK8y3N3xAnxpiRWVqUW5ccXleak Fh9ilOZgURLn/TprYZyQQHpiSWp2ampBahFMlomDU6qBqUXoiNteraV1rY+1HTMXBqn7c4bt SNH2zNiWNveXwdmTM7jfLzA4f3jqmcmpR+r0v3EsO5UfXVwrFS+07JfQteerRYuSDCUlPi7O NrNb97XN1WB1mkDD9xcx1T8+X/SJ9P6xajVLfm7O01CFGVt/Rq6rZlPWlPjMueSU8h2mjNK4 2uOdG5nX8AiLbcoM5V8VpvvikpYV70N5gxm34lr+ef0IZZX7nnq+a1KBy3tfDVYutx9RJ35u MK2uYVw9/69ygnv67QWKVuaFWxrT45fEc9f/4lnXaKL4/+zSp0aHbeweLdi5sPR+8ZF5px5v yn514PBjvvLpc068FlU55Wt9IaXG0aejJSKEbX/V6pSvSizFGYmGWsxFxYkAm8lYxSUDAAA= X-CMS-MailID: 20200511013705epcas1p3977ae590f3e7b43c1feabe2e2efa6a84 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: 20200510095313epcas1p2ee698cfbe023da47555c603260fe2188 References: <20200510095303.231635-1-christophe.jaillet@wanadoo.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/10/20 6:53 PM, Christophe JAILLET wrote: > In some error handling paths, a call to 'iio_channel_get()' is not balanced > by a corresponding call to 'iio_channel_release()'. > > This can be achieved easily by using the devm_ variant of > 'iio_channel_get()'. > > This has the extra benefit to simplify the remove function. > > Fixes: 19939860dcae ("extcon: adc_jack: adc-jack driver to support 3.5 pi or simliar devices") > Signed-off-by: Christophe JAILLET > --- > This patch in a more complete version than commit 5a696d9760fe > ("extcon: adc-jack: Release IIO channel on driver remove") which fixed the > issue for the remove function only. > --- > drivers/extcon/extcon-adc-jack.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c > index ad02dc6747a4..0317b614b680 100644 > --- a/drivers/extcon/extcon-adc-jack.c > +++ b/drivers/extcon/extcon-adc-jack.c > @@ -124,7 +124,7 @@ static int adc_jack_probe(struct platform_device *pdev) > for (i = 0; data->adc_conditions[i].id != EXTCON_NONE; i++); > data->num_conditions = i; > > - data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel); > + data->chan = devm_iio_channel_get(&pdev->dev, pdata->consumer_channel); > if (IS_ERR(data->chan)) > return PTR_ERR(data->chan); > > @@ -164,7 +164,6 @@ static int adc_jack_remove(struct platform_device *pdev) > > free_irq(data->irq, data); > cancel_work_sync(&data->handler.work); > - iio_channel_release(data->chan); > > return 0; > } > Applied it. Thanks. -- Best Regards, Chanwoo Choi Samsung Electronics