From patchwork Mon May 13 13:56:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 16883 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B023325E14 for ; Mon, 13 May 2013 13:58:26 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id gf12sf8042603vcb.4 for ; Mon, 13 May 2013 06:57:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :from:to:cc:subject:date:message-id:x-mailer:mime-version :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=kapg8pKDbrtVwU7iCKjAsEfk1aQo7e8euUsLACvgaCk=; b=ef/HtSzIOwqz8zATySkPJ6Ex1coMn/8gbsoTpWXvHnNQzGPk7BXrOjFeQOitN123jw Xflrs4FygxxLpJ2sE3LdmsNNH5DLkoyrY6OH99KT45+G+Wjk2PYrbDsXF3BoIr0NMw0T CFb/DLbS/Pww4xtzHljes0hVPx9vQf/S1XG7l+kVzSDIRoPRx/TEY3ej2B/ZCHqDNCCI YUYH6ze9xCoHwtqbEaY+9lqnUhDpqkkAEAyKMfxO5Jx4+M39kTMCSRvVuJ3lbdGmoxjs ClJvTJKTyBgMw7JxQzkIFBVURjQZB4BJM5/SgEXlkb0WTHXWpWyYpVLWgwgWHnfV/M8c WTtA== X-Received: by 10.224.130.195 with SMTP id u3mr18978371qas.1.1368453473945; Mon, 13 May 2013 06:57:53 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.163 with SMTP id 3ls3028547qef.58.gmail; Mon, 13 May 2013 06:57:53 -0700 (PDT) X-Received: by 10.52.160.102 with SMTP id xj6mr4943258vdb.45.1368453473742; Mon, 13 May 2013 06:57:53 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id wy7si8485793vec.13.2013.05.13.06.57.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 May 2013 06:57:53 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id 12so5212345vbf.18 for ; Mon, 13 May 2013 06:57:53 -0700 (PDT) X-Received: by 10.58.227.104 with SMTP id rz8mr18396428vec.22.1368453473394; Mon, 13 May 2013 06:57:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.217.15 with SMTP id hk15csp19899vcb; Mon, 13 May 2013 06:57:52 -0700 (PDT) X-Received: by 10.14.100.1 with SMTP id y1mr79447327eef.9.1368453472347; Mon, 13 May 2013 06:57:52 -0700 (PDT) Received: from eu1sys200aog116.obsmtp.com (eu1sys200aog116.obsmtp.com [207.126.144.141]) by mx.google.com with SMTP id i3si22870153eev.239.2013.05.13.06.57.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 May 2013 06:57:52 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.141 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.141; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKUZDxRVs11nrSGeDgBBJ/dwdPvQ07i2h7@postini.com; Mon, 13 May 2013 13:57:52 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 155E71A5; Mon, 13 May 2013 13:56:36 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E803352DE; Mon, 13 May 2013 13:56:25 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id C98C724C2AB; Mon, 13 May 2013 15:56:28 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 13 May 2013 15:56:36 +0200 From: Ulf Hansson To: , Russell King Cc: , Chris Ball , Ulf Hansson Subject: [PATCH] mmc: mmci: Use devm_clk_get API Date: Mon, 13 May 2013 15:56:33 +0200 Message-ID: <1368453393-1272-1-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlEWtWGeV7CR3bo1cIwRMSKABnnqkSAZf1TIaQlY4PxdZB0cFDh3Y6jmZ+ok4DbrbeE1vGu X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ulf Hansson Converting to devm_clk_get simplifies error handling in probe and we can remove other corresponding calls to clk_put. Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index f4f3038..d57ce43 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1362,16 +1362,15 @@ static int mmci_probe(struct amba_device *dev, dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer); dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision); - host->clk = clk_get(&dev->dev, NULL); + host->clk = devm_clk_get(&dev->dev, NULL); if (IS_ERR(host->clk)) { ret = PTR_ERR(host->clk); - host->clk = NULL; goto host_free; } ret = clk_prepare_enable(host->clk); if (ret) - goto clk_free; + goto host_free; host->plat = plat; host->variant = variant; @@ -1576,8 +1575,6 @@ static int mmci_probe(struct amba_device *dev, iounmap(host->base); clk_disable: clk_disable_unprepare(host->clk); - clk_free: - clk_put(host->clk); host_free: mmc_free_host(mmc); rel_regions: @@ -1623,7 +1620,6 @@ static int mmci_remove(struct amba_device *dev) iounmap(host->base); clk_disable_unprepare(host->clk); - clk_put(host->clk); mmc_free_host(mmc);