linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: tnt@246tNt.com, davem@davemloft.net, linuxppc-dev@ozlabs.org,
	sparclinux@vger.kernel.org, cbe-oss-dev@ozlabs.org,
	m8@semihalf.com
Subject: Re: [PATCH 2/4] Create and hook up of_platform_device_shutdown
Date: Tue, 05 Feb 2008 11:19:49 +1100	[thread overview]
Message-ID: <1202170789.7079.26.camel@pasglop> (raw)
In-Reply-To: <bf48a30aa9f58fa6e153f679eb0eb6a4864ebdc3.1201240265.git.michael@ellerman.id.au>


On Fri, 2008-01-25 at 16:59 +1100, Michael Ellerman wrote:
> Although of_platform_device's can have a shutdown routine, at the moment
> the bus code doesn't actually call it. So add the required glue to
> hook the shutdown routine.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  drivers/of/platform.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> 
> CC various folks who've written/touched of_platform_drivers which already
> have shutdown routines. These routines have never been called so they're
> about to get their first testing.
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index b47bb2d..ca09a63 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -85,6 +85,15 @@ static int of_platform_device_resume(struct device * dev)
>  	return error;
>  }
>  
> +static void of_platform_device_shutdown(struct device *dev)
> +{
> +	struct of_device *of_dev = to_of_device(dev);
> +	struct of_platform_driver *drv = to_of_platform_driver(dev->driver);
> +
> +	if (dev->driver && drv->shutdown)
> +		drv->shutdown(of_dev);
> +}
> +
>  int of_bus_type_init(struct bus_type *bus, const char *name)
>  {
>  	bus->name = name;
> @@ -93,6 +102,7 @@ int of_bus_type_init(struct bus_type *bus, const char *name)
>  	bus->remove = of_platform_device_remove;
>  	bus->suspend = of_platform_device_suspend;
>  	bus->resume = of_platform_device_resume;
> +	bus->shutdown = of_platform_device_shutdown;
>  	return bus_register(bus);
>  }
>  

  reply	other threads:[~2008-02-05  0:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25  5:59 [PATCH 1/4] Search for and publish cell OF platform devices earlier Michael Ellerman
2008-01-25  5:59 ` [PATCH 2/4] Create and hook up of_platform_device_shutdown Michael Ellerman
2008-02-05  0:19   ` Benjamin Herrenschmidt [this message]
2008-01-25  5:59 ` [PATCH 3/4] Convert axon_msi to an of_platform driver Michael Ellerman
2008-02-05  0:20   ` Benjamin Herrenschmidt
2008-01-25  5:59 ` [PATCH 4/4] Avoid DMA exception when using axon_msi with IOMMU Michael Ellerman
2008-02-05  0:21   ` Benjamin Herrenschmidt
2008-02-05  0:19 ` [PATCH 1/4] Search for and publish cell OF platform devices earlier Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2008-01-22 11:04 Michael Ellerman
2008-01-22 11:04 ` [PATCH 2/4] Create and hook up of_platform_device_shutdown Michael Ellerman
2008-01-22 14:34   ` Stephen Rothwell

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=1202170789.7079.26.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=davem@davemloft.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=m8@semihalf.com \
    --cc=michael@ellerman.id.au \
    --cc=sparclinux@vger.kernel.org \
    --cc=tnt@246tNt.com \
    /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).