linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] can: at91_can: prepare and unprepare the clock
@ 2014-09-17 12:26 David Dueck
  2014-09-17 18:34 ` Boris BREZILLON
  2014-09-17 20:16 ` Marc Kleine-Budde
  0 siblings, 2 replies; 3+ messages in thread
From: David Dueck @ 2014-09-17 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

Make the driver work with the common clock framework.

Signed-off-by: David Dueck <davidcdueck@googlemail.com>
Signed-off-by: Anthony Harivel <anthony.harivel@emtrion.de>
---
Changes since v1:
- improve commit message
- check return value of clk_prepare_enable

 drivers/net/can/at91_can.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index f07fa89..05e1aa0 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)
 	struct at91_priv *priv = netdev_priv(dev);
 	int err;
 
-	clk_enable(priv->clk);
+	err = clk_prepare_enable(priv->clk);
+	if (err)
+		return err;
 
 	/* check or determine and set bittime */
 	err = open_candev(dev);
@@ -1149,7 +1151,7 @@ static int at91_open(struct net_device *dev)
  out_close:
 	close_candev(dev);
  out:
-	clk_disable(priv->clk);
+	clk_disable_unprepare(priv->clk);
 
 	return err;
 }
@@ -1166,7 +1168,7 @@ static int at91_close(struct net_device *dev)
 	at91_chip_stop(dev, CAN_STATE_STOPPED);
 
 	free_irq(dev->irq, dev);
-	clk_disable(priv->clk);
+	clk_disable_unprepare(priv->clk);
 
 	close_candev(dev);
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCHv2] can: at91_can: prepare and unprepare the clock
  2014-09-17 12:26 [PATCHv2] can: at91_can: prepare and unprepare the clock David Dueck
@ 2014-09-17 18:34 ` Boris BREZILLON
  2014-09-17 20:16 ` Marc Kleine-Budde
  1 sibling, 0 replies; 3+ messages in thread
From: Boris BREZILLON @ 2014-09-17 18:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 17 Sep 2014 14:26:48 +0200
David Dueck <davidcdueck@googlemail.com> wrote:

> Make the driver work with the common clock framework.
> 
> 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>

> ---
> Changes since v1:
> - improve commit message
> - check return value of clk_prepare_enable
> 
>  drivers/net/can/at91_can.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
> index f07fa89..05e1aa0 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)
>  	struct at91_priv *priv = netdev_priv(dev);
>  	int err;
>  
> -	clk_enable(priv->clk);
> +	err = clk_prepare_enable(priv->clk);
> +	if (err)
> +		return err;
>  
>  	/* check or determine and set bittime */
>  	err = open_candev(dev);
> @@ -1149,7 +1151,7 @@ static int at91_open(struct net_device *dev)
>   out_close:
>  	close_candev(dev);
>   out:
> -	clk_disable(priv->clk);
> +	clk_disable_unprepare(priv->clk);
>  
>  	return err;
>  }
> @@ -1166,7 +1168,7 @@ static int at91_close(struct net_device *dev)
>  	at91_chip_stop(dev, CAN_STATE_STOPPED);
>  
>  	free_irq(dev->irq, dev);
> -	clk_disable(priv->clk);
> +	clk_disable_unprepare(priv->clk);
>  
>  	close_candev(dev);
>  



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCHv2] can: at91_can: prepare and unprepare the clock
  2014-09-17 12:26 [PATCHv2] can: at91_can: prepare and unprepare the clock David Dueck
  2014-09-17 18:34 ` Boris BREZILLON
@ 2014-09-17 20:16 ` Marc Kleine-Budde
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2014-09-17 20:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/17/2014 02:26 PM, David Dueck wrote:
> Make the driver work with the common clock framework.
> 
> Signed-off-by: David Dueck <davidcdueck@googlemail.com>
> Signed-off-by: Anthony Harivel <anthony.harivel@emtrion.de>

Added with a some more prose commit message to the linux-can tree.

Thanks,
Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140917/3fc1801a/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-17 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-17 12:26 [PATCHv2] can: at91_can: prepare and unprepare the clock David Dueck
2014-09-17 18:34 ` Boris BREZILLON
2014-09-17 20:16 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).