On Fri, 2 Nov 2018 15:42:09 +0800...
Song Qiang <songqiang1304521@xxxxxxxxx> wrote:
Hi Jonathan,+int rm3100_common_probe(struct device *dev, struct regmap *regmap, int irq)Huh. That's an interesting one... Looks like a bug in the core to me that
+{
+ struct iio_dev *indio_dev;
+ struct rm3100_data *data;
+ unsigned int tmp;
+ int ret;
+
+ indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
+ if (!indio_dev)
+ return -ENOMEM;
+
+ data = iio_priv(indio_dev);
+ data->regmap = regmap;
+
+ mutex_init(&data->lock);
+
+ indio_dev->dev.parent = dev;
+ indio_dev->name = "rm3100";
+ indio_dev->info = &rm3100_info;
+ indio_dev->channels = rm3100_channels;
+ indio_dev->num_channels = ARRAY_SIZE(rm3100_channels);
+ indio_dev->modes = INDIO_DIRECT_MODE | INDIO_BUFFER_TRIGGERED;
+ indio_dev->currentmode = INDIO_DIRECT_MODE;
somehow has never bitten us as no driver has ever done anything other
than explicitly match against other modes. No one sets currentmode
directly so we should be good just putting this in the core as long
as a device supports direct mode. I'll look at that when I get a moment.