From: Boris BREZILLON <boris.brezillon@free-electrons.com>
To: David Dueck <davidcdueck@googlemail.com>
Cc: linux-arm-kernel@lists.infradead.org, nicolas.ferre@atmel.com,
mkl@pengutronix.de, Anthony Harivel <anthony.harivel@emtrion.de>,
wg@grandegger.com, linux-can@vger.kernel.org
Subject: Re: [PATCHv2] can: at91_can: prepare and unprepare the clock
Date: Wed, 17 Sep 2014 20:34:44 +0200 [thread overview]
Message-ID: <20140917203444.126dadcd@bbrezillon> (raw)
In-Reply-To: <1410956808-1964-1-git-send-email-davidcdueck@googlemail.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: boris.brezillon@free-electrons.com (Boris BREZILLON)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2] can: at91_can: prepare and unprepare the clock
Date: Wed, 17 Sep 2014 20:34:44 +0200 [thread overview]
Message-ID: <20140917203444.126dadcd@bbrezillon> (raw)
In-Reply-To: <1410956808-1964-1-git-send-email-davidcdueck@googlemail.com>
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
next prev parent reply other threads:[~2014-09-17 18:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 12:26 [PATCHv2] can: at91_can: prepare and unprepare the clock David Dueck
2014-09-17 12:26 ` David Dueck
2014-09-17 18:34 ` Boris BREZILLON [this message]
2014-09-17 18:34 ` Boris BREZILLON
2014-09-17 20:16 ` Marc Kleine-Budde
2014-09-17 20:16 ` Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140917203444.126dadcd@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=anthony.harivel@emtrion.de \
--cc=davidcdueck@googlemail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=nicolas.ferre@atmel.com \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.