Commit d526e513 authored by Jonathan Cameron's avatar Jonathan Cameron

staging:iio:accel:kxsd9

Remove an unneeded initialization and trivial reorder to ensure
the device is ready when the device is registered.
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent b775dce9
...@@ -226,7 +226,7 @@ static int kxsd9_probe(struct spi_device *spi) ...@@ -226,7 +226,7 @@ static int kxsd9_probe(struct spi_device *spi)
{ {
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
struct kxsd9_state *st; struct kxsd9_state *st;
int ret = 0; int ret;
indio_dev = iio_device_alloc(sizeof(*st)); indio_dev = iio_device_alloc(sizeof(*st));
if (indio_dev == NULL) { if (indio_dev == NULL) {
...@@ -245,14 +245,14 @@ static int kxsd9_probe(struct spi_device *spi) ...@@ -245,14 +245,14 @@ static int kxsd9_probe(struct spi_device *spi)
indio_dev->info = &kxsd9_info; indio_dev->info = &kxsd9_info;
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
ret = iio_device_register(indio_dev);
if (ret)
goto error_free_dev;
spi->mode = SPI_MODE_0; spi->mode = SPI_MODE_0;
spi_setup(spi); spi_setup(spi);
kxsd9_power_up(st); kxsd9_power_up(st);
ret = iio_device_register(indio_dev);
if (ret)
goto error_free_dev;
return 0; return 0;
error_free_dev: error_free_dev:
......
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