From patchwork Wed Jul 15 18:04:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King X-Patchwork-Id: 6799941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC993C05AC for ; Wed, 15 Jul 2015 18:06:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D103720527 for ; Wed, 15 Jul 2015 18:06:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 077AC204EC for ; Wed, 15 Jul 2015 18:06:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFR31-0004pU-40; Wed, 15 Jul 2015 18:04:47 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFR2q-0004Uu-Ur for linux-arm-kernel@lists.infradead.org; Wed, 15 Jul 2015 18:04:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References:In-Reply-To; bh=QiFHQC+CrOkjMz2xV7I5AiSERyS1RWyehh/NGVNnTT4=; b=Lt3PxhFu8PPMBEW0e/AgFWmGXPvqxBGrfVW/LGrF2M5aegqvHIS5G8z4KXYXJd0s1lCf4REu9RrUVJgVSPdbw0WdtT3yYhuFD8wzqcrjX1/iu1ZtSgx8d9jZ6kZZgCba7CugA29nCKLHM9MRs1ugrS1+sFVOuyaD/+vhiEduKnw=; Received: from e0022681537dd.dyn.arm.linux.org.uk ([2002:4e20:1eda:1:222:68ff:fe15:37dd]:37415 helo=rmk-PC.arm.linux.org.uk) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZFR2R-00051C-SJ; Wed, 15 Jul 2015 19:04:11 +0100 Received: from rmk by rmk-PC.arm.linux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1ZFR2P-0007MM-Gp; Wed, 15 Jul 2015 19:04:09 +0100 In-Reply-To: <20150715180342.GB7557@n2100.arm.linux.org.uk> References: <20150715180342.GB7557@n2100.arm.linux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org,linux-pcmcia@lists.infradead.org Subject: [PATCH 3/8] pcmcia: pxa2xx: update socket driver to use devm_clk_get() API MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Wed, 15 Jul 2015 19:04:09 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150715_110437_703368_FDE5B229 X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -3.4 (---) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Eremin-Solenikov , Robert Jarzmik , Haojian Zhuang , Daniel Mack Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update the pxa2xx socket driver to use the devm_clk_get() API so that the cleanup paths are simplified. Signed-off-by: Russell King Reviewed-by: Robert Jarzmik --- drivers/pcmcia/pxa2xx_base.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 984a8ff559d8..197c77a64ce0 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c @@ -296,17 +296,15 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) goto err0; } - clk = clk_get(&dev->dev, NULL); + clk = devm_clk_get(&dev->dev, NULL); if (IS_ERR(clk)) return -ENODEV; pxa2xx_drv_pcmcia_ops(ops); sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); - if (!sinfo) { - clk_put(clk); + if (!sinfo) return -ENOMEM; - } sinfo->nskt = ops->nr; sinfo->clk = clk; @@ -332,7 +330,6 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) err1: while (--i >= 0) soc_pcmcia_remove_one(&sinfo->skt[i]); - clk_put(clk); kfree(sinfo); err0: return ret; @@ -348,7 +345,6 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev) for (i = 0; i < sinfo->nskt; i++) soc_pcmcia_remove_one(&sinfo->skt[i]); - clk_put(sinfo->clk); kfree(sinfo); return 0; }