From patchwork Thu Nov 10 05:01:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 5019 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5D78C23E51 for ; Thu, 10 Nov 2011 05:02:05 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 4D595A18202 for ; Thu, 10 Nov 2011 05:02:05 +0000 (UTC) Received: by faan26 with SMTP id n26so3479649faa.11 for ; Wed, 09 Nov 2011 21:02:05 -0800 (PST) Received: by 10.152.109.199 with SMTP id hu7mr3566013lab.16.1320901325008; Wed, 09 Nov 2011 21:02:05 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.3.196 with SMTP id e4cs8663lae; Wed, 9 Nov 2011 21:02:04 -0800 (PST) Received: by 10.227.207.205 with SMTP id fz13mr3120912wbb.0.1320901323495; Wed, 09 Nov 2011 21:02:03 -0800 (PST) Received: from DB3EHSOBE006.bigfish.com (db3ehsobe006.messaging.microsoft.com. [213.199.154.144]) by mx.google.com with ESMTPS id b19si3955845wbh.57.2011.11.09.21.02.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 21:02:03 -0800 (PST) Received-SPF: neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=213.199.154.144; Authentication-Results: mx.google.com; spf=neutral (google.com: 213.199.154.144 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail44-db3-R.bigfish.com (10.3.81.241) by DB3EHSOBE006.bigfish.com (10.3.84.26) with Microsoft SMTP Server id 14.1.225.22; Thu, 10 Nov 2011 05:01:38 +0000 Received: from mail44-db3 (localhost.localdomain [127.0.0.1]) by mail44-db3-R.bigfish.com (Postfix) with ESMTP id D209910983FD; Thu, 10 Nov 2011 05:01:52 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dh87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-SS: 0,13, X-FB-DOMAIN-IP-MATCH: fail Received: from mail44-db3 (localhost.localdomain [127.0.0.1]) by mail44-db3 (MessageSwitch) id 1320901311739754_9188; Thu, 10 Nov 2011 05:01:51 +0000 (UTC) Received: from DB3EHSMHS004.bigfish.com (unknown [10.3.81.241]) by mail44-db3.bigfish.com (Postfix) with ESMTP id AC823680055; Thu, 10 Nov 2011 05:01:51 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS004.bigfish.com (10.3.87.104) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 10 Nov 2011 05:01:35 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.339.2; Wed, 9 Nov 2011 23:01:58 -0600 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id pAA51tSu019481; Wed, 9 Nov 2011 23:01:55 -0600 (CST) From: Richard Zhao To: CC: , , , , , Richard Zhao Subject: [PATCH 1/1] net: fec: convert to clk_prepare/clk_unprepare Date: Thu, 10 Nov 2011 13:01:44 +0800 Message-ID: <1320901304-13157-1-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Signed-off-by: Richard Zhao --- drivers/net/ethernet/freescale/fec.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c index 1124ce0..92e3585 100644 --- a/drivers/net/ethernet/freescale/fec.c +++ b/drivers/net/ethernet/freescale/fec.c @@ -1588,6 +1588,7 @@ fec_probe(struct platform_device *pdev) ret = PTR_ERR(fep->clk); goto failed_clk; } + clk_prepare(fep->clk); clk_enable(fep->clk); ret = fec_enet_init(ndev); @@ -1612,6 +1613,7 @@ failed_register: failed_mii_init: failed_init: clk_disable(fep->clk); + clk_unprepare(fep->clk); clk_put(fep->clk); failed_clk: for (i = 0; i < FEC_IRQ_NUM; i++) { @@ -1639,6 +1641,7 @@ fec_drv_remove(struct platform_device *pdev) fec_stop(ndev); fec_enet_mii_remove(fep); clk_disable(fep->clk); + clk_unprepare(fep->clk); clk_put(fep->clk); iounmap(fep->hwp); unregister_netdev(ndev); @@ -1665,6 +1668,7 @@ fec_suspend(struct device *dev) netif_device_detach(ndev); } clk_disable(fep->clk); + clk_unprepare(fep->clk); return 0; } @@ -1675,6 +1679,7 @@ fec_resume(struct device *dev) struct net_device *ndev = dev_get_drvdata(dev); struct fec_enet_private *fep = netdev_priv(ndev); + clk_prepare(fep->clk); clk_enable(fep->clk); if (netif_running(ndev)) { fec_restart(ndev, fep->full_duplex);