Commit ceb16a90 authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-fixes-for-4.8-20160919' of...

Merge tag 'linux-can-fixes-for-4.8-20160919' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2016-09-19

this is a pull request of one patch for the upcoming linux-4.8 release.

The patch by Fabio Estevam fixes the pm handling in the flexcan driver.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 67a99b70 4de349e7
......@@ -1268,11 +1268,10 @@ static int __maybe_unused flexcan_suspend(struct device *device)
struct flexcan_priv *priv = netdev_priv(dev);
int err;
if (netif_running(dev)) {
err = flexcan_chip_disable(priv);
if (err)
return err;
if (netif_running(dev)) {
netif_stop_queue(dev);
netif_device_detach(dev);
}
......@@ -1285,13 +1284,17 @@ static int __maybe_unused flexcan_resume(struct device *device)
{
struct net_device *dev = dev_get_drvdata(device);
struct flexcan_priv *priv = netdev_priv(dev);
int err;
priv->can.state = CAN_STATE_ERROR_ACTIVE;
if (netif_running(dev)) {
netif_device_attach(dev);
netif_start_queue(dev);
err = flexcan_chip_enable(priv);
if (err)
return err;
}
return flexcan_chip_enable(priv);
return 0;
}
static SIMPLE_DEV_PM_OPS(flexcan_pm_ops, flexcan_suspend, flexcan_resume);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment