mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
staging: iio: ad2s1200: Setup spi before iio device register
The spi should be set up before the device is registered as an iio device. This patch moves the setup to before the device registration. Signed-off-by: David Veenstra <davidjulianveenstra@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
bc683b47c3
commit
94cdefa81b
1 changed files with 7 additions and 6 deletions
|
|
@ -143,15 +143,16 @@ static int ad2s1200_probe(struct spi_device *spi)
|
|||
indio_dev->num_channels = ARRAY_SIZE(ad2s1200_channels);
|
||||
indio_dev->name = spi_get_device_id(spi)->name;
|
||||
|
||||
ret = devm_iio_device_register(&spi->dev, indio_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
spi->max_speed_hz = AD2S1200_HZ;
|
||||
spi->mode = SPI_MODE_3;
|
||||
spi_setup(spi);
|
||||
ret = spi_setup(spi);
|
||||
|
||||
return 0;
|
||||
if (ret < 0) {
|
||||
dev_err(&spi->dev, "spi_setup failed!\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
return devm_iio_device_register(&spi->dev, indio_dev);
|
||||
}
|
||||
|
||||
static const struct spi_device_id ad2s1200_id[] = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue