Re: [PATCH v2] power: twl4030-madc-battery: Convert to iio consumer.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marek,

I just have one comment:

On Wed, Mar 05, 2014 at 09:52:17PM +0100, Marek Belisko wrote:
> [...]
> -static int madc_read(int index)
> +static int madc_read(struct iio_channel *channel)
>  {
> -	struct twl4030_madc_request req;
> -	int val;
> -
> -	req.channels = index;
> -	req.method = TWL4030_MADC_SW2;
> -	req.type = TWL4030_MADC_WAIT;
> -	req.do_avg = 0;
> -	req.raw = false;
> -	req.func_cb = NULL;
> -
> -	val = twl4030_madc_conversion(&req);
> -	if (val < 0)
> -		return val;
> -
> -	return req.rbuf[ffs(index) - 1];
> +	int val, err;
> +	err = iio_read_channel_processed(channel, &val);
> +	if (err < 0) {
> +		pr_info("Error:%d\n", err);

This should be "Error: %d\n" (with a space).

Apart from that you should use dev_info() or dev_err(), so that the
message is properly prefixed by the device. Currently there is no
hint where this error message is generated.

> +		return err;
> +	}
> +	return val;
>  }
> [...]

After fixing this you can add

Reviewed-By: Sebastian Reichel <sre@xxxxxxxxxx>

-- Sebastian

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux