All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Arnd Bergmann <arnd@arndb.de>, linux-arm-kernel@lists.infradead.org
Cc: Eric Anholt <eric@anholt.net>,
	linux-watchdog@vger.kernel.org, Lee Jones <lee@kernel.org>,
	linux-rpi-kernel@lists.infradead.org,
	Stephen Warren <swarren@wwwdotorg.org>
Subject: Re: [PATCH 2/2] ARM: BCM2835: Move the restart/power_off handling to the WDT driver.
Date: Sun, 26 Apr 2015 08:35:57 -0700	[thread overview]
Message-ID: <553D05DD.8080300@roeck-us.net> (raw)
In-Reply-To: <12253069.Jm7LIDAreu@wuerfel>

On 04/25/2015 01:11 PM, Arnd Bergmann wrote:
> On Friday 24 April 2015 12:08:54 Eric Anholt wrote:
>> +/*
>> + * We can't really power off, but if we do the normal reset scheme, and
>> + * indicate to bootcode.bin not to reboot, then most of the chip will be
>> + * powered off.
>> + */
>> +static void bcm2835_power_off(void)
>> +{
>> +       struct device_node *np =
>> +               of_find_compatible_node(NULL, NULL, "brcm,bcm2835-pm-wdt");
>> +       struct platform_device *pdev = of_find_device_by_node(np);
>> +       struct bcm2835_wdt *wdt = platform_get_drvdata(pdev);
>> +       u32 val;
>> +
>
> Instead of doing the lookup again here, I'd suggest using a static variable
> in the driver to store the device pointer for the device used on power_off.
>
> Make sure that the device remove callback assigns it back to NULL though
> and that the function checks for NULL pointer.
>

Why would that be needed ?

Guenter


WARNING: multiple messages have this Message-ID (diff)
From: linux@roeck-us.net (Guenter Roeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: BCM2835: Move the restart/power_off handling to the WDT driver.
Date: Sun, 26 Apr 2015 08:35:57 -0700	[thread overview]
Message-ID: <553D05DD.8080300@roeck-us.net> (raw)
In-Reply-To: <12253069.Jm7LIDAreu@wuerfel>

On 04/25/2015 01:11 PM, Arnd Bergmann wrote:
> On Friday 24 April 2015 12:08:54 Eric Anholt wrote:
>> +/*
>> + * We can't really power off, but if we do the normal reset scheme, and
>> + * indicate to bootcode.bin not to reboot, then most of the chip will be
>> + * powered off.
>> + */
>> +static void bcm2835_power_off(void)
>> +{
>> +       struct device_node *np =
>> +               of_find_compatible_node(NULL, NULL, "brcm,bcm2835-pm-wdt");
>> +       struct platform_device *pdev = of_find_device_by_node(np);
>> +       struct bcm2835_wdt *wdt = platform_get_drvdata(pdev);
>> +       u32 val;
>> +
>
> Instead of doing the lookup again here, I'd suggest using a static variable
> in the driver to store the device pointer for the device used on power_off.
>
> Make sure that the device remove callback assigns it back to NULL though
> and that the function checks for NULL pointer.
>

Why would that be needed ?

Guenter

  reply	other threads:[~2015-04-26 15:36 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 19:08 [PATCH 1/2] ARM: BCM2835: Drop the init_irq() hook Eric Anholt
2015-04-24 19:08 ` [PATCH 2/2] ARM: BCM2835: Move the restart/power_off handling to the WDT driver Eric Anholt
2015-04-24 19:08   ` Eric Anholt
2015-04-24 19:32   ` Pranith Kumar
2015-04-24 19:32     ` Pranith Kumar
2015-04-25  4:39   ` Stephen Warren
2015-04-25  4:39     ` Stephen Warren
2015-04-25 20:11   ` Arnd Bergmann
2015-04-25 20:11     ` Arnd Bergmann
2015-04-26 15:35     ` Guenter Roeck [this message]
2015-04-26 15:35       ` Guenter Roeck
2015-04-27  9:18       ` Arnd Bergmann
2015-04-27  9:18         ` Arnd Bergmann
2015-04-27 12:44         ` Guenter Roeck
2015-04-27 12:44           ` Guenter Roeck
2015-04-27 12:48           ` Arnd Bergmann
2015-04-27 12:48             ` Arnd Bergmann
2015-04-27 13:28             ` Guenter Roeck
2015-04-27 13:28               ` Guenter Roeck
2015-04-27 13:32               ` Arnd Bergmann
2015-04-27 13:32                 ` Arnd Bergmann
2015-04-27 12:58   ` Lubomir Rintel
2015-04-27 12:58     ` Lubomir Rintel
2015-04-27 16:04   ` Guenter Roeck
2015-04-27 16:04     ` Guenter Roeck
2015-04-27 16:05     ` Guenter Roeck
2015-04-27 16:05       ` Guenter Roeck
2015-04-27 23:12       ` Eric Anholt
2015-04-27 23:12         ` Eric Anholt
2015-04-28  1:39         ` Guenter Roeck
2015-04-28  1:39           ` Guenter Roeck
2015-04-28  9:22           ` Lee Jones
2015-04-28  9:22             ` Lee Jones
2015-04-28 19:38           ` Eric Anholt
2015-04-28 19:38             ` Eric Anholt
2015-04-27 18:28   ` Lee Jones
2015-04-27 18:28     ` Lee Jones
2015-04-29  2:35   ` [2/2] " Guenter Roeck
2015-04-29  2:35     ` Guenter Roeck
2015-04-29  6:45   ` [PATCH 2/2] " Lee Jones
2015-04-29  6:45     ` Lee Jones
2015-04-27 18:29 ` [PATCH 1/2] ARM: BCM2835: Drop the init_irq() hook Lee Jones

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=553D05DD.8080300@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=eric@anholt.net \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=swarren@wwwdotorg.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.