public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-rtc@vger.kernel.org
Cc: Linux ACPI <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v1 1/5] rtc: rtc-cmos: Call cmos_wake_setup() from cmos_do_probe()
Date: Tue, 08 Nov 2022 10:30:33 +0800	[thread overview]
Message-ID: <b369e6d44b01e0ccc653e333bc2def556b17bbb3.camel@intel.com> (raw)
In-Reply-To: <1850290.tdWV9SEqCh@kreacher>

On Mon, 2022-11-07 at 20:59 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Notice that cmos_wake_setup() is the only user of acpi_rtc_info and
> it
> can operate on the cmos_rtc variable directly, so it need not set the
> platform_data pointer before cmos_do_probe() is called.  Instead, it
> can be called by cmos_do_probe() in the case when the platform_data
> pointer is not set to implement the default behavior (which is to use
> the FADT information as long as ACPI support is enabled).
> 

...

>  
> @@ -827,19 +829,27 @@ cmos_do_probe(struct device *dev, struct
>  		if (info->address_space)
>  			address_space = info->address_space;
>  
> -		if (info->rtc_day_alarm && info->rtc_day_alarm < 128)
> -			cmos_rtc.day_alrm = info->rtc_day_alarm;
> -		if (info->rtc_mon_alarm && info->rtc_mon_alarm < 128)
> -			cmos_rtc.mon_alrm = info->rtc_mon_alarm;
> -		if (info->rtc_century && info->rtc_century < 128)
> -			cmos_rtc.century = info->rtc_century;
> +		cmos_rtc.day_alrm = info->rtc_day_alarm;
> +		cmos_rtc.mon_alrm = info->rtc_mon_alarm;
> +		cmos_rtc.century = info->rtc_century;
>  
>  		if (info->wake_on && info->wake_off) {
>  			cmos_rtc.wake_on = info->wake_on;
>  			cmos_rtc.wake_off = info->wake_off;
>  		}
> +	} else {
> +		cmos_wake_setup(dev);
>  	}
>  
> 

Previously, before commit a474aaedac99 ("rtc-cmos: move wake setup from
ACPI glue into RTC driver"), dev->platform_data is set in
drivers/acpi/glue.c, and the above commit moves it to cmos_wake_setup()
in this file.

Now, with this patch, my understanding is that dev->platform_data is
never set, thus we can remove the 'info' variable and the
	if (info)
check above.

thanks,
rui


  reply	other threads:[~2022-11-08  2:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 19:58 [PATCH v1 0/5] rtc: rtc-cmos: Assorted ACPI-related cleanups and fixes Rafael J. Wysocki
2022-11-07 19:59 ` [PATCH v1 1/5] rtc: rtc-cmos: Call cmos_wake_setup() from cmos_do_probe() Rafael J. Wysocki
2022-11-08  2:30   ` Zhang Rui [this message]
2022-11-08 13:09     ` Rafael J. Wysocki
2022-11-08 15:41       ` Zhang Rui
2022-11-07 20:00 ` [PATCH v1 2/5] rtc: rtc-cmos: Call rtc_wake_setup() " Rafael J. Wysocki
2022-11-07 20:00 ` [PATCH v1 3/5] rtc: rtc-cmos: Eliminate forward declarations of some functions Rafael J. Wysocki
2022-11-07 20:01 ` [PATCH v1 4/5] rtc: rtc-cmos: Rename ACPI-related functions Rafael J. Wysocki
2022-11-07 21:21   ` Andy Shevchenko
2022-11-08 14:43     ` Rafael J. Wysocki
2022-11-07 20:03 ` [PATCH v1 5/5] rtc: rtc-cmos: Disable ACPI RTC event on removal Rafael J. Wysocki
2022-11-07 21:20   ` Andy Shevchenko
2022-11-08 14:54     ` Rafael J. Wysocki
2022-11-07 21:28   ` Andy Shevchenko
2022-11-08 14:54     ` Rafael J. Wysocki

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=b369e6d44b01e0ccc653e333bc2def556b17bbb3.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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