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

staging: iio: isl29018: Use devm_iio_device_register

devm_iio_device_register simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Sachin Kamat and committed by
Jonathan Cameron
8664ed09 f952a30c

+1 -12
+1 -12
drivers/staging/iio/light/isl29018.c
··· 585 585 indio_dev->name = id->name; 586 586 indio_dev->dev.parent = &client->dev; 587 587 indio_dev->modes = INDIO_DIRECT_MODE; 588 - err = iio_device_register(indio_dev); 588 + err = devm_iio_device_register(&client->dev, indio_dev); 589 589 if (err) { 590 590 dev_err(&client->dev, "iio registration fails\n"); 591 591 return err; 592 592 } 593 - 594 - return 0; 595 - } 596 - 597 - static int isl29018_remove(struct i2c_client *client) 598 - { 599 - struct iio_dev *indio_dev = i2c_get_clientdata(client); 600 - 601 - dev_dbg(&client->dev, "%s()\n", __func__); 602 - iio_device_unregister(indio_dev); 603 593 604 594 return 0; 605 595 } ··· 654 664 .of_match_table = isl29018_of_match, 655 665 }, 656 666 .probe = isl29018_probe, 657 - .remove = isl29018_remove, 658 667 .id_table = isl29018_id, 659 668 }; 660 669 module_i2c_driver(isl29018_driver);