[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090906013431.GB4239@sirena.org.uk>
Date: Sun, 6 Sep 2009 02:34:32 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: rtc-linux@...glegroups.com
Cc: Alessandro Zummo <alessandro.zummo@...ertech.it>,
linux-kernel@...r.kernel.org
Subject: Re: [rtc-linux] Re: [PATCH 2/2] rtc: Add boot_timesource sysfs
attribute
On Fri, Sep 04, 2009 at 06:09:28PM +0100, Matthew Garrett wrote:
> +hctosys: 1 if the RTC provided the system time at boot via the
> + CONFIG_RTC_HCTOSYS kernel option, 0 otherwise
...
> +static ssize_t
> +rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
> + char *buf)
> +{
> +#ifdef CONFIG_RTC_HCTOSYS_DEVICE
> + if (strcmp(dev_name(&to_rtc_device(dev)->dev),
> + CONFIG_RTC_HCTOSYS_DEVICE) == 0)
> + return sprintf(buf, "1\n");
> + else
> +#endif
Strictly speaking this only reports if the RTC was configured to provide
the system time at boot, it does not check to see if it actually
succeeded in doing so. Obviously failures here are a relatively rare
occurrance but they can happen. I don't think it's worth changing the
code since it's unlikely userspace will be able to do any better than
the kernel did but it might be worth updating the documentation just in
case.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists