From: Alexandru Ardelean Date: Tue, 21 Jul 2020 10:24:07 +0000 (+0300) Subject: iio: core: fix/re-introduce back parent assignment X-Git-Tag: v5.9-rc1~119^2~61^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8525df47b3d1eaa9a2206964f63f71a2f48dc7c1;p=thirdparty%2Fkernel%2Fstable.git iio: core: fix/re-introduce back parent assignment This was introduced initially via commit 78289b4a58b58 ("iio: core: pass parent device as parameter during allocation"), but was accidentally removed via commit 6d4ebd565d15f ("iio: core: wrap IIO device into an iio_dev_opaque object"). This looks like a rebase gone wrong, and ends up breaking devicetree bindings of IIO clients. This change adds back the parent assignment. Fixes 6d4ebd565d15f: ("iio: core: wrap IIO device into an iio_dev_opaque object") Reported-by: Dmitry Baryshkov Signed-off-by: Alexandru Ardelean Tested-by: Dmitry Baryshkov Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index e6ecda27a8bc6..606d5e61c5759 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -1545,6 +1545,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv) dev->priv = (char *)iio_dev_opaque + ALIGN(sizeof(struct iio_dev_opaque), IIO_ALIGN); + dev->dev.parent = parent; dev->dev.groups = dev->groups; dev->dev.type = &iio_device_type; dev->dev.bus = &iio_bus_type;