linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Denis OSTERLAND <denis.osterland@diehl.com>
Cc: "a.zummo@towertech.it" <a.zummo@towertech.it>,
	"linux-rtc@vger.kernel.org" <linux-rtc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] rtc: isl1208: access i2c client via rtc parent
Date: Fri, 28 Sep 2018 14:04:51 +0200	[thread overview]
Message-ID: <20180928120451.GR16644@piout.net> (raw)
In-Reply-To: <20180928114832.27383-1-Denis.Osterland@diehl.com>

Hello,

On 28/09/2018 11:51:17+0000, Denis OSTERLAND wrote:
> From: Denis Osterland <Denis.Osterland@diehl.com>
> 
> The move of atrim, dtrim usr sysfs properties from i2c device
> to rtc device require to access them via dev->parent.
> This patch also aligns timestamp0.
> 
> Fixes: 03df75dd03301307ec578ccd4e8c1c0117b8e65c
> Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com>
> ---
>  drivers/rtc/rtc-isl1208.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
> index 15094df12985..ec5ef518a09b 100644
> --- a/drivers/rtc/rtc-isl1208.c
> +++ b/drivers/rtc/rtc-isl1208.c
> @@ -517,7 +517,7 @@ static ssize_t timestamp0_store(struct device *dev,
>  				struct device_attribute *attr,
>  				const char *buf, size_t count)
>  {
> -	struct i2c_client *client = dev_get_drvdata(dev);
> +	struct i2c_client *client = to_i2c_client(dev->parent);
>  	int sr;
> 
>  	sr = isl1208_i2c_get_sr(client);
> @@ -539,7 +539,7 @@ static ssize_t timestamp0_store(struct device *dev,
>  static ssize_t timestamp0_show(struct device *dev,
>  			       struct device_attribute *attr, char *buf)
>  {
> -	struct i2c_client *client = dev_get_drvdata(dev);
> +	struct i2c_client *client = to_i2c_client(dev->parent);
>  	u8 regs[ISL1219_EVT_SECTION_LEN] = { 0, };
>  	struct rtc_time tm;
>  	int sr;
> @@ -649,7 +649,7 @@ static ssize_t
>  isl1208_sysfs_show_atrim(struct device *dev,
>  			 struct device_attribute *attr, char *buf)
>  {
> -	int atr = isl1208_i2c_get_atr(to_i2c_client(dev));
> +	int atr = isl1208_i2c_get_atr(to_i2c_client(dev->parent));
>  	if (atr < 0)
>  		return atr;
> 
> @@ -662,7 +662,7 @@ static ssize_t
>  isl1208_sysfs_show_dtrim(struct device *dev,
>  			 struct device_attribute *attr, char *buf)
>  {
> -	int dtr = isl1208_i2c_get_dtr(to_i2c_client(dev));
> +	int dtr = isl1208_i2c_get_dtr(to_i2c_client(dev->parent));

Oh right, I actually had that but somehow, I stashed the patch instead
of squashing it.

If that is fine for you, I'll fold that in the original patch (I'll ad
your SoB).


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-09-28 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28 11:51 [PATCH] rtc: isl1208: access i2c client via rtc parent Denis OSTERLAND
2018-09-28 12:04 ` Alexandre Belloni [this message]
2018-09-28 12:06   ` Denis OSTERLAND
2018-09-28 12:12     ` Alexandre Belloni

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=20180928120451.GR16644@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=denis.osterland@diehl.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.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).