linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Linus Walleij <linus.walleij@linaro.org>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	LINUXWATCHDOG <linux-watchdog@vger.kernel.org>
Subject: Re: [PATCH 09/46] watchdog: sa1100: use platform device registration
Date: Tue, 22 Oct 2019 11:44:33 +0200	[thread overview]
Message-ID: <CAK8P3a0GPVs+PqUwsL2H8VJqLh=MJnMTwPu9nhX+Nq-xiMS1yQ@mail.gmail.com> (raw)
In-Reply-To: <bb4713a0-60bd-8d27-874f-e7e3a5adaec8@roeck-us.net>

On Sat, Oct 19, 2019 at 4:07 PM Guenter Roeck <linux@roeck-us.net> wrote:

> > @@ -319,10 +316,13 @@ static struct platform_device *sa11x0_devices[] __initdata = {
> >
> >   static int __init sa1100_init(void)
> >   {
> > +     struct resource wdt_res = DEFINE_RES_MEM(0x90000000, 0x20);
> >       pm_power_off = sa1100_power_off;
> >
> >       regulator_has_full_constraints();
> >
> > +     platform_device_register_simple("sa1100_wdt", -1, &wdt_res, 1);
> > +
> >       return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices));
>
> Wouldn't it be better to add the watchdog device to sa11x0_devices ?

Generally speaking, platform_device_register_simple() is better than
platform_add_devices(), it does the same thing with fewer source lines
and smaller object code, and it doesn't have the problem of lifetime rules
for statically allocated reference-counted devices.

One day we may want to replace all static platform_device instances with
platform_device_info instead, but right now there are too many of those.

I can change this one to a platform_device for consistency though if you
think it's worth it.

     Arnd

  reply	other threads:[~2019-10-22  9:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 15:40 [PATCH 00/46] ARM: pxa: towards multiplatform support Arnd Bergmann
2019-10-18 15:41 ` [PATCH 05/46] ARM: pxa: split up mach/hardware.h Arnd Bergmann
2019-10-18 18:37   ` Dmitry Torokhov
2019-10-19 21:22   ` Alexandre Belloni
2019-10-21  2:27   ` Viresh Kumar
2019-10-21  9:58   ` Ulf Hansson
2019-10-22 16:36   ` Mark Brown
2019-10-28  9:18   ` Stephen Boyd
2019-10-28 19:14   ` Robert Jarzmik
2019-10-18 15:41 ` [PATCH 09/46] watchdog: sa1100: use platform device registration Arnd Bergmann
2019-10-19 14:06   ` Guenter Roeck
2019-10-22  9:44     ` Arnd Bergmann [this message]
2019-10-22 13:38       ` Guenter Roeck
2019-10-18 19:03 ` [PATCH 00/46] ARM: pxa: towards multiplatform support Robert Jarzmik
     [not found]   ` <CAK8P3a1JDtHsOW=iaxEycbJ4TBkR9MHUyDMeJnwxCtb=tefnBQ@mail.gmail.com>
2019-10-18 19:32     ` Arnd Bergmann
2019-10-19 10:35       ` Robert Jarzmik
2019-10-24 20:49         ` Robert Jarzmik
2019-10-25 10:50           ` Arnd Bergmann
2019-10-19  1:02 ` Guenter Roeck
2019-10-19 10:08   ` Arnd Bergmann
2019-10-19 10:09   ` Arnd Bergmann

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='CAK8P3a0GPVs+PqUwsL2H8VJqLh=MJnMTwPu9nhX+Nq-xiMS1yQ@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=daniel@zonque.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robert.jarzmik@free.fr \
    --cc=wim@linux-watchdog.org \
    /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 NNTP newsgroup(s).