summaryrefslogtreecommitdiff
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
authorNuno Sá <nuno.sa@analog.com>2022-07-15 14:29:02 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-08-15 22:30:00 +0100
commitb22bc4d6072e74b768c4c19e2ff3585ba5927904 (patch)
tree0f3ce68b8d542034322d1ea9ec56def6978788e4 /drivers/iio/inkern.c
parentd7705f35448ada5a04f15326404e40d4254c538d (diff)
iio: inkern: remove OF dependencies
Since all users of the OF dependendent API are now converted to use the firmware agnostic alternative, we can drop OF dependencies from the IIO in kernel interface. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220715122903.332535-15-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/inkern.c')
-rw-r--r--drivers/iio/inkern.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index 9cfa66ef9536..b667790b6df9 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -8,7 +8,6 @@
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/mutex.h>
-#include <linux/of.h>
#include <linux/iio/iio.h>
#include <linux/iio/iio-opaque.h>
@@ -143,26 +142,6 @@ static int __fwnode_iio_simple_xlate(struct iio_dev *indio_dev,
return iiospec->args[0];
}
-/*
- * Simple helper to copy fwnode_reference_args into of_phandle_args so we
- * can pass it to of_xlate(). Ultimate goal is to drop this together with
- * of_xlate().
- */
-static int __fwnode_to_of_xlate(struct iio_dev *indio_dev,
- const struct fwnode_reference_args *iiospec)
-{
- struct of_phandle_args of_args;
- unsigned int i;
-
- of_args.args_count = iiospec->nargs;
- of_args.np = to_of_node(iiospec->fwnode);
-
- for (i = 0; i < MAX_PHANDLE_ARGS; i++)
- of_args.args[i] = i < iiospec->nargs ? iiospec->args[i] : 0;
-
- return indio_dev->info->of_xlate(indio_dev, &of_args);
-}
-
static int __fwnode_iio_channel_get(struct iio_channel *channel,
struct fwnode_handle *fwnode, int index)
{
@@ -185,9 +164,7 @@ static int __fwnode_iio_channel_get(struct iio_channel *channel,
indio_dev = dev_to_iio_dev(idev);
channel->indio_dev = indio_dev;
- if (indio_dev->info->of_xlate)
- index = __fwnode_to_of_xlate(indio_dev, &iiospec);
- else if (indio_dev->info->fwnode_xlate)
+ if (indio_dev->info->fwnode_xlate)
index = indio_dev->info->fwnode_xlate(indio_dev, &iiospec);
else
index = __fwnode_iio_simple_xlate(indio_dev, &iiospec);