devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@debian.org>
To: Marek Belisko <marek@goldelico.com>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	rob@landley.net, dbaryshkov@gmail.com, dwmw2@infradead.org,
	grant.likely@linaro.org, hns@goldelico.com,
	devicetree@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] power: twl4030-madc-battery: Convert to iio consumer.
Date: Thu, 6 Mar 2014 00:25:14 +0100	[thread overview]
Message-ID: <20140305232513.GA9542@earth.universe> (raw)
In-Reply-To: <1394052739-8589-2-git-send-email-marek@goldelico.com>

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

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@debian.org>

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-03-05 23:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 20:52 [PATCH v2 0/3] Convert twl4030_madc_battery to IIO consumer and add DT aupport Marek Belisko
2014-03-05 20:52 ` [PATCH v2] power: twl4030-madc-battery: Convert to iio consumer Marek Belisko
2014-03-05 23:25   ` Sebastian Reichel [this message]
2014-03-06 21:10     ` Belisko Marek
2014-08-11 19:52       ` Belisko Marek
2014-08-14 21:03         ` Sebastian Reichel
2014-09-18 20:13           ` Belisko Marek
2014-09-22 10:52             ` Mark Rutland
2014-03-05 20:52 ` [PATCH v2] power: twl4030_madc_battery: Add device tree support Marek Belisko
     [not found] ` <1394052739-8589-1-git-send-email-marek-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2014-03-05 20:52   ` [PATCH v2] Documentation: DT: Document twl4030-madc-battery bindings Marek Belisko
2014-09-22 11:03     ` Mark Rutland
2014-09-22 20:35       ` Belisko Marek
2014-09-26 13:39         ` Mark Rutland
2014-10-09  8:02           ` Belisko Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140305232513.GA9542@earth.universe \
    --to=sre@debian.org \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=hns@goldelico.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek@goldelico.com \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=rob@landley.net \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).