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: stop interrupts via devm_add_action_or_reset()

Used devm_add_action_or_reset() for shutting down the interrupts.
Make sca3000_stop_all_interrupts() return void now that it always hooks
into devm cleanup.

No functional change intended.

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

authored by

Harshit Mogalapalli and committed by
Jonathan Cameron
71d0d6a6 31ac6410

+7 -5
+7 -5
drivers/iio/accel/sca3000.c
··· 1428 1428 .write_event_config = &sca3000_write_event_config, 1429 1429 }; 1430 1430 1431 - static void sca3000_stop_all_interrupts(struct sca3000_state *st) 1431 + static void sca3000_stop_all_interrupts(void *data) 1432 1432 { 1433 + struct iio_dev *indio_dev = data; 1434 + struct sca3000_state *st = iio_priv(indio_dev); 1433 1435 int ret; 1434 1436 1435 1437 guard(mutex)(&st->lock); ··· 1497 1495 if (ret) 1498 1496 return ret; 1499 1497 1498 + ret = devm_add_action_or_reset(dev, sca3000_stop_all_interrupts, indio_dev); 1499 + if (ret) 1500 + return ret; 1501 + 1500 1502 ret = iio_device_register(indio_dev); 1501 1503 if (ret) 1502 1504 return ret; ··· 1511 1505 static void sca3000_remove(struct spi_device *spi) 1512 1506 { 1513 1507 struct iio_dev *indio_dev = spi_get_drvdata(spi); 1514 - struct sca3000_state *st = iio_priv(indio_dev); 1515 1508 1516 1509 iio_device_unregister(indio_dev); 1517 - 1518 - /* Must ensure no interrupts can be generated after this! */ 1519 - sca3000_stop_all_interrupts(st); 1520 1510 } 1521 1511 1522 1512 static const struct spi_device_id sca3000_id[] = {