summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/micrel/ks8851.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-06-02 06:58:02 +0200
committerDavid S. Miller <davem@davemloft.net>2014-06-02 06:58:02 +0200
commitee39facbf82e73e468c504d2b40e83e2d223c28c (patch)
tree802451ae11344f94f66a8b922a5418095707517e /drivers/net/ethernet/micrel/ks8851.c
parentnet: ks8851: Don't use regulator_get_optional() (diff)
downloadlinux-ee39facbf82e73e468c504d2b40e83e2d223c28c.tar.xz
linux-ee39facbf82e73e468c504d2b40e83e2d223c28c.zip
net: Revert mlx4 cpumask changes.
This reverts commit 70a640d0dae3a9b1b222ce673eb5d92c263ddd61 ("net/mlx4_en: Use affinity hint") and commit c8865b64b05b2f4eeefd369373e9c8aeb069e7a1 ("cpumask: Utility function to set n'th cpu - local cpu first") because these changes break the build when SMP is disabled amongst other things. Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/micrel/ks8851.c')
-rw-r--r--drivers/net/ethernet/micrel/ks8851.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 66d4ab703f45..e72918970a58 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -1441,30 +1441,32 @@ static int ks8851_probe(struct spi_device *spi)
}
}
- ks->vdd_io = devm_regulator_get(&spi->dev, "vdd-io");
+ ks->vdd_io = devm_regulator_get_optional(&spi->dev, "vdd-io");
if (IS_ERR(ks->vdd_io)) {
ret = PTR_ERR(ks->vdd_io);
- goto err_reg_io;
- }
-
- ret = regulator_enable(ks->vdd_io);
- if (ret) {
- dev_err(&spi->dev, "regulator vdd_io enable fail: %d\n",
- ret);
- goto err_reg_io;
+ if (ret == -EPROBE_DEFER)
+ goto err_reg_io;
+ } else {
+ ret = regulator_enable(ks->vdd_io);
+ if (ret) {
+ dev_err(&spi->dev, "regulator vdd_io enable fail: %d\n",
+ ret);
+ goto err_reg_io;
+ }
}
- ks->vdd_reg = devm_regulator_get(&spi->dev, "vdd");
+ ks->vdd_reg = devm_regulator_get_optional(&spi->dev, "vdd");
if (IS_ERR(ks->vdd_reg)) {
ret = PTR_ERR(ks->vdd_reg);
- goto err_reg;
- }
-
- ret = regulator_enable(ks->vdd_reg);
- if (ret) {
- dev_err(&spi->dev, "regulator vdd enable fail: %d\n",
- ret);
- goto err_reg;
+ if (ret == -EPROBE_DEFER)
+ goto err_reg;
+ } else {
+ ret = regulator_enable(ks->vdd_reg);
+ if (ret) {
+ dev_err(&spi->dev, "regulator vdd enable fail: %d\n",
+ ret);
+ goto err_reg;
+ }
}
if (gpio_is_valid(gpio)) {
@@ -1570,9 +1572,11 @@ err_irq:
if (gpio_is_valid(gpio))
gpio_set_value(gpio, 0);
err_id:
- regulator_disable(ks->vdd_reg);
+ if (!IS_ERR(ks->vdd_reg))
+ regulator_disable(ks->vdd_reg);
err_reg:
- regulator_disable(ks->vdd_io);
+ if (!IS_ERR(ks->vdd_io))
+ regulator_disable(ks->vdd_io);
err_reg_io:
err_gpio:
free_netdev(ndev);
@@ -1590,8 +1594,10 @@ static int ks8851_remove(struct spi_device *spi)
free_irq(spi->irq, priv);
if (gpio_is_valid(priv->gpio))
gpio_set_value(priv->gpio, 0);
- regulator_disable(priv->vdd_reg);
- regulator_disable(priv->vdd_io);
+ if (!IS_ERR(priv->vdd_reg))
+ regulator_disable(priv->vdd_reg);
+ if (!IS_ERR(priv->vdd_io))
+ regulator_disable(priv->vdd_io);
free_netdev(priv->netdev);
return 0;