All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data()
@ 2015-01-29 17:39 Ulf Hansson
  2015-01-29 17:39 ` [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function Ulf Hansson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ulf Hansson @ 2015-01-29 17:39 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: Kevin Hilman, Geert Uytterhoeven, Ulf Hansson

The commit "PM: Make dev_pm_get_subsys_data() always return 0 on success"
changed the return value from dev_pm_get_subsys_data(). Let's update the
comment in the function header to reflect this change as well.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index b0f1388..a1ee51d 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -19,8 +19,8 @@
  * @dev: Device to handle.
  *
  * If power.subsys_data is NULL, point it to a new object, otherwise increment
- * its reference counter.  Return 1 if a new object has been created, otherwise
- * return 0 or error code.
+ * its reference counter.  Return 0 if new object has been created or refcount
+ * increased, otherwise negative error code.
  */
 int dev_pm_get_subsys_data(struct device *dev)
 {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function
  2015-01-29 17:39 [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data() Ulf Hansson
@ 2015-01-29 17:39 ` Ulf Hansson
  2015-01-29 17:46   ` Geert Uytterhoeven
  2015-01-29 17:44 ` [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data() Geert Uytterhoeven
  2015-02-04 14:39 ` Rafael J. Wysocki
  2 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2015-01-29 17:39 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Pavel Machek, linux-pm
  Cc: Kevin Hilman, Geert Uytterhoeven, Ulf Hansson

Clients using the dev_pm_put_subsys_data() API isn't interested of a
return value. They care only of decreasing a reference to the device's
pm_subsys_data. So, let's convert the API to a void function, which
anyway seems like reasonable thing to do.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/base/power/common.c | 14 ++++----------
 include/linux/pm.h          |  2 +-
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
index a1ee51d..f32b802 100644
--- a/drivers/base/power/common.c
+++ b/drivers/base/power/common.c
@@ -56,13 +56,11 @@ EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data);
  * @dev: Device to handle.
  *
  * If the reference counter of power.subsys_data is zero after dropping the
- * reference, power.subsys_data is removed.  Return 1 if that happens or 0
- * otherwise.
+ * reference, power.subsys_data is removed.
  */
-int dev_pm_put_subsys_data(struct device *dev)
+void dev_pm_put_subsys_data(struct device *dev)
 {
 	struct pm_subsys_data *psd;
-	int ret = 1;
 
 	spin_lock_irq(&dev->power.lock);
 
@@ -70,18 +68,14 @@ int dev_pm_put_subsys_data(struct device *dev)
 	if (!psd)
 		goto out;
 
-	if (--psd->refcount == 0) {
+	if (--psd->refcount == 0)
 		dev->power.subsys_data = NULL;
-	} else {
+	else
 		psd = NULL;
-		ret = 0;
-	}
 
  out:
 	spin_unlock_irq(&dev->power.lock);
 	kfree(psd);
-
-	return ret;
 }
 EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data);
 
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 8b59763..e2f1be6 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -597,7 +597,7 @@ struct dev_pm_info {
 
 extern void update_pm_runtime_accounting(struct device *dev);
 extern int dev_pm_get_subsys_data(struct device *dev);
-extern int dev_pm_put_subsys_data(struct device *dev);
+extern void dev_pm_put_subsys_data(struct device *dev);
 
 /*
  * Power domains provide callbacks that are executed during system suspend,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data()
  2015-01-29 17:39 [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data() Ulf Hansson
  2015-01-29 17:39 ` [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function Ulf Hansson
@ 2015-01-29 17:44 ` Geert Uytterhoeven
  2015-02-04 14:39 ` Rafael J. Wysocki
  2 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2015-01-29 17:44 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Linux PM list,
	Kevin Hilman, Geert Uytterhoeven

On Thu, Jan 29, 2015 at 6:39 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> The commit "PM: Make dev_pm_get_subsys_data() always return 0 on success"
> changed the return value from dev_pm_get_subsys_data(). Let's update the
> comment in the function header to reflect this change as well.
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function
  2015-01-29 17:39 ` [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function Ulf Hansson
@ 2015-01-29 17:46   ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2015-01-29 17:46 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Linux PM list,
	Kevin Hilman, Geert Uytterhoeven

On Thu, Jan 29, 2015 at 6:39 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Clients using the dev_pm_put_subsys_data() API isn't interested of a
> return value. They care only of decreasing a reference to the device's
> pm_subsys_data. So, let's convert the API to a void function, which
> anyway seems like reasonable thing to do.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data()
  2015-01-29 17:39 [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data() Ulf Hansson
  2015-01-29 17:39 ` [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function Ulf Hansson
  2015-01-29 17:44 ` [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data() Geert Uytterhoeven
@ 2015-02-04 14:39 ` Rafael J. Wysocki
  2 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2015-02-04 14:39 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Len Brown, Pavel Machek, linux-pm, Kevin Hilman, Geert Uytterhoeven

On Thursday, January 29, 2015 06:39:04 PM Ulf Hansson wrote:
> The commit "PM: Make dev_pm_get_subsys_data() always return 0 on success"
> changed the return value from dev_pm_get_subsys_data(). Let's update the
> comment in the function header to reflect this change as well.
> 
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

[1-2/2] queued up for 3.20, thanks!

> ---
>  drivers/base/power/common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c
> index b0f1388..a1ee51d 100644
> --- a/drivers/base/power/common.c
> +++ b/drivers/base/power/common.c
> @@ -19,8 +19,8 @@
>   * @dev: Device to handle.
>   *
>   * If power.subsys_data is NULL, point it to a new object, otherwise increment
> - * its reference counter.  Return 1 if a new object has been created, otherwise
> - * return 0 or error code.
> + * its reference counter.  Return 0 if new object has been created or refcount
> + * increased, otherwise negative error code.
>   */
>  int dev_pm_get_subsys_data(struct device *dev)
>  {
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-04 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29 17:39 [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data() Ulf Hansson
2015-01-29 17:39 ` [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function Ulf Hansson
2015-01-29 17:46   ` Geert Uytterhoeven
2015-01-29 17:44 ` [PATCH 1/2] PM: Update function header for dev_pm_get_subsys_data() Geert Uytterhoeven
2015-02-04 14:39 ` Rafael J. Wysocki

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.