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: switch IRQ handling to devm helpers

Convert the threaded IRQ registration to devm_request_threaded_irq() so
that the probe and remove paths can drop manual freeing of irqs.

No functionality change.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.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
4390d416 042d1244

+8 -17
+8 -17
drivers/iio/accel/sca3000.c
··· 1461 1461 return ret; 1462 1462 1463 1463 if (spi->irq) { 1464 - ret = request_threaded_irq(spi->irq, 1465 - NULL, 1466 - &sca3000_event_handler, 1467 - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 1468 - "sca3000", 1469 - indio_dev); 1464 + ret = devm_request_threaded_irq(dev, spi->irq, NULL, 1465 + &sca3000_event_handler, 1466 + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, 1467 + "sca3000", 1468 + indio_dev); 1470 1469 if (ret) 1471 1470 return ret; 1472 1471 } 1473 1472 ret = sca3000_clean_setup(st); 1474 1473 if (ret) 1475 - goto error_free_irq; 1474 + return ret; 1476 1475 1477 1476 ret = sca3000_print_rev(indio_dev); 1478 1477 if (ret) 1479 - goto error_free_irq; 1478 + return ret; 1480 1479 1481 1480 ret = iio_device_register(indio_dev); 1482 1481 if (ret) 1483 - goto error_free_irq; 1482 + return ret; 1484 1483 1485 1484 return 0; 1486 - 1487 - error_free_irq: 1488 - if (spi->irq) 1489 - free_irq(spi->irq, indio_dev); 1490 - 1491 - return ret; 1492 1485 } 1493 1486 1494 1487 static int sca3000_stop_all_interrupts(struct sca3000_state *st) ··· 1511 1518 1512 1519 /* Must ensure no interrupts can be generated after this! */ 1513 1520 sca3000_stop_all_interrupts(st); 1514 - if (spi->irq) 1515 - free_irq(spi->irq, indio_dev); 1516 1521 } 1517 1522 1518 1523 static const struct spi_device_id sca3000_id[] = {