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: adc: hx711: remove hx711_remove()

By using a few more devm_ functions, we can remove the hx711_remove()
function in the hx711 driver.

platform_set_drvdata() is also removed since there are no more
callers of platform_get_drvdata().

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andreas Klinger <ak@it-klinger.de>
Link: https://patch.msgid.link/20240621-iio-regulator-refactor-round-2-v1-3-49e50cd0b99a@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

David Lechner and committed by
Jonathan Cameron
bfe339ee 0099e82b

+5 -22
+5 -22
drivers/iio/adc/hx711.c
··· 539 539 hx711_data->data_ready_delay_ns = 540 540 1000000000 / hx711_data->clock_frequency; 541 541 542 - platform_set_drvdata(pdev, indio_dev); 543 - 544 542 indio_dev->name = "hx711"; 545 543 indio_dev->info = &hx711_iio_info; 546 544 indio_dev->modes = INDIO_DIRECT_MODE; 547 545 indio_dev->channels = hx711_chan_spec; 548 546 indio_dev->num_channels = ARRAY_SIZE(hx711_chan_spec); 549 547 550 - ret = iio_triggered_buffer_setup(indio_dev, iio_pollfunc_store_time, 551 - hx711_trigger, NULL); 548 + ret = devm_iio_triggered_buffer_setup(dev, indio_dev, 549 + iio_pollfunc_store_time, 550 + hx711_trigger, NULL); 552 551 if (ret < 0) { 553 552 dev_err(dev, "setup of iio triggered buffer failed\n"); 554 553 return ret; 555 554 } 556 555 557 - ret = iio_device_register(indio_dev); 556 + ret = devm_iio_device_register(dev, indio_dev); 558 557 if (ret < 0) { 559 558 dev_err(dev, "Couldn't register the device\n"); 560 - goto error_buffer; 559 + return ret; 561 560 } 562 561 563 562 return 0; 564 - 565 - error_buffer: 566 - iio_triggered_buffer_cleanup(indio_dev); 567 - 568 - return ret; 569 - } 570 - 571 - static void hx711_remove(struct platform_device *pdev) 572 - { 573 - struct iio_dev *indio_dev; 574 - 575 - indio_dev = platform_get_drvdata(pdev); 576 - 577 - iio_device_unregister(indio_dev); 578 - iio_triggered_buffer_cleanup(indio_dev); 579 563 } 580 564 581 565 static const struct of_device_id of_hx711_match[] = { ··· 571 587 572 588 static struct platform_driver hx711_driver = { 573 589 .probe = hx711_probe, 574 - .remove_new = hx711_remove, 575 590 .driver = { 576 591 .name = "hx711-gpio", 577 592 .of_match_table = of_hx711_match,