提交 b671bb3b 编写于 作者: L Lars-Peter Clausen 提交者: Greg Kroah-Hartman

staging:iio:frequency: 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: NLars-Peter Clausen <lars@metafoo.de>
Acked-by: NJonathan Cameron <jic23@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ac3f851e
...@@ -48,7 +48,7 @@ static ssize_t ad5930_set_parameter(struct device *dev, ...@@ -48,7 +48,7 @@ static ssize_t ad5930_set_parameter(struct device *dev,
struct spi_transfer xfer; struct spi_transfer xfer;
int ret; int ret;
struct ad5903_config *config = (struct ad5903_config *)buf; struct ad5903_config *config = (struct ad5903_config *)buf;
struct iio_dev *idev = dev_get_drvdata(dev); struct iio_dev *idev = dev_to_iio_dev(dev);
struct ad5930_state *st = iio_priv(idev); struct ad5930_state *st = iio_priv(idev);
config->control = (config->control & ~value_mask); config->control = (config->control & ~value_mask);
......
...@@ -77,7 +77,7 @@ static ssize_t ad9832_write(struct device *dev, ...@@ -77,7 +77,7 @@ static ssize_t ad9832_write(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 ad9832_state *st = iio_priv(indio_dev); struct ad9832_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;
......
...@@ -66,7 +66,7 @@ static ssize_t ad9834_write(struct device *dev, ...@@ -66,7 +66,7 @@ static ssize_t ad9834_write(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 ad9834_state *st = iio_priv(indio_dev); struct ad9834_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;
...@@ -145,7 +145,7 @@ static ssize_t ad9834_store_wavetype(struct device *dev, ...@@ -145,7 +145,7 @@ static ssize_t ad9834_store_wavetype(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 ad9834_state *st = iio_priv(indio_dev); struct ad9834_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; int ret = 0;
...@@ -203,7 +203,7 @@ static ssize_t ad9834_show_out0_wavetype_available(struct device *dev, ...@@ -203,7 +203,7 @@ static ssize_t ad9834_show_out0_wavetype_available(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 ad9834_state *st = iio_priv(indio_dev); struct ad9834_state *st = iio_priv(indio_dev);
char *str; char *str;
...@@ -225,7 +225,7 @@ static ssize_t ad9834_show_out1_wavetype_available(struct device *dev, ...@@ -225,7 +225,7 @@ static ssize_t ad9834_show_out1_wavetype_available(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 ad9834_state *st = iio_priv(indio_dev); struct ad9834_state *st = iio_priv(indio_dev);
char *str; char *str;
......
...@@ -43,7 +43,7 @@ static ssize_t ad9850_set_parameter(struct device *dev, ...@@ -43,7 +43,7 @@ static ssize_t ad9850_set_parameter(struct device *dev,
struct spi_transfer xfer; struct spi_transfer xfer;
int ret; int ret;
struct ad9850_config *config = (struct ad9850_config *)buf; struct ad9850_config *config = (struct ad9850_config *)buf;
struct iio_dev *idev = dev_get_drvdata(dev); struct iio_dev *idev = dev_to_iio_dev(dev);
struct ad9850_state *st = iio_priv(idev); struct ad9850_state *st = iio_priv(idev);
xfer.len = len; xfer.len = len;
......
...@@ -71,7 +71,7 @@ static ssize_t ad9852_set_parameter(struct device *dev, ...@@ -71,7 +71,7 @@ static ssize_t ad9852_set_parameter(struct device *dev,
struct spi_transfer xfer; struct spi_transfer xfer;
int ret; int ret;
struct ad9852_config *config = (struct ad9852_config *)buf; struct ad9852_config *config = (struct ad9852_config *)buf;
struct iio_dev *idev = dev_get_drvdata(dev); struct iio_dev *idev = dev_to_iio_dev(dev);
struct ad9852_state *st = iio_priv(idev); struct ad9852_state *st = iio_priv(idev);
xfer.len = 3; xfer.len = 3;
......
...@@ -123,7 +123,7 @@ static ssize_t ad9910_set_parameter(struct device *dev, ...@@ -123,7 +123,7 @@ static ssize_t ad9910_set_parameter(struct device *dev,
struct spi_transfer xfer; struct spi_transfer xfer;
int ret; int ret;
struct ad9910_config *config = (struct ad9910_config *)buf; struct ad9910_config *config = (struct ad9910_config *)buf;
struct iio_dev *idev = dev_get_drvdata(dev); struct iio_dev *idev = dev_to_iio_dev(dev);
struct ad9910_state *st = iio_priv(idev); struct ad9910_state *st = iio_priv(idev);
xfer.len = 5; xfer.len = 5;
......
...@@ -64,7 +64,7 @@ static ssize_t ad9951_set_parameter(struct device *dev, ...@@ -64,7 +64,7 @@ static ssize_t ad9951_set_parameter(struct device *dev,
struct spi_transfer xfer; struct spi_transfer xfer;
int ret; int ret;
struct ad9951_config *config = (struct ad9951_config *)buf; struct ad9951_config *config = (struct ad9951_config *)buf;
struct iio_dev *idev = dev_get_drvdata(dev); struct iio_dev *idev = dev_to_iio_dev(dev);
struct ad9951_state *st = iio_priv(idev); struct ad9951_state *st = iio_priv(idev);
xfer.len = 3; xfer.len = 3;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册