Commit 5bb30e7d authored by Renato Lui Geh's avatar Renato Lui Geh Committed by Jonathan Cameron

staging: iio: ad7780: move regulator to after GPIO init

To maintain consistency between ad7780_probe and ad7780_remove orders,
regulator initialization has been moved to after GPIO initializations.
Signed-off-by: default avatarRenato Lui Geh <renatogeh@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 4812a14a
...@@ -295,16 +295,6 @@ static int ad7780_probe(struct spi_device *spi) ...@@ -295,16 +295,6 @@ static int ad7780_probe(struct spi_device *spi)
ad_sd_init(&st->sd, indio_dev, spi, &ad7780_sigma_delta_info); ad_sd_init(&st->sd, indio_dev, spi, &ad7780_sigma_delta_info);
st->reg = devm_regulator_get(&spi->dev, "avdd");
if (IS_ERR(st->reg))
return PTR_ERR(st->reg);
ret = regulator_enable(st->reg);
if (ret) {
dev_err(&spi->dev, "Failed to enable specified AVdd supply\n");
return ret;
}
st->chip_info = st->chip_info =
&ad7780_chip_info_tbl[spi_get_device_id(spi)->driver_data]; &ad7780_chip_info_tbl[spi_get_device_id(spi)->driver_data];
...@@ -321,6 +311,16 @@ static int ad7780_probe(struct spi_device *spi) ...@@ -321,6 +311,16 @@ static int ad7780_probe(struct spi_device *spi)
if (ret) if (ret)
goto error_cleanup_buffer_and_trigger; goto error_cleanup_buffer_and_trigger;
st->reg = devm_regulator_get(&spi->dev, "avdd");
if (IS_ERR(st->reg))
return PTR_ERR(st->reg);
ret = regulator_enable(st->reg);
if (ret) {
dev_err(&spi->dev, "Failed to enable specified AVdd supply\n");
return ret;
}
ret = ad_sd_setup_buffer_and_trigger(indio_dev); ret = ad_sd_setup_buffer_and_trigger(indio_dev);
if (ret) if (ret)
goto error_disable_reg; goto error_disable_reg;
......
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