linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Borleis <jbe@pengutronix.de>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: rtc-linux@googlegroups.com,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	linux-kernel@vger.kernel.org,
	"Ulrich Ölmann" <u.oelmann@pengutronix.de>
Subject: Re: [PATCH] rtc: pcf85063: remove useless century handling
Date: Tue, 1 Mar 2016 09:29:19 +0100	[thread overview]
Message-ID: <201603010929.19210.jbe@pengutronix.de> (raw)
In-Reply-To: <1456268728-343-1-git-send-email-alexandre.belloni@free-electrons.com>

On Wednesday 24 February 2016 00:05:28 Alexandre Belloni wrote:
> pcf85063_get_datetime() tries to handle a century bit but that bit is not
> documented and the final value is never used anywhere else in the kernel.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  drivers/rtc/rtc-pcf85063.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
> index c5db231f14de..2b3b99b094b5 100644
> --- a/drivers/rtc/rtc-pcf85063.c
> +++ b/drivers/rtc/rtc-pcf85063.c
> @@ -31,13 +31,10 @@
>  #define PCF85063_REG_MO			0x09
>  #define PCF85063_REG_YR			0x0A
>
> -#define PCF85063_MO_C			0x80 /* century */
> -
>  static struct i2c_driver pcf85063_driver;
>
>  struct pcf85063 {
>  	struct rtc_device *rtc;
> -	int c_polarity;	/* 0: MO_C=1 means 19xx, otherwise MO_C=1 means 20xx */
>  	int voltage_low; /* indicates if a low_voltage was detected */
>  };
>
> @@ -103,9 +100,6 @@ static int pcf85063_get_datetime(struct i2c_client
> *client, struct rtc_time *tm) tm->tm_year = bcd2bin(regs[6]);
>  	if (tm->tm_year < 70)
>  		tm->tm_year += 100;	/* assume we are in 1970...2069 */
> -	/* detect the polarity heuristically. see note above. */
> -	pcf85063->c_polarity = (regs[5] & PCF85063_MO_C) ?
> -		(tm->tm_year >= 100) : (tm->tm_year < 100);
>
>  	return rtc_valid_tm(tm);
>  }

Reviewed-by: Juergen Borleis <jbe@pengutronix.de>
Tested-by: Ulrich Ölmann <u.oelmann@pengutronix.de>

Regards,
Juergen

      parent reply	other threads:[~2016-03-01  8:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 23:05 [PATCH] rtc: pcf85063: remove useless century handling Alexandre Belloni
2016-02-26 11:07 ` Juergen Borleis
2016-03-01  8:29 ` Juergen Borleis [this message]

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=201603010929.19210.jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=u.oelmann@pengutronix.de \
    /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).