Commit 686c953e authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-fixes-for-4.2-20150716' of...

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

Marc Kleine-Budde says:

====================
pull-request: can 2015-07-16

this is a pull request of 2 patches by Stefan Agner. He fixes the resume
operation in the mcp251x driver.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents fdbf5b09 69da3f2a
...@@ -1086,8 +1086,8 @@ static int mcp251x_can_probe(struct spi_device *spi) ...@@ -1086,8 +1086,8 @@ static int mcp251x_can_probe(struct spi_device *spi)
if (ret) if (ret)
goto out_clk; goto out_clk;
priv->power = devm_regulator_get(&spi->dev, "vdd"); priv->power = devm_regulator_get_optional(&spi->dev, "vdd");
priv->transceiver = devm_regulator_get(&spi->dev, "xceiver"); priv->transceiver = devm_regulator_get_optional(&spi->dev, "xceiver");
if ((PTR_ERR(priv->power) == -EPROBE_DEFER) || if ((PTR_ERR(priv->power) == -EPROBE_DEFER) ||
(PTR_ERR(priv->transceiver) == -EPROBE_DEFER)) { (PTR_ERR(priv->transceiver) == -EPROBE_DEFER)) {
ret = -EPROBE_DEFER; ret = -EPROBE_DEFER;
...@@ -1222,17 +1222,16 @@ static int __maybe_unused mcp251x_can_resume(struct device *dev) ...@@ -1222,17 +1222,16 @@ static int __maybe_unused mcp251x_can_resume(struct device *dev)
struct spi_device *spi = to_spi_device(dev); struct spi_device *spi = to_spi_device(dev);
struct mcp251x_priv *priv = spi_get_drvdata(spi); struct mcp251x_priv *priv = spi_get_drvdata(spi);
if (priv->after_suspend & AFTER_SUSPEND_POWER) { if (priv->after_suspend & AFTER_SUSPEND_POWER)
mcp251x_power_enable(priv->power, 1); mcp251x_power_enable(priv->power, 1);
if (priv->after_suspend & AFTER_SUSPEND_UP) {
mcp251x_power_enable(priv->transceiver, 1);
queue_work(priv->wq, &priv->restart_work); queue_work(priv->wq, &priv->restart_work);
} else { } else {
if (priv->after_suspend & AFTER_SUSPEND_UP) { priv->after_suspend = 0;
mcp251x_power_enable(priv->transceiver, 1);
queue_work(priv->wq, &priv->restart_work);
} else {
priv->after_suspend = 0;
}
} }
priv->force_quit = 0; priv->force_quit = 0;
enable_irq(spi->irq); enable_irq(spi->irq);
return 0; return 0;
......
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