iio: proximity: ping: pass reference to IIO device as param to ping_read()
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Mon, 18 May 2020 13:38:13 +0000 (16:38 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 21 May 2020 18:39:25 +0000 (19:39 +0100)
commit1ecca8a9a4989b693f2f6d349bf54c0fdfc10e8e
treecebb18a2404762a9082085323962623c0faf771c
parent33c53cbf8f7bc8d62f6146a19da97c8594376ff0
iio: proximity: ping: pass reference to IIO device as param to ping_read()

Since there will be some changes to how iio_priv_to_dev() is implemented,
it could be that the helper becomes a bit slower, as it will be hidden away
in the IIO core.

But even without that rework, this looks like it can pass the 'indio_dev'
object to ping_read() and obtain the state struct via iio_priv() which is a
preferred practice than going back-n-forth (getting the state-struct, then
using iio_priv_to_dev() to get the indio_dev object back).

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/ping.c