From d3be83244c7dfe686d23f1c0bac75915587fc044 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Fri, 22 May 2020 11:22:05 +0300 Subject: iio: remove explicit IIO device parent assignment This patch applies the semantic patch: @@ expression I, P, SP; @@ I = devm_iio_device_alloc(P, SP); ... - I->dev.parent = P; It updates 302 files and does 307 deletions. This semantic patch also removes some comments like '/* Establish that the iio_dev is a child of the i2c device */' But this is is only done in case where the block is left empty. The patch does not seem to cover all cases. It looks like in some cases a different variable is used in some cases to assign the parent, but it points to the same reference. In other cases, the block covered by ... may be just too big to be covered by the semantic patch. However, this looks pretty good as well, as it does cover a big bulk of the drivers that should remove the parent assignment. Signed-off-by: Alexandru Ardelean Signed-off-by: Jonathan Cameron --- drivers/iio/dac/ad5380.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/iio/dac/ad5380.c') diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c index 04c74cc1a4ec..224ffc466ed1 100644 --- a/drivers/iio/dac/ad5380.c +++ b/drivers/iio/dac/ad5380.c @@ -386,7 +386,6 @@ static int ad5380_probe(struct device *dev, struct regmap *regmap, st->chip_info = &ad5380_chip_info_tbl[type]; st->regmap = regmap; - indio_dev->dev.parent = dev; indio_dev->name = name; indio_dev->info = &ad5380_info; indio_dev->modes = INDIO_DIRECT_MODE; -- cgit v1.2.3