From: Andy Shevchenko Date: Wed, 13 Apr 2022 19:22:03 +0000 (+0300) Subject: iio: dac: ltc2632: Make use of device properties X-Git-Tag: v6.6.17~7345^2~81^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9d1a34f2a025708b2eaffddc9a338e289e5bb65;p=platform%2Fkernel%2Flinux-rpi.git iio: dac: ltc2632: Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220413192203.46704-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c index 7f1a990..3a3c4f4 100644 --- a/drivers/iio/dac/ltc2632.c +++ b/drivers/iio/dac/ltc2632.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -362,8 +363,7 @@ static int ltc2632_probe(struct spi_device *spi) } } - indio_dev->name = dev_of_node(&spi->dev) ? dev_of_node(&spi->dev)->name - : spi_get_device_id(spi)->name; + indio_dev->name = fwnode_get_name(dev_fwnode(&spi->dev)) ?: spi_get_device_id(spi)->name; indio_dev->info = <c2632_info; indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->channels = chip_info->channels; @@ -469,7 +469,7 @@ MODULE_DEVICE_TABLE(of, ltc2632_of_match); static struct spi_driver ltc2632_driver = { .driver = { .name = "ltc2632", - .of_match_table = of_match_ptr(ltc2632_of_match), + .of_match_table = ltc2632_of_match, }, .probe = ltc2632_probe, .remove = ltc2632_remove,