devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> --- drivers/iio/accel/kxsd9.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c index 709c132..3048686 100644 --- a/drivers/iio/accel/kxsd9.c +++ b/drivers/iio/accel/kxsd9.c @@ -244,20 +244,13 @@ static int kxsd9_probe(struct spi_device *spi) spi_setup(spi); kxsd9_power_up(st); - ret = iio_device_register(indio_dev); + ret = devm_iio_device_register(&spi->dev, indio_dev); if (ret) return ret; return 0; } -static int kxsd9_remove(struct spi_device *spi) -{ - iio_device_unregister(spi_get_drvdata(spi)); - - return 0; -} - static const struct spi_device_id kxsd9_id[] = { {"kxsd9", 0}, { }, @@ -270,7 +263,6 @@ static struct spi_driver kxsd9_driver = { .owner = THIS_MODULE, }, .probe = kxsd9_probe, - .remove = kxsd9_remove, .id_table = kxsd9_id, }; module_spi_driver(kxsd9_driver); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html