Commit a9d1a34f authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220413192203.46704-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 615b5e19
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -362,8 +363,7 @@ static int ltc2632_probe(struct spi_device *spi) ...@@ -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 indio_dev->name = fwnode_get_name(dev_fwnode(&spi->dev)) ?: spi_get_device_id(spi)->name;
: spi_get_device_id(spi)->name;
indio_dev->info = &ltc2632_info; indio_dev->info = &ltc2632_info;
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = chip_info->channels; indio_dev->channels = chip_info->channels;
...@@ -469,7 +469,7 @@ MODULE_DEVICE_TABLE(of, ltc2632_of_match); ...@@ -469,7 +469,7 @@ MODULE_DEVICE_TABLE(of, ltc2632_of_match);
static struct spi_driver ltc2632_driver = { static struct spi_driver ltc2632_driver = {
.driver = { .driver = {
.name = "ltc2632", .name = "ltc2632",
.of_match_table = of_match_ptr(ltc2632_of_match), .of_match_table = ltc2632_of_match,
}, },
.probe = ltc2632_probe, .probe = ltc2632_probe,
.remove = ltc2632_remove, .remove = ltc2632_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment