diff options
author | Jonathan Cameron <jic23@kernel.org> | 2013-01-06 15:10:00 +0000 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-01-26 10:07:53 +0000 |
commit | d526e513c7dd1bb3f9696c7d38634e5ebf5f0919 (patch) | |
tree | a2ffd82f5fd4f3d352e413eaf99fdeeacfbf02ef | |
parent | b775dce99621af52d32c1d7335cf94eee4383e8a (diff) | |
download | op-kernel-dev-d526e513c7dd1bb3f9696c7d38634e5ebf5f0919.zip op-kernel-dev-d526e513c7dd1bb3f9696c7d38634e5ebf5f0919.tar.gz |
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: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/staging/iio/accel/kxsd9.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/iio/accel/kxsd9.c b/drivers/staging/iio/accel/kxsd9.c index 318331f..4a24c2e 100644 --- a/drivers/staging/iio/accel/kxsd9.c +++ b/drivers/staging/iio/accel/kxsd9.c @@ -226,7 +226,7 @@ static int kxsd9_probe(struct spi_device *spi) { struct iio_dev *indio_dev; struct kxsd9_state *st; - int ret = 0; + int ret; indio_dev = iio_device_alloc(sizeof(*st)); if (indio_dev == NULL) { @@ -245,14 +245,14 @@ static int kxsd9_probe(struct spi_device *spi) indio_dev->info = &kxsd9_info; indio_dev->modes = INDIO_DIRECT_MODE; - ret = iio_device_register(indio_dev); - if (ret) - goto error_free_dev; - spi->mode = SPI_MODE_0; spi_setup(spi); kxsd9_power_up(st); + ret = iio_device_register(indio_dev); + if (ret) + goto error_free_dev; + return 0; error_free_dev: |