Commit 9b183317 authored by Rakesh Sankaranarayanan's avatar Rakesh Sankaranarayanan Committed by David S. Miller

net: dsa: microchip: add dev_err_probe in probe functions

Probe functions uses normal dev_err() to check error conditions
and print messages. Replace dev_err() with dev_err_probe() to
have more standardized format and error logging.
Signed-off-by: default avatarRakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4630d142
...@@ -152,11 +152,10 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev) ...@@ -152,11 +152,10 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev)
&regmap_smi[i], dev, &regmap_smi[i], dev,
&rc); &rc);
if (IS_ERR(dev->regmap[i])) { if (IS_ERR(dev->regmap[i])) {
ret = PTR_ERR(dev->regmap[i]); return dev_err_probe(&mdiodev->dev,
dev_err(&mdiodev->dev, PTR_ERR(dev->regmap[i]),
"Failed to initialize regmap%i: %d\n", "Failed to initialize regmap%i\n",
ksz8863_regmap_config[i].val_bits, ret); ksz8863_regmap_config[i].val_bits);
return ret;
} }
} }
......
...@@ -30,11 +30,9 @@ static int ksz9477_i2c_probe(struct i2c_client *i2c, ...@@ -30,11 +30,9 @@ static int ksz9477_i2c_probe(struct i2c_client *i2c,
rc.lock_arg = &dev->regmap_mutex; rc.lock_arg = &dev->regmap_mutex;
dev->regmap[i] = devm_regmap_init_i2c(i2c, &rc); dev->regmap[i] = devm_regmap_init_i2c(i2c, &rc);
if (IS_ERR(dev->regmap[i])) { if (IS_ERR(dev->regmap[i])) {
ret = PTR_ERR(dev->regmap[i]); return dev_err_probe(&i2c->dev, PTR_ERR(dev->regmap[i]),
dev_err(&i2c->dev, "Failed to initialize regmap%i\n",
"Failed to initialize regmap%i: %d\n", ksz9477_regmap_config[i].val_bits);
ksz9477_regmap_config[i].val_bits, ret);
return ret;
} }
} }
......
...@@ -71,11 +71,9 @@ static int ksz_spi_probe(struct spi_device *spi) ...@@ -71,11 +71,9 @@ static int ksz_spi_probe(struct spi_device *spi)
dev->regmap[i] = devm_regmap_init_spi(spi, &rc); dev->regmap[i] = devm_regmap_init_spi(spi, &rc);
if (IS_ERR(dev->regmap[i])) { if (IS_ERR(dev->regmap[i])) {
ret = PTR_ERR(dev->regmap[i]); return dev_err_probe(&spi->dev, PTR_ERR(dev->regmap[i]),
dev_err(&spi->dev, "Failed to initialize regmap%i\n",
"Failed to initialize regmap%i: %d\n", regmap_config[i].val_bits);
regmap_config[i].val_bits, ret);
return ret;
} }
} }
......
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