Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1318141
| From | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] ASoC: wm2000: Use a signed return type for regmap_read |
| Date | 2016-01-26 18:00 +0100 |
| Message-ID | <qVf8f-6St-25@gated-at.bofh.it> (permalink) |
| References | <qUVjc-pt-13@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Jan 25, 2016 at 05:48:13PM -0200, Lucas Tanure wrote:
> The return type "unsigned int" was used by the regmap_read() function despite
> of the aspect that it will eventually return a negative error code. So, change
> to signed int and get reg by reference in the parameters
>
> Signed-off-by: Lucas Tanure <tanure@linux.com>
> ---
> sound/soc/codecs/wm2000.c | 25 +++++++++----------------
> 1 file changed, 9 insertions(+), 16 deletions(-)
>
> diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c
> index a67ea10..990d710 100644
> --- a/sound/soc/codecs/wm2000.c
> +++ b/sound/soc/codecs/wm2000.c
> @@ -88,17 +88,11 @@ static int wm2000_write(struct i2c_client *i2c, unsigned int reg,
> return regmap_write(wm2000->regmap, reg, value);
> }
>
> -static unsigned int wm2000_read(struct i2c_client *i2c, unsigned int r)
> +static int wm2000_read(struct i2c_client *i2c, unsigned int reg,
> + unsigned int *value)
> {
> struct wm2000_priv *wm2000 = i2c_get_clientdata(i2c);
> - unsigned int val;
> - int ret;
> -
> - ret = regmap_read(wm2000->regmap, r, &val);
> - if (ret < 0)
> - return -1;
> -
> - return val;
> + return regmap_read(wm2000->regmap, reg, value);
At this point the wm2000_read function is not really adding
anything feels like we should just remove it and use regmap_read
directly.
Thanks,
Charles
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] ASoC: wm2000: Use a signed return type for regmap_read Lucas Tanure <tanure@linux.com> - 2016-01-25 20:50 +0100 Re: [PATCH] ASoC: wm2000: Use a signed return type for regmap_read Charles Keepax <ckeepax@opensource.wolfsonmicro.com> - 2016-01-26 18:00 +0100
csiph-web