From: Haneen Mohammed Date: Tue, 17 Mar 2015 05:35:41 +0000 (+0300) Subject: Staging: iio: replace pr_err with dev_err X-Git-Tag: firefly_0821_release~176^2~1998^2~138^2~342 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=92371df8a9b70735b63075bb1f8a7480488d748e;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c index b4c14ba5fdee..1d8c5c0bdc88 100644 --- a/drivers/staging/iio/resolver/ad2s1210.c +++ b/drivers/staging/iio/resolver/ad2s1210.c @@ -214,7 +214,7 @@ static ssize_t ad2s1210_store_fclkin(struct device *dev, if (ret) return ret; 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; } @@ -252,7 +252,8 @@ static ssize_t ad2s1210_store_fexcit(struct device *dev, if (ret < 0) return ret; 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; } mutex_lock(&st->lock); @@ -307,7 +308,8 @@ static ssize_t ad2s1210_store_control(struct device *dev, goto error_ret; if (ret & AD2S1210_MSB_IS_HIGH) { ret = -EIO; - pr_err("ad2s1210: write control register fail\n"); + dev_err(dev, + "ad2s1210: write control register fail\n"); goto error_ret; } st->resolution @@ -346,7 +348,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev, ret = kstrtou8(buf, 10, &udata); 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; } mutex_lock(&st->lock); @@ -368,7 +370,7 @@ static ssize_t ad2s1210_store_resolution(struct device *dev, data = ret; if (data & AD2S1210_MSB_IS_HIGH) { ret = -EIO; - pr_err("ad2s1210: setting resolution fail\n"); + dev_err(dev, "ad2s1210: setting resolution fail\n"); goto error_ret; } st->resolution