public inbox for linux-watchdog@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: 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: Sat, 25 Apr 2015 22:11:40 +0200	[thread overview]
Message-ID: <12253069.Jm7LIDAreu@wuerfel> (raw)
In-Reply-To: <1429902534-2348-2-git-send-email-eric@anholt.net>

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.

Aside from this, the patch looks great.

	Arnd

  parent reply	other threads:[~2015-04-25 20:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1429902534-2348-1-git-send-email-eric@anholt.net>
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:32   ` Pranith Kumar
2015-04-25  4:39   ` Stephen Warren
2015-04-25 20:11   ` Arnd Bergmann [this message]
2015-04-26 15:35     ` Guenter Roeck
2015-04-27  9:18       ` Arnd Bergmann
2015-04-27 12:44         ` Guenter Roeck
2015-04-27 12:48           ` Arnd Bergmann
2015-04-27 13:28             ` Guenter Roeck
2015-04-27 13:32               ` Arnd Bergmann
2015-04-27 12:58   ` Lubomir Rintel
2015-04-27 16:04   ` Guenter Roeck
2015-04-27 16:05     ` Guenter Roeck
2015-04-27 23:12       ` Eric Anholt
2015-04-28  1:39         ` Guenter Roeck
2015-04-28  9:22           ` Lee Jones
2015-04-28 19:38           ` Eric Anholt
2015-04-27 18:28   ` Lee Jones
2015-04-29  2:35   ` [2/2] " Guenter Roeck
2015-04-29  6:45   ` [PATCH 2/2] " 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=12253069.Jm7LIDAreu@wuerfel \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox