All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@avionic-design.de>
To: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rtc-pcf8523: Add low battery voltage support
Date: Wed, 19 Dec 2012 16:48:35 +0100	[thread overview]
Message-ID: <20121219154828.GA32019@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <20121219153432.GC14217@axis.com>

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

On Wed, Dec 19, 2012 at 04:34:32PM +0100, Jesper Nilsson wrote:
> This patch implements reading of the battery voltage low signal for
> rtc-pcf8523.
> 
> The bit is read-only and cannot be cleared by software, so no
> clear-function is implemented.
> 
> Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
> ---
> diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c
> index be05a64..62905fb 100644
> --- a/drivers/rtc/rtc-pcf8523.c
> +++ b/drivers/rtc/rtc-pcf8523.c
> @@ -23,6 +23,7 @@
>  #define REG_CONTROL3_PM_VDD (1 << 6) /* switch-over disabled */
>  #define REG_CONTROL3_PM_DSM (1 << 5) /* direct switching mode */
>  #define REG_CONTROL3_PM_MASK 0xe0
> +#define REG_CONTROL3_BLF (1 << 2) /* battery low bit, read-only */
>  
>  #define REG_SECONDS  0x03
>  #define REG_SECONDS_OS (1 << 7)
> @@ -250,9 +252,36 @@ static int pcf8523_rtc_set_time(struct device *dev, struct rtc_time *tm)
>  	return pcf8523_start_rtc(client);
>  }
>  
> +static int
> +pcf8523_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)

You should keep the modifier and return type on the same line as the
function name and wrap the arguments instead. That is:

static int pcf8523_rtc_ioctl(struct device *dev, unsigned int cmd,
			     unsigned long arg)
{
	...
}

> +{
> +	struct i2c_client *client = to_i2c_client(dev);
> +	u8 value;
> +	int err;
> +	int ret = 0;

You can probably collapse the two integers in one line, like so:

	int ret = 0, err;

Other than that, looks good:

Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>

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

  reply	other threads:[~2012-12-19 15:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 14:04 [PATCH] rtc-pcf8523: Add low battery voltage support Jesper Nilsson
2012-12-19 14:42 ` Thierry Reding
2012-12-19 15:10   ` Jesper Nilsson
2012-12-19 15:19     ` Thierry Reding
2012-12-19 15:34       ` [PATCH v2] " Jesper Nilsson
2012-12-19 15:48         ` Thierry Reding [this message]
2012-12-19 16:00           ` [PATCH v3] " Jesper Nilsson
2012-12-19 22:03             ` Andrew Morton

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=20121219154828.GA32019@avionic-0098.adnet.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=jesper.nilsson@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.