mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: rtc-linux@googlegroups.com
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>,
	linux-kernel@vger.kernel.org
Subject: Re: [rtc-linux] Re: [PATCH 2/2] rtc: Add boot_timesource sysfs attribute
Date: Sun, 6 Sep 2009 02:34:32 +0100	[thread overview]
Message-ID: <20090906013431.GB4239@sirena.org.uk> (raw)
In-Reply-To: <20090904170928.GA26009@srcf.ucam.org>

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.

  parent reply	other threads:[~2009-09-06  1:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 16:26 [PATCH 1/2] rtc: Document the sysfs interface Matthew Garrett
2009-09-04 16:26 ` [PATCH 2/2] rtc: Add boot_timesource sysfs attribute Matthew Garrett
2009-09-04 16:25   ` [rtc-linux] " Alessandro Zummo
2009-09-04 16:30     ` Matthew Garrett
2009-09-04 16:38       ` [rtc-linux] " Alessandro Zummo
2009-09-04 16:41         ` Matthew Garrett
2009-09-04 16:52           ` Alessandro Zummo
2009-09-04 16:55             ` Matthew Garrett
2009-09-04 17:03               ` Alessandro Zummo
2009-09-04 17:09                 ` Matthew Garrett
2009-09-05 21:11                   ` Alessandro Zummo
2009-09-06  1:34                   ` Mark Brown [this message]
2009-09-14 22:59             ` Karel Zak
2009-09-04 16:26 ` [rtc-linux] [PATCH 1/2] rtc: Document the sysfs interface Alessandro Zummo
2009-09-04 16:35 ` Mark Brown
2009-09-04 16:39   ` Matthew Garrett
2009-09-04 16:52     ` [rtc-linux] " Mark Brown
2009-09-04 23:23       ` Andrew Morton

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=20090906013431.GB4239@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alessandro.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /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

all inboxes | Powered by JetHome®