From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Yegor Yefremov <yegorslists@googlemail.com>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 4.4 10/23] can: ti_hecc: add missing prepare and unprepare of the clock
Date: Tue, 31 Jan 2017 06:37:12 +0100 [thread overview]
Message-ID: <20170131053625.379315464@linuxfoundation.org> (raw)
In-Reply-To: <20170131053624.926643555@linuxfoundation.org>
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yegor Yefremov <yegorslists@googlemail.com>
commit befa60113ce7ea270cb51eada28443ca2756f480 upstream.
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().
Also add error checking for clk_prepare_enable().
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/ti_hecc.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -948,7 +948,12 @@ static int ti_hecc_probe(struct platform
netif_napi_add(ndev, &priv->napi, ti_hecc_rx_poll,
HECC_DEF_NAPI_WEIGHT);
- clk_enable(priv->clk);
+ err = clk_prepare_enable(priv->clk);
+ if (err) {
+ dev_err(&pdev->dev, "clk_prepare_enable() failed\n");
+ goto probe_exit_clk;
+ }
+
err = register_candev(ndev);
if (err) {
dev_err(&pdev->dev, "register_candev() failed\n");
@@ -981,7 +986,7 @@ static int ti_hecc_remove(struct platfor
struct ti_hecc_priv *priv = netdev_priv(ndev);
unregister_candev(ndev);
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);
clk_put(priv->clk);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
iounmap(priv->base);
@@ -1006,7 +1011,7 @@ static int ti_hecc_suspend(struct platfo
hecc_set_bit(priv, HECC_CANMC, HECC_CANMC_PDR);
priv->can.state = CAN_STATE_SLEEPING;
- clk_disable(priv->clk);
+ clk_disable_unprepare(priv->clk);
return 0;
}
@@ -1015,8 +1020,11 @@ static int ti_hecc_resume(struct platfor
{
struct net_device *dev = platform_get_drvdata(pdev);
struct ti_hecc_priv *priv = netdev_priv(dev);
+ int err;
- clk_enable(priv->clk);
+ err = clk_prepare_enable(priv->clk);
+ if (err)
+ return err;
hecc_clear_bit(priv, HECC_CANMC, HECC_CANMC_PDR);
priv->can.state = CAN_STATE_ERROR_ACTIVE;
next prev parent reply other threads:[~2017-01-31 5:47 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 5:37 [PATCH 4.4 00/23] 4.4.46-stable review Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 01/23] fbdev: color map copying bounds checking Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 02/23] tile/ptrace: Preserve previous registers for short regset write Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 04/23] mm/mempolicy.c: do not put mempolicy before using its nodemask Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 05/23] sysctl: fix proc_doulongvec_ms_jiffies_minmax() Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 06/23] ISDN: eicon: silence misleading array-bounds warning Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 07/23] RDMA/cma: Fix unknown symbol when CONFIG_IPV6 is not enabled Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 08/23] s390/ptrace: Preserve previous registers for short regset write Greg Kroah-Hartman
2017-01-31 5:37 ` Greg Kroah-Hartman [this message]
2017-01-31 5:37 ` [PATCH 4.4 11/23] ARC: udelay: fix inline assembler by adding LP_COUNT to clobber list Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 12/23] ARC: [arcompact] handle unaligned access delay slot corner case Greg Kroah-Hartman
2017-02-10 12:51 ` Ben Hutchings
2017-02-10 13:19 ` Greg Kroah-Hartman
2017-02-10 13:26 ` Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 13/23] parisc: Dont use BITS_PER_LONG in userspace-exported swab.h header Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 14/23] nfs: Dont increment lock sequence ID after NFS4ERR_MOVED Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 15/23] NFSv4.0: always send mode in SETATTR after EXCLUSIVE4 Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 16/23] SUNRPC: cleanup ida information when removing sunrpc module Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 18/23] IB/ipoib: move back IB LL address into the hard header Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 19/23] IB/umem: Release pid in error and ODP flow Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 20/23] [media] s5k4ecgx: select CRC32 helper Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 21/23] pinctrl: broxton: Use correct PADCFGLOCK offset Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 22/23] platform/x86: intel_mid_powerbtn: Set IRQ_ONESHOT Greg Kroah-Hartman
2017-01-31 5:37 ` [PATCH 4.4 23/23] mm, memcg: do not retry precharge charges Greg Kroah-Hartman
2017-01-31 17:23 ` [PATCH 4.4 00/23] 4.4.46-stable review Guenter Roeck
2017-01-31 22:06 ` Shuah Khan
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=20170131053625.379315464@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=stable@vger.kernel.org \
--cc=yegorslists@googlemail.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 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).