From: Shawn Guo Date: Tue, 20 Dec 2011 06:05:52 +0000 (+0800) Subject: net: flexcan: convert to clk_prepare/clk_unprepare X-Git-Tag: firefly_0821_release~3680^2~3787^2^2^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e735489976c356a189f7332e6ff4b0dee2ede434;p=firefly-linux-kernel-4.4.55.git net: flexcan: convert to clk_prepare/clk_unprepare The patch converts flexcan driver to clk_prepare/clk_unprepare by using helper functions clk_prepare_enable/clk_disable_unprepare. Signed-off-by: Shawn Guo Cc: Marc Kleine-Budde Cc: David S. Miller --- diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index e02337953f41..fdd0f3fbeabb 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -802,7 +802,7 @@ static int flexcan_open(struct net_device *dev) struct flexcan_priv *priv = netdev_priv(dev); int err; - clk_enable(priv->clk); + clk_prepare_enable(priv->clk); err = open_candev(dev); if (err) @@ -824,7 +824,7 @@ static int flexcan_open(struct net_device *dev) out_close: close_candev(dev); out: - clk_disable(priv->clk); + clk_disable_unprepare(priv->clk); return err; } @@ -838,7 +838,7 @@ static int flexcan_close(struct net_device *dev) flexcan_chip_stop(dev); free_irq(dev->irq, dev); - clk_disable(priv->clk); + clk_disable_unprepare(priv->clk); close_candev(dev); @@ -877,7 +877,7 @@ static int __devinit register_flexcandev(struct net_device *dev) struct flexcan_regs __iomem *regs = priv->base; u32 reg, err; - clk_enable(priv->clk); + clk_prepare_enable(priv->clk); /* select "bus clock", chip must be disabled */ flexcan_chip_disable(priv); @@ -911,7 +911,7 @@ static int __devinit register_flexcandev(struct net_device *dev) out: /* disable core and turn off clocks */ flexcan_chip_disable(priv); - clk_disable(priv->clk); + clk_disable_unprepare(priv->clk); return err; }