mirror of https://gitee.com/openkylin/linux.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 <shawn.guo@linaro.org> Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
f1f802c902
commit
e735489976
|
@ -802,7 +802,7 @@ static int flexcan_open(struct net_device *dev)
|
||||||
struct flexcan_priv *priv = netdev_priv(dev);
|
struct flexcan_priv *priv = netdev_priv(dev);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
clk_enable(priv->clk);
|
clk_prepare_enable(priv->clk);
|
||||||
|
|
||||||
err = open_candev(dev);
|
err = open_candev(dev);
|
||||||
if (err)
|
if (err)
|
||||||
|
@ -824,7 +824,7 @@ static int flexcan_open(struct net_device *dev)
|
||||||
out_close:
|
out_close:
|
||||||
close_candev(dev);
|
close_candev(dev);
|
||||||
out:
|
out:
|
||||||
clk_disable(priv->clk);
|
clk_disable_unprepare(priv->clk);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -838,7 +838,7 @@ static int flexcan_close(struct net_device *dev)
|
||||||
flexcan_chip_stop(dev);
|
flexcan_chip_stop(dev);
|
||||||
|
|
||||||
free_irq(dev->irq, dev);
|
free_irq(dev->irq, dev);
|
||||||
clk_disable(priv->clk);
|
clk_disable_unprepare(priv->clk);
|
||||||
|
|
||||||
close_candev(dev);
|
close_candev(dev);
|
||||||
|
|
||||||
|
@ -877,7 +877,7 @@ static int __devinit register_flexcandev(struct net_device *dev)
|
||||||
struct flexcan_regs __iomem *regs = priv->base;
|
struct flexcan_regs __iomem *regs = priv->base;
|
||||||
u32 reg, err;
|
u32 reg, err;
|
||||||
|
|
||||||
clk_enable(priv->clk);
|
clk_prepare_enable(priv->clk);
|
||||||
|
|
||||||
/* select "bus clock", chip must be disabled */
|
/* select "bus clock", chip must be disabled */
|
||||||
flexcan_chip_disable(priv);
|
flexcan_chip_disable(priv);
|
||||||
|
@ -911,7 +911,7 @@ static int __devinit register_flexcandev(struct net_device *dev)
|
||||||
out:
|
out:
|
||||||
/* disable core and turn off clocks */
|
/* disable core and turn off clocks */
|
||||||
flexcan_chip_disable(priv);
|
flexcan_chip_disable(priv);
|
||||||
clk_disable(priv->clk);
|
clk_disable_unprepare(priv->clk);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue