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