[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160205143908.GJ4782@piout.net>
Date: Fri, 5 Feb 2016 15:39:08 +0100
From: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To: Joshua Clayton <stillcompiling@...il.com>
Cc: Alessandro Zummo <a.zummo@...ertech.it>,
rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/3] rtc: Add functions to set and read rtc offset
On 04/02/2016 at 15:32:42 -0800, Joshua Clayton wrote :
> > > +int rtc_read_offset(struct rtc_device *rtc, long *offset)
> > > +{
> > > + int ret = 0;
> > > +
> > > + if (!rtc->ops)
> > > + return -ENODEV;
> > > +
> > > + if (!rtc->ops->set_offset) {
> > > + *offset = 0;
> > > + return 0;
> > > + }
> > > +
> >
> > I should have been clearer but this is not necessary anymore since the
> > sysfs interface will not always be present but you
> > should probably test rtc->ops->read_offset instead.
> >
> I left it because the kernel API is still there even if the sysfs
> file is not...
> but yeah, you are right. I'll fix the check, and the formatting
> in the other patch.
>
Yeah but from inside the kernel, I feel that it is more useful to know
that the value doesn't exist instead of having 0.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Powered by blists - more mailing lists