From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752882AbcAVJEE (ORCPT ); Fri, 22 Jan 2016 04:04:04 -0500 Received: from mail-db3on0107.outbound.protection.outlook.com ([157.55.234.107]:10107 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752651AbcAVJDw convert rfc822-to-8bit (ORCPT ); Fri, 22 Jan 2016 04:03:52 -0500 From: "Gujulan Elango, Hari Prasath (H.)" To: Matt Ranostay CC: "gregkh@linuxfoundation.org" , "jic23@kernel.org" , "knaack.h@gmx.de" , "lars@metafoo.de" , "pmeerw@pmeerw.net" , "daniel.baluta@intel.com" , "ciorneiioana@gmail.com" , "hamohammed.sa@gmail.com" , "devel@driverdev.osuosl.org" , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] staging: iio: replace clk_get() with devm_clk_get() Thread-Topic: [PATCH] staging: iio: replace clk_get() with devm_clk_get() Thread-Index: AQHRVCu7U1+3KJF7P0iqAELP3nSs158GWaCAgADMQwA= Date: Fri, 22 Jan 2016 07:31:55 +0000 Message-ID: <20160122073258.GB10350@IND12F0122> References: <20160121091238.GA9430@IND12F0122> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=hgujulan@visteon.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [91.212.132.116] x-microsoft-exchange-diagnostics: 1;DB5PR06MB1573;5:Pm8Bu2CZAj9DQ0udxCpYslNJPJfJcWkUxXjcJjYSTnsiUa4iPMfrGhYS2iuKHrLweQnrqpfilvy8pH2fkkSohTCPO2ye5IRd8durQEenwbvsDhH7MR+8nOOYsY2GOeIHfRC//XErbMVi4LA/nMb1JA==;24:Yk5wYoR7J713118QZFt3EWWeBaLIKWzpF1C9XNiGhETMzBHPf1wz5knEe+mJxwyicHRnpy1ORI6Zgr8OqUNoHH4SgkH+ylDs7ODazK0CgBY= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1573; x-ms-office365-filtering-correlation-id: 8dd293db-761a-4779-3f06-08d322fe1a7b x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(208512329853888); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(123027)(601004)(2401047)(8121501046)(520078)(5005006)(10201501046)(3002001);SRVR:DB5PR06MB1573;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1573; x-forefront-prvs: 08296C9B35 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(189002)(199003)(377454003)(24454002)(575784001)(97736004)(40100003)(1076002)(5002640100001)(189998001)(66066001)(110136002)(81156007)(122556002)(5008740100001)(1220700001)(77096005)(11100500001)(5004730100002)(86362001)(33716001)(10400500002)(102836003)(33656002)(2950100001)(92566002)(2906002)(105586002)(76176999)(5001960100002)(2900100001)(54356999)(19580405001)(3846002)(50986999)(87936001)(106116001)(101416001)(6116002)(1096002)(4326007)(586003)(19580395003)(2860100001)(1411001)(106356001)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:DB5PR06MB1573;H:DB5PR06MB1573.eurprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <67644445339DE24DB23B17603FDAF878@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jan 2016 07:31:55.0069 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR06MB1573 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2016 at 11:21:53AM -0800, Matt Ranostay wrote: > On Thu, Jan 21, 2016 at 1:11 AM, Gujulan Elango, Hari Prasath (H.) > wrote: > > From: Hari Prasath Gujulan Elango > > > > This patch replaces the clk_get() with devm_clk_get(). > > Accordingly,modified the error paths and removed clk_put() as well. > > > > Signed-off-by: Hari Prasath Gujulan Elango > > --- > > drivers/staging/iio/adc/spear_adc.c | 6 ++---- > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c > > index 712cae0..4ac0f54 100644 > > --- a/drivers/staging/iio/adc/spear_adc.c > > +++ b/drivers/staging/iio/adc/spear_adc.c > > @@ -288,7 +288,7 @@ static int spear_adc_probe(struct platform_device *pdev) > > st->adc_base_spear3xx = > > (struct adc_regs_spear3xx __iomem *)st->adc_base_spear6xx; > > > > - st->clk = clk_get(dev, NULL); > > + st->clk = devm_clk_get(dev, NULL); > > if (IS_ERR(st->clk)) { > > dev_err(dev, "failed getting clock\n"); > > goto errout1; > > @@ -297,7 +297,7 @@ static int spear_adc_probe(struct platform_device *pdev) > > ret = clk_prepare_enable(st->clk); > > if (ret) { > > dev_err(dev, "failed enabling clock\n"); > > - goto errout2; > > + goto errout1; > > } > > > > irq = platform_get_irq(pdev, 0); > > @@ -356,8 +356,6 @@ static int spear_adc_probe(struct platform_device *pdev) > > > > errout3: > > clk_disable_unprepare(st->clk); > > Shouldn't errout3 now be errout2.. having a gap would seem odd. > I agree with you on this. But as Dan says,I would correct it in a different patch. > > -errout2: > > - clk_put(st->clk); > > errout1: > > iounmap(st->adc_base_spear6xx); > > return ret; > > -- > > 1.9.1