Staging: iio: replace pr_err with dev_err

This patch replace pr_err with dev_err, when appropriate device structre
is found.
Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}

@rr@
identifier r.s, fld;
@@

struct s {
	...
	struct device *fld;
	...
};

@@
identifier r.i, rr.fld;
position r.p;
@@
-pr_err@p
+dev_err
   (
+ i->fld,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Haneen Mohammed 2015-03-17 08:35:41 +03:00 коммит произвёл Greg Kroah-Hartman
Родитель df02b50acf
Коммит 92371df8a9
1 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -214,7 +214,7 @@ static ssize_t ad2s1210_store_fclkin(struct device *dev,
if (ret) if (ret)
return ret; return ret;
if (fclkin < AD2S1210_MIN_CLKIN || fclkin > AD2S1210_MAX_CLKIN) { if (fclkin < AD2S1210_MIN_CLKIN || fclkin > AD2S1210_MAX_CLKIN) {
pr_err("ad2s1210: fclkin out of range\n"); dev_err(dev, "ad2s1210: fclkin out of range\n");
return -EINVAL; return -EINVAL;
} }
@ -252,7 +252,8 @@ static ssize_t ad2s1210_store_fexcit(struct device *dev,
if (ret < 0) if (ret < 0)
return ret; return ret;
if (fexcit < AD2S1210_MIN_EXCIT || fexcit > AD2S1210_MAX_EXCIT) { if (fexcit < AD2S1210_MIN_EXCIT || fexcit > AD2S1210_MAX_EXCIT) {
pr_err("ad2s1210: excitation frequency out of range\n"); dev_err(dev,
"ad2s1210: excitation frequency out of range\n");
return -EINVAL; return -EINVAL;
} }
mutex_lock(&st->lock); mutex_lock(&st->lock);
@ -307,7 +308,8 @@ static ssize_t ad2s1210_store_control(struct device *dev,
goto error_ret; goto error_ret;
if (ret & AD2S1210_MSB_IS_HIGH) { if (ret & AD2S1210_MSB_IS_HIGH) {
ret = -EIO; ret = -EIO;
pr_err("ad2s1210: write control register fail\n"); dev_err(dev,
"ad2s1210: write control register fail\n");
goto error_ret; goto error_ret;
} }
st->resolution st->resolution
@ -346,7 +348,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev,
ret = kstrtou8(buf, 10, &udata); ret = kstrtou8(buf, 10, &udata);
if (ret || udata < 10 || udata > 16) { if (ret || udata < 10 || udata > 16) {
pr_err("ad2s1210: resolution out of range\n"); dev_err(dev, "ad2s1210: resolution out of range\n");
return -EINVAL; return -EINVAL;
} }
mutex_lock(&st->lock); mutex_lock(&st->lock);
@ -368,7 +370,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev,
data = ret; data = ret;
if (data & AD2S1210_MSB_IS_HIGH) { if (data & AD2S1210_MSB_IS_HIGH) {
ret = -EIO; ret = -EIO;
pr_err("ad2s1210: setting resolution fail\n"); dev_err(dev, "ad2s1210: setting resolution fail\n");
goto error_ret; goto error_ret;
} }
st->resolution st->resolution