diff mbox

PM / Domains: Change prototype for the ->attach_dev() callback

Message ID 1414670569-3002-1-git-send-email-ulf.hansson@linaro.org (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Ulf Hansson Oct. 30, 2014, 12:02 p.m. UTC
Convert the prototype to return and int. This is just an initial step,
needed to support error handling.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

This patch is intended as fix for 3.18 rc[n]. Why?

There are other SOC specific patches around that adds genpd support and which
implements the ->attach_dev() callback. To prevent having an "atomic" patch
during the next release cycle, let's change the prototype now instead.

Further patches will add the actual error handling in genpd and these can then
be reviewed and tested thoroughly.

---
 include/linux/pm_domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Geert Uytterhoeven Oct. 30, 2014, 12:17 p.m. UTC | #1
On Thu, Oct 30, 2014 at 1:02 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Convert the prototype to return and int. This is just an initial step,
> needed to support error handling.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pavel Machek Oct. 30, 2014, 12:28 p.m. UTC | #2
On Thu 2014-10-30 13:02:49, Ulf Hansson wrote:
> Convert the prototype to return and int. This is just an initial step,
> needed to support error handling.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Pavel Machek <pavel@ucw.cz>


> ---
> 
> This patch is intended as fix for 3.18 rc[n]. Why?
> 
> There are other SOC specific patches around that adds genpd support and which
> implements the ->attach_dev() callback. To prevent having an "atomic" patch
> during the next release cycle, let's change the prototype now instead.
> 
> Further patches will add the actual error handling in genpd and these can then
> be reviewed and tested thoroughly.
> 
> ---
>  include/linux/pm_domain.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index 73e938b..d44f071 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -72,7 +72,7 @@ struct generic_pm_domain {
>  	bool max_off_time_changed;
>  	bool cached_power_down_ok;
>  	struct gpd_cpuidle_data *cpuidle_data;
> -	void (*attach_dev)(struct device *dev);
> +	int (*attach_dev)(struct device *dev);
>  	void (*detach_dev)(struct device *dev);
>  };
>
Rafael J. Wysocki Oct. 30, 2014, 8:04 p.m. UTC | #3
On Thursday, October 30, 2014 01:02:49 PM Ulf Hansson wrote:
> Convert the prototype to return and int. This is just an initial step,
> needed to support error handling.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> 
> This patch is intended as fix for 3.18 rc[n]. Why?
> 
> There are other SOC specific patches around that adds genpd support and which
> implements the ->attach_dev() callback. To prevent having an "atomic" patch
> during the next release cycle, let's change the prototype now instead.
> 
> Further patches will add the actual error handling in genpd and these can then
> be reviewed and tested thoroughly.

So we have no users of ->attach_dev at the moment, right?

> ---
>  include/linux/pm_domain.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
> index 73e938b..d44f071 100644
> --- a/include/linux/pm_domain.h
> +++ b/include/linux/pm_domain.h
> @@ -72,7 +72,7 @@ struct generic_pm_domain {
>  	bool max_off_time_changed;
>  	bool cached_power_down_ok;
>  	struct gpd_cpuidle_data *cpuidle_data;
> -	void (*attach_dev)(struct device *dev);
> +	int (*attach_dev)(struct device *dev);
>  	void (*detach_dev)(struct device *dev);
>  };
>  
>
Kevin Hilman Oct. 30, 2014, 8:38 p.m. UTC | #4
"Rafael J. Wysocki" <rjw@rjwysocki.net> writes:

> On Thursday, October 30, 2014 01:02:49 PM Ulf Hansson wrote:
>> Convert the prototype to return and int. This is just an initial step,
>> needed to support error handling.
>> 
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Kevin Hilman <khilman@linaro.org>

>> 
>> This patch is intended as fix for 3.18 rc[n]. Why?
>> 
>> There are other SOC specific patches around that adds genpd support and which
>> implements the ->attach_dev() callback. To prevent having an "atomic" patch
>> during the next release cycle, let's change the prototype now instead.
>> 
>> Further patches will add the actual error handling in genpd and these can then
>> be reviewed and tested thoroughly.
>
> So we have no users of ->attach_dev at the moment, right?

Not in mainline, but there are a couple getting ready to hit -next, so
we wanted to fix this before they arrive so that adding the error
handling will be easier.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov Nov. 5, 2014, 1:33 a.m. UTC | #5
On Thu, Oct 30, 2014 at 01:38:30PM -0700, Kevin Hilman wrote:
> "Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
> 
> > On Thursday, October 30, 2014 01:02:49 PM Ulf Hansson wrote:
> >> Convert the prototype to return and int. This is just an initial step,
> >> needed to support error handling.
> >> 
> >> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> 
> Acked-by: Kevin Hilman <khilman@linaro.org>
> 
> >> 
> >> This patch is intended as fix for 3.18 rc[n]. Why?
> >> 
> >> There are other SOC specific patches around that adds genpd support and which
> >> implements the ->attach_dev() callback. To prevent having an "atomic" patch
> >> during the next release cycle, let's change the prototype now instead.
> >> 
> >> Further patches will add the actual error handling in genpd and these can then
> >> be reviewed and tested thoroughly.
> >
> > So we have no users of ->attach_dev at the moment, right?
> 
> Not in mainline, but there are a couple getting ready to hit -next, so
> we wanted to fix this before they arrive so that adding the error
> handling will be easier.

BTW, while we are at it, can we also pass the domain itself to
attach_dev() and detach_dev()? If anything it helps with debugging (you
can print domain name from the callbacks).

Thanks.
Geert Uytterhoeven Nov. 5, 2014, 7:43 a.m. UTC | #6
On Wed, Nov 5, 2014 at 2:33 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Oct 30, 2014 at 01:38:30PM -0700, Kevin Hilman wrote:
>> "Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
>>
>> > On Thursday, October 30, 2014 01:02:49 PM Ulf Hansson wrote:
>> >> Convert the prototype to return and int. This is just an initial step,
>> >> needed to support error handling.
>> >>
>> >> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>>
>> Acked-by: Kevin Hilman <khilman@linaro.org>
>>
>> >>
>> >> This patch is intended as fix for 3.18 rc[n]. Why?
>> >>
>> >> There are other SOC specific patches around that adds genpd support and which
>> >> implements the ->attach_dev() callback. To prevent having an "atomic" patch
>> >> during the next release cycle, let's change the prototype now instead.
>> >>
>> >> Further patches will add the actual error handling in genpd and these can then
>> >> be reviewed and tested thoroughly.
>> >
>> > So we have no users of ->attach_dev at the moment, right?
>>
>> Not in mainline, but there are a couple getting ready to hit -next, so
>> we wanted to fix this before they arrive so that adding the error
>> handling will be easier.
>
> BTW, while we are at it, can we also pass the domain itself to
> attach_dev() and detach_dev()? If anything it helps with debugging (you
> can print domain name from the callbacks).

You can use dev->pm_domain, which is already set.

Note that this is no longer the case after Ulf's "[PATCH 3/4] PM / Domains:
Improve error handling while adding/removing devices"!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov Nov. 5, 2014, 7:54 a.m. UTC | #7
On Wed, Nov 05, 2014 at 08:43:29AM +0100, Geert Uytterhoeven wrote:
> On Wed, Nov 5, 2014 at 2:33 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Thu, Oct 30, 2014 at 01:38:30PM -0700, Kevin Hilman wrote:
> >> "Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
> >>
> >> > On Thursday, October 30, 2014 01:02:49 PM Ulf Hansson wrote:
> >> >> Convert the prototype to return and int. This is just an initial step,
> >> >> needed to support error handling.
> >> >>
> >> >> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> >>
> >> Acked-by: Kevin Hilman <khilman@linaro.org>
> >>
> >> >>
> >> >> This patch is intended as fix for 3.18 rc[n]. Why?
> >> >>
> >> >> There are other SOC specific patches around that adds genpd support and which
> >> >> implements the ->attach_dev() callback. To prevent having an "atomic" patch
> >> >> during the next release cycle, let's change the prototype now instead.
> >> >>
> >> >> Further patches will add the actual error handling in genpd and these can then
> >> >> be reviewed and tested thoroughly.
> >> >
> >> > So we have no users of ->attach_dev at the moment, right?
> >>
> >> Not in mainline, but there are a couple getting ready to hit -next, so
> >> we wanted to fix this before they arrive so that adding the error
> >> handling will be easier.
> >
> > BTW, while we are at it, can we also pass the domain itself to
> > attach_dev() and detach_dev()? If anything it helps with debugging (you
> > can print domain name from the callbacks).
> 
> You can use dev->pm_domain, which is already set.
> 
> Note that this is no longer the case after Ulf's "[PATCH 3/4] PM / Domains:
> Improve error handling while adding/removing devices"!

Right, but I'd rather not poke in dev structure directly if I can help
it.

Thanks.
diff mbox

Patch

diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 73e938b..d44f071 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -72,7 +72,7 @@  struct generic_pm_domain {
 	bool max_off_time_changed;
 	bool cached_power_down_ok;
 	struct gpd_cpuidle_data *cpuidle_data;
-	void (*attach_dev)(struct device *dev);
+	int (*attach_dev)(struct device *dev);
 	void (*detach_dev)(struct device *dev);
 };