aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/can
diff options
context:
space:
mode:
authorDavid Dueck <davidcdueck@googlemail.com>2014-09-17 08:26:48 -0400
committerMarc Kleine-Budde <mkl@pengutronix.de>2014-09-18 05:15:37 -0400
commite77980e50bc2850599d4d9c0192b67a9ffd6daac (patch)
tree008ba8530575b4b7668582cb139d1ab00406efaf /drivers/net/can
parent4c728d804c4b9d1ae7f76e8f32c419bc21a6e540 (diff)
can: at91_can: add missing prepare and unprepare of the clock
In order to make the driver work with the common clock framework, this patch converts the clk_enable()/clk_disable() to clk_prepare_enable()/clk_disable_unprepare(). While there, add the missing error handling. Signed-off-by: David Dueck <davidcdueck@googlemail.com> Signed-off-by: Anthony Harivel <anthony.harivel@emtrion.de> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/at91_can.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index f07fa89b5fd5..05e1aa090add 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1123,7 +1123,9 @@ static int at91_open(struct net_device *dev)
1123 struct at91_priv *priv = netdev_priv(dev); 1123 struct at91_priv *priv = netdev_priv(dev);
1124 int err; 1124 int err;
1125 1125
1126 clk_enable(priv->clk); 1126 err = clk_prepare_enable(priv->clk);
1127 if (err)
1128 return err;
1127 1129
1128 /* check or determine and set bittime */ 1130 /* check or determine and set bittime */
1129 err = open_candev(dev); 1131 err = open_candev(dev);
@@ -1149,7 +1151,7 @@ static int at91_open(struct net_device *dev)
1149 out_close: 1151 out_close:
1150 close_candev(dev); 1152 close_candev(dev);
1151 out: 1153 out:
1152 clk_disable(priv->clk); 1154 clk_disable_unprepare(priv->clk);
1153 1155
1154 return err; 1156 return err;
1155} 1157}
@@ -1166,7 +1168,7 @@ static int at91_close(struct net_device *dev)
1166 at91_chip_stop(dev, CAN_STATE_STOPPED); 1168 at91_chip_stop(dev, CAN_STATE_STOPPED);
1167 1169
1168 free_irq(dev->irq, dev); 1170 free_irq(dev->irq, dev);
1169 clk_disable(priv->clk); 1171 clk_disable_unprepare(priv->clk);
1170 1172
1171 close_candev(dev); 1173 close_candev(dev);
1172 1174