Commit ba86dc46 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Greg Kroah-Hartman

staging:iio:impedance-analyzer: Use dev_to_iio_dev()

Replace open-coded instances of getting a iio_dev struct from a device struct
with dev_to_iio_dev().
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 f72e0834
...@@ -291,7 +291,7 @@ static ssize_t ad5933_show_frequency(struct device *dev, ...@@ -291,7 +291,7 @@ static ssize_t ad5933_show_frequency(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad5933_state *st = iio_priv(indio_dev); struct ad5933_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
int ret; int ret;
...@@ -320,7 +320,7 @@ static ssize_t ad5933_store_frequency(struct device *dev, ...@@ -320,7 +320,7 @@ static ssize_t ad5933_store_frequency(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad5933_state *st = iio_priv(indio_dev); struct ad5933_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
long val; long val;
...@@ -354,7 +354,7 @@ static ssize_t ad5933_show(struct device *dev, ...@@ -354,7 +354,7 @@ static ssize_t ad5933_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad5933_state *st = iio_priv(indio_dev); struct ad5933_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
int ret = 0, len = 0; int ret = 0, len = 0;
...@@ -397,7 +397,7 @@ static ssize_t ad5933_store(struct device *dev, ...@@ -397,7 +397,7 @@ static ssize_t ad5933_store(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad5933_state *st = iio_priv(indio_dev); struct ad5933_state *st = iio_priv(indio_dev);
struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
long val; long val;
......
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