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

staging:iio:resolver: 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>
上级 527cf71f
...@@ -200,7 +200,7 @@ static ssize_t ad2s1210_store_softreset(struct device *dev, ...@@ -200,7 +200,7 @@ static ssize_t ad2s1210_store_softreset(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
int ret; int ret;
mutex_lock(&st->lock); mutex_lock(&st->lock);
...@@ -214,7 +214,7 @@ static ssize_t ad2s1210_show_fclkin(struct device *dev, ...@@ -214,7 +214,7 @@ static ssize_t ad2s1210_show_fclkin(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
return sprintf(buf, "%d\n", st->fclkin); return sprintf(buf, "%d\n", st->fclkin);
} }
...@@ -223,7 +223,7 @@ static ssize_t ad2s1210_store_fclkin(struct device *dev, ...@@ -223,7 +223,7 @@ static ssize_t ad2s1210_store_fclkin(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
unsigned long fclkin; unsigned long fclkin;
int ret; int ret;
...@@ -252,7 +252,7 @@ static ssize_t ad2s1210_show_fexcit(struct device *dev, ...@@ -252,7 +252,7 @@ static ssize_t ad2s1210_show_fexcit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
return sprintf(buf, "%d\n", st->fexcit); return sprintf(buf, "%d\n", st->fexcit);
} }
...@@ -260,7 +260,7 @@ static ssize_t ad2s1210_store_fexcit(struct device *dev, ...@@ -260,7 +260,7 @@ static ssize_t ad2s1210_store_fexcit(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t len) const char *buf, size_t len)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
unsigned long fexcit; unsigned long fexcit;
int ret; int ret;
...@@ -287,7 +287,7 @@ static ssize_t ad2s1210_show_control(struct device *dev, ...@@ -287,7 +287,7 @@ static ssize_t ad2s1210_show_control(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
int ret; int ret;
mutex_lock(&st->lock); mutex_lock(&st->lock);
ret = ad2s1210_config_read(st, AD2S1210_REG_CONTROL); ret = ad2s1210_config_read(st, AD2S1210_REG_CONTROL);
...@@ -299,7 +299,7 @@ static ssize_t ad2s1210_store_control(struct device *dev, ...@@ -299,7 +299,7 @@ static ssize_t ad2s1210_store_control(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t len) const char *buf, size_t len)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
unsigned long udata; unsigned long udata;
unsigned char data; unsigned char data;
int ret; int ret;
...@@ -345,7 +345,7 @@ static ssize_t ad2s1210_store_control(struct device *dev, ...@@ -345,7 +345,7 @@ static ssize_t ad2s1210_store_control(struct device *dev,
static ssize_t ad2s1210_show_resolution(struct device *dev, static ssize_t ad2s1210_show_resolution(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
return sprintf(buf, "%d\n", st->resolution); return sprintf(buf, "%d\n", st->resolution);
} }
...@@ -353,7 +353,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev, ...@@ -353,7 +353,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t len) const char *buf, size_t len)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
unsigned char data; unsigned char data;
unsigned long udata; unsigned long udata;
int ret; int ret;
...@@ -403,7 +403,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev, ...@@ -403,7 +403,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev,
static ssize_t ad2s1210_show_fault(struct device *dev, static ssize_t ad2s1210_show_fault(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
int ret; int ret;
mutex_lock(&st->lock); mutex_lock(&st->lock);
...@@ -418,7 +418,7 @@ static ssize_t ad2s1210_clear_fault(struct device *dev, ...@@ -418,7 +418,7 @@ static ssize_t ad2s1210_clear_fault(struct device *dev,
const char *buf, const char *buf,
size_t len) size_t len)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
int ret; int ret;
mutex_lock(&st->lock); mutex_lock(&st->lock);
...@@ -441,7 +441,7 @@ static ssize_t ad2s1210_show_reg(struct device *dev, ...@@ -441,7 +441,7 @@ static ssize_t ad2s1210_show_reg(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
struct iio_dev_attr *iattr = to_iio_dev_attr(attr); struct iio_dev_attr *iattr = to_iio_dev_attr(attr);
int ret; int ret;
...@@ -455,7 +455,7 @@ static ssize_t ad2s1210_show_reg(struct device *dev, ...@@ -455,7 +455,7 @@ static ssize_t ad2s1210_show_reg(struct device *dev,
static ssize_t ad2s1210_store_reg(struct device *dev, static ssize_t ad2s1210_store_reg(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr, const char *buf, size_t len)
{ {
struct ad2s1210_state *st = iio_priv(dev_get_drvdata(dev)); struct ad2s1210_state *st = iio_priv(dev_to_iio_dev(dev));
unsigned long data; unsigned long data;
int ret; int ret;
struct iio_dev_attr *iattr = to_iio_dev_attr(attr); struct iio_dev_attr *iattr = to_iio_dev_attr(attr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册