[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201203100423.77270-2-alexandru.ardelean@analog.com>
Date: Thu, 3 Dec 2020 12:04:19 +0200
From: Alexandru Ardelean <alexandru.ardelean@...log.com>
To: <linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <jic23@...nel.org>, <lars@...afoo.de>,
Alexandru Ardelean <alexandru.ardelean@...log.com>
Subject: [RFC PATCH 1/5] iio: core: initialize 'modes' to INDIO_DIRECT_MODE by default
Most of the IIO drivers initialize to INDIO_DIRECT_MODE mode. Some
initialize to INDIO_BUFFER_SOFTWARE as a way to create an IIO device that
is just mostly an IIO buffer.
All IIO devices initialize the 'modes' parameter. Since this is
overwritten, might as well make INDIO_DIRECT_MODE the default. This would
not affect any current IIO driver.
Then for the IIO devices that only have direct-mode, this initialization
can be removed, since it becomes boiler-plate code.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.com>
---
drivers/iio/industrialio-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index c2e4c267c36b..c1c8bde54444 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -1558,6 +1558,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv)
dev->dev.parent = parent;
dev->dev.groups = dev->groups;
dev->dev.type = &iio_device_type;
+ dev->modes = INDIO_DIRECT_MODE;
dev->dev.bus = &iio_bus_type;
device_initialize(&dev->dev);
dev_set_drvdata(&dev->dev, (void *)dev);
--
2.27.0
Powered by blists - more mailing lists