Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: sca3000: manage device registration with devm helper

Convert the iio registration to use devm_* helpers so the probe no
longer needs a separate cleanup path and remove callback can also drop
the unregister. After this there is no need for having a remove
callback, so remote it.

No functional change intended.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibe.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Harshit Mogalapalli and committed by
Jonathan Cameron
8b012728 71d0d6a6

+1 -14
+1 -14
drivers/iio/accel/sca3000.c
··· 1459 1459 return -ENOMEM; 1460 1460 1461 1461 st = iio_priv(indio_dev); 1462 - spi_set_drvdata(spi, indio_dev); 1463 1462 st->us = spi; 1464 1463 mutex_init(&st->lock); 1465 1464 st->info = spi_get_device_match_data(spi); ··· 1500 1501 if (ret) 1501 1502 return ret; 1502 1503 1503 - ret = iio_device_register(indio_dev); 1504 - if (ret) 1505 - return ret; 1506 - 1507 - return 0; 1508 - } 1509 - 1510 - static void sca3000_remove(struct spi_device *spi) 1511 - { 1512 - struct iio_dev *indio_dev = spi_get_drvdata(spi); 1513 - 1514 - iio_device_unregister(indio_dev); 1504 + return devm_iio_device_register(dev, indio_dev); 1515 1505 } 1516 1506 1517 1507 static const struct spi_device_id sca3000_id[] = { ··· 1517 1529 .name = "sca3000", 1518 1530 }, 1519 1531 .probe = sca3000_probe, 1520 - .remove = sca3000_remove, 1521 1532 .id_table = sca3000_id, 1522 1533 }; 1523 1534 module_spi_driver(sca3000_driver);