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: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ac3f851ef8
commit
b671bb3bf0
|
@ -48,7 +48,7 @@ static ssize_t ad5930_set_parameter(struct device *dev,
|
|||
struct spi_transfer xfer;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
config->control = (config->control & ~value_mask);
|
||||
|
|
|
@ -77,7 +77,7 @@ static ssize_t ad9832_write(struct device *dev,
|
|||
const char *buf,
|
||||
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 iio_dev_attr *this_attr = to_iio_dev_attr(attr);
|
||||
int ret;
|
||||
|
|
|
@ -66,7 +66,7 @@ static ssize_t ad9834_write(struct device *dev,
|
|||
const char *buf,
|
||||
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 iio_dev_attr *this_attr = to_iio_dev_attr(attr);
|
||||
int ret;
|
||||
|
@ -145,7 +145,7 @@ static ssize_t ad9834_store_wavetype(struct device *dev,
|
|||
const char *buf,
|
||||
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 iio_dev_attr *this_attr = to_iio_dev_attr(attr);
|
||||
int ret = 0;
|
||||
|
@ -203,7 +203,7 @@ static ssize_t ad9834_show_out0_wavetype_available(struct device *dev,
|
|||
struct device_attribute *attr,
|
||||
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);
|
||||
char *str;
|
||||
|
||||
|
@ -225,7 +225,7 @@ static ssize_t ad9834_show_out1_wavetype_available(struct device *dev,
|
|||
struct device_attribute *attr,
|
||||
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);
|
||||
char *str;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static ssize_t ad9850_set_parameter(struct device *dev,
|
|||
struct spi_transfer xfer;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
xfer.len = len;
|
||||
|
|
|
@ -71,7 +71,7 @@ static ssize_t ad9852_set_parameter(struct device *dev,
|
|||
struct spi_transfer xfer;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
xfer.len = 3;
|
||||
|
|
|
@ -123,7 +123,7 @@ static ssize_t ad9910_set_parameter(struct device *dev,
|
|||
struct spi_transfer xfer;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
xfer.len = 5;
|
||||
|
|
|
@ -64,7 +64,7 @@ static ssize_t ad9951_set_parameter(struct device *dev,
|
|||
struct spi_transfer xfer;
|
||||
int ret;
|
||||
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);
|
||||
|
||||
xfer.len = 3;
|
||||
|
|
Loading…
Reference in New Issue