From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759157AbcAUJ0a (ORCPT ); Thu, 21 Jan 2016 04:26:30 -0500 Received: from mail-db3on0124.outbound.protection.outlook.com ([157.55.234.124]:38816 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759136AbcAUJ0Y convert rfc822-to-8bit (ORCPT ); Thu, 21 Jan 2016 04:26:24 -0500 From: "Gujulan Elango, Hari Prasath (H.)" To: "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" CC: "devel@driverdev.osuosl.org" , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: [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+3KJF7P0iqAELP3nSs1w== Date: Thu, 21 Jan 2016 09:11:38 +0000 Message-ID: <20160121091238.GA9430@IND12F0122> 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: [74.112.164.116] x-microsoft-exchange-diagnostics: 1;DB5PR06MB1575;5:vO1YNRtnOizoxmWV5VtyGincrGk0duHchaXpzBUHy6XIDZs4FdQY4OfvsvVm8BwNQpg3r/OGBVS+COI10EzoeXo+K0dWioQpqUVVzflv5Mr3O2LhF6KTj8JU6T2j6kmByslxxM03E2gpaK1McgHu6w==;24:C46zWTGnLFSXxGAA0vgIs9Xbrm7hpZzGogAXsFxcEXu/kd67Ax3byZcqU5hunkIbaBiLvpyW2m81qdhj011yV54A3HDLt13GbP8/9Ykhm4s= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1575; x-ms-office365-filtering-correlation-id: 41d06c47-3b6d-40c0-e37a-08d32242de45 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)(5005006)(520078)(8121501046)(3002001)(10201501046);SRVR:DB5PR06MB1575;BCL:0;PCL:0;RULEID:;SRVR:DB5PR06MB1575; x-forefront-prvs: 08286A0BE2 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(189002)(575784001)(2900100001)(66066001)(77096005)(2860100001)(33716001)(229853001)(92566002)(19580405001)(105586002)(33656002)(2201001)(86362001)(19580395003)(106356001)(106116001)(50986999)(101416001)(54356999)(122556002)(1220700001)(10400500002)(2501003)(1096002)(1076002)(40100003)(5001770100001)(5004730100002)(3846002)(102836003)(81156007)(189998001)(586003)(11100500001)(6116002)(97736004)(4326007)(5008740100001)(2906002)(5002640100001)(5001960100002)(87936001)(7059030);DIR:OUT;SFP:1102;SCL:1;SRVR:DB5PR06MB1575;H:DB5PR06MB1573.eurprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <584BD994F1B43844953DFBA9A8E072B7@eurprd06.prod.outlook.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visteon.com X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2016 09:11:38.0742 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7a147aaf-01ec-498c-80a1-e34a8c63c548 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR06MB1575 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -errout2: - clk_put(st->clk); errout1: iounmap(st->adc_base_spear6xx); return ret; -- 1.9.1