Commit 46d1bfa0 authored by Marcus Folkesson's avatar Marcus Folkesson Committed by Jonathan Cameron
parent 655be10d
...@@ -277,10 +277,7 @@ static int mcp3911_calc_scale_table(struct mcp3911 *adc) ...@@ -277,10 +277,7 @@ static int mcp3911_calc_scale_table(struct mcp3911 *adc)
if (adc->vref) { if (adc->vref) {
ret = regulator_get_voltage(adc->vref); ret = regulator_get_voltage(adc->vref);
if (ret < 0) { if (ret < 0) {
dev_err(&adc->spi->dev, return dev_err_probe(&adc->spi->dev, ret, "failed to get vref voltage\n");
"failed to get vref voltage: %d\n",
ret);
return ret;
} }
ref = ret / 1000; ref = ret / 1000;
...@@ -396,10 +393,9 @@ static int mcp3911_config(struct mcp3911 *adc) ...@@ -396,10 +393,9 @@ static int mcp3911_config(struct mcp3911 *adc)
if (ret) if (ret)
device_property_read_u32(dev, "device-addr", &adc->dev_addr); device_property_read_u32(dev, "device-addr", &adc->dev_addr);
if (adc->dev_addr > 3) { if (adc->dev_addr > 3) {
dev_err(&adc->spi->dev, return dev_err_probe(dev, -EINVAL,
"invalid device address (%i). Must be in range 0-3.\n", "invalid device address (%i). Must be in range 0-3.\n",
adc->dev_addr); adc->dev_addr);
return -EINVAL;
} }
dev_dbg(&adc->spi->dev, "use device address %i\n", adc->dev_addr); dev_dbg(&adc->spi->dev, "use device address %i\n", adc->dev_addr);
...@@ -466,6 +462,7 @@ static const struct iio_trigger_ops mcp3911_trigger_ops = { ...@@ -466,6 +462,7 @@ static const struct iio_trigger_ops mcp3911_trigger_ops = {
static int mcp3911_probe(struct spi_device *spi) static int mcp3911_probe(struct spi_device *spi)
{ {
struct device *dev = &spi->dev;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
struct mcp3911 *adc; struct mcp3911 *adc;
int ret; int ret;
...@@ -482,10 +479,7 @@ static int mcp3911_probe(struct spi_device *spi) ...@@ -482,10 +479,7 @@ static int mcp3911_probe(struct spi_device *spi)
if (PTR_ERR(adc->vref) == -ENODEV) { if (PTR_ERR(adc->vref) == -ENODEV) {
adc->vref = NULL; adc->vref = NULL;
} else { } else {
dev_err(&adc->spi->dev, return dev_err_probe(dev, PTR_ERR(adc->vref), "failed to get regulator\n");
"failed to get regulator (%ld)\n",
PTR_ERR(adc->vref));
return PTR_ERR(adc->vref);
} }
} else { } else {
...@@ -504,10 +498,7 @@ static int mcp3911_probe(struct spi_device *spi) ...@@ -504,10 +498,7 @@ static int mcp3911_probe(struct spi_device *spi)
if (PTR_ERR(adc->clki) == -ENOENT) { if (PTR_ERR(adc->clki) == -ENOENT) {
adc->clki = NULL; adc->clki = NULL;
} else { } else {
dev_err(&adc->spi->dev, return dev_err_probe(dev, PTR_ERR(adc->clki), "failed to get adc clk\n");
"failed to get adc clk (%ld)\n",
PTR_ERR(adc->clki));
return PTR_ERR(adc->clki);
} }
} }
......
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