linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] soc: imx: gpc: de-register power domains only if initialized
Date: Tue, 09 Jan 2018 16:25:17 +0100	[thread overview]
Message-ID: <1515511517.12538.38.camel@pengutronix.de> (raw)
In-Reply-To: <20180107134905.15624-1-stefan@agner.ch>

Am Sonntag, den 07.01.2018, 14:49 +0100 schrieb Stefan Agner:
> If power domain information are missing in the device tree, no
> power domains get initialized. However, imx_gpc_remove tries to
> remove power domains always in the old DT binding case. Only
> remove power domains when imx_gpc_probe initialized them in
> first place.
> 
> Fixes: 721cabf6c660 ("soc: imx: move PGC handling to a new GPC
> driver")
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
> ?drivers/soc/imx/gpc.c | 10 +++++++++-
> ?1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
> index 53f7275d6cbd..62bb724726d9 100644
> --- a/drivers/soc/imx/gpc.c
> +++ b/drivers/soc/imx/gpc.c
> @@ -470,13 +470,21 @@ static int imx_gpc_probe(struct platform_device
> *pdev)
> ?
> ?static int imx_gpc_remove(struct platform_device *pdev)
> ?{
> +	struct device_node *pgc_node;
> ?	int ret;
> ?
> +	pgc_node = of_get_child_by_name(pdev->dev.of_node, "pgc");
> +
> +	/* bail out if DT too old and doesn't provide the necessary
> info */
> +	if (!of_property_read_bool(pdev->dev.of_node, "#power-
> domain-cells") &&
> +	????!pgc_node)
> +		return 0;
> +
> ?	/*
> ?	?* If the old DT binding is used the toplevel driver needs
> to
> ?	?* de-register the power domains
> ?	?*/
> -	if (!of_get_child_by_name(pdev->dev.of_node, "pgc")) {
> +	if (!pgc_node) {
> ?		of_genpd_del_provider(pdev->dev.of_node);
> ?
> ?		ret =
> pm_genpd_remove(&imx_gpc_domains[GPC_PGC_DOMAIN_PU].base);

  parent reply	other threads:[~2018-01-09 15:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-07 13:49 [PATCH] soc: imx: gpc: de-register power domains only if initialized Stefan Agner
2018-01-08 10:28 ` Dong Aisheng
2018-01-08 10:51   ` Lucas Stach
2018-01-08 21:17     ` Stefan Agner
2018-01-09  9:28       ` Lucas Stach
2018-01-09 15:25 ` Lucas Stach [this message]
2018-02-10 15:46 ` Stefan Agner
2018-02-10 16:24 ` Fabio Estevam
2018-02-22  3:21 ` Shawn Guo

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=1515511517.12538.38.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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).