Commit 8525df47 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Jonathan Cameron

iio: core: fix/re-introduce back parent assignment

This was introduced initially via commit 78289b4a ("iio: core: pass
parent device as parameter during allocation"), but was accidentally
removed via commit 6d4ebd56 ("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 6d4ebd56: ("iio: core: wrap IIO device into an iio_dev_opaque object")
Reported-by: default avatarDmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Tested-by: default avatarDmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 951ad470
...@@ -1545,6 +1545,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv) ...@@ -1545,6 +1545,7 @@ struct iio_dev *iio_device_alloc(struct device *parent, int sizeof_priv)
dev->priv = (char *)iio_dev_opaque + dev->priv = (char *)iio_dev_opaque +
ALIGN(sizeof(struct iio_dev_opaque), IIO_ALIGN); ALIGN(sizeof(struct iio_dev_opaque), IIO_ALIGN);
dev->dev.parent = parent;
dev->dev.groups = dev->groups; dev->dev.groups = dev->groups;
dev->dev.type = &iio_device_type; dev->dev.type = &iio_device_type;
dev->dev.bus = &iio_bus_type; dev->dev.bus = &iio_bus_type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment