Linux-sh Archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-sh@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: pm_runtime_early_init() defined but not used, except on SuperH which has its own definition ?
Date: Sun, 3 Mar 2024 20:53:10 +0100	[thread overview]
Message-ID: <010ea3a0-929e-4912-ad22-9f0cf5b1a3e2@redhat.com> (raw)

Hi All,

I noticed that drivers/base/power/power.h defines pm_runtime_early_init()
but nothing under drivers/base uses this.

A grep over the entire tree shows that arch/sh/drivers/platform_early.c
does use pm_runtime_early_init() but rather then including
drivers/base/power/power.h it has its own definition / private copy
of both device_pm_init_common() and pm_runtime_early_init() from
drivers/base/power/power.h ???

Also the private copy of pm_runtime_early_init() in
arch/sh/drivers/platform_early.c differs from the unused one
in drivers/base/power/power.h, but only when CONFIG_PM is not set.

When CONFIG_PM is not set then the pm_runtime_early_init() in
arch/sh/drivers/platform_early.c is a no-op, where as the one in
drivers/base/power/power.h still calls device_pm_init_common()
in this case ...

I also wonder if given that pm_runtime_early_init() is not
used with the exception of arch/sh/drivers/platform_early.c
if the dev->power.early_init flag check in
device_pm_init_common() is really necessary ?

On non SuperH the only (1) caller of device_pm_init_common()
is device_pm_init(), so it seems to me that the code to
avoid doing device_pm_init_common() twice is unnecessary.

Actually it seems to me that the entire contents of
device_pm_init_common() can be moved inside device_pm_init()
and the dev->power.early_init can be completely dropped (2).

Regards,

Hans


1) Well pm_runtime_early_init() calls it too, but that itself
is unused and can be removed, removing it is even ok-ish
for SuperH since that has its own copy anyways.

2) With the exception that all of this is still necessary
for SuperH I guess.



             reply	other threads:[~2024-03-03 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 19:53 Hans de Goede [this message]
2024-03-04 10:34 ` pm_runtime_early_init() defined but not used, except on SuperH which has its own definition ? Geert Uytterhoeven

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=010ea3a0-929e-4912-ad22-9f0cf5b1a3e2@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=dalias@libc.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=ysato@users.sourceforge.jp \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).