Skip to content
Commit 7a7913f1 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Greg Kroah-Hartman
Browse files

iio: Add dev_to_iio_dev() helper function



This patch adds a helper function for retriving a iio_dev struct from a device
struct. Currently we open-code this in two different ways. One is using
dev_get_drvdata on the device and the other is using container_of. The new
helper function uses the container_of solution as it creates slightly smaller
code and also will eventually free up the drvdata pointer for usage by invidual
drivers.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7086e6e5
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