[PATCH] PM: ARM: locomo: Drop suspend and resume bus type callbacks

STALE3278d

5 messages, 4 authors, 2017-10-03 · open the first message on its own page

[PATCH] PM: ARM: locomo: Drop suspend and resume bus type callbacks

From: Rafael J. Wysocki <hidden>
Date: 2017-09-26 20:54:59

From: Rafael J. Wysocki <redacted>

None of the locomo drivers in the tree implements the suspend and
resume callbacks from struct locomo_driver, so drop them and drop
the corresponding callbacks from locomo_bus_type.

Signed-off-by: Rafael J. Wysocki <redacted>
---
 arch/arm/common/locomo.c               |   24 ------------------------
 arch/arm/include/asm/hardware/locomo.h |    2 --
 2 files changed, 26 deletions(-)

Index: linux-pm/arch/arm/include/asm/hardware/locomo.h
===================================================================
--- linux-pm.orig/arch/arm/include/asm/hardware/locomo.h
+++ linux-pm/arch/arm/include/asm/hardware/locomo.h
@@ -189,8 +189,6 @@ struct locomo_driver {
 	unsigned int		devid;
 	int (*probe)(struct locomo_dev *);
 	int (*remove)(struct locomo_dev *);
-	int (*suspend)(struct locomo_dev *, pm_message_t);
-	int (*resume)(struct locomo_dev *);
 };
 
 #define LOCOMO_DRV(_d)	container_of((_d), struct locomo_driver, drv)
Index: linux-pm/arch/arm/common/locomo.c
===================================================================
--- linux-pm.orig/arch/arm/common/locomo.c
+++ linux-pm/arch/arm/common/locomo.c
@@ -826,28 +826,6 @@ static int locomo_match(struct device *_
 	return dev->devid == drv->devid;
 }
 
-static int locomo_bus_suspend(struct device *dev, pm_message_t state)
-{
-	struct locomo_dev *ldev = LOCOMO_DEV(dev);
-	struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
-	int ret = 0;
-
-	if (drv && drv->suspend)
-		ret = drv->suspend(ldev, state);
-	return ret;
-}
-
-static int locomo_bus_resume(struct device *dev)
-{
-	struct locomo_dev *ldev = LOCOMO_DEV(dev);
-	struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
-	int ret = 0;
-
-	if (drv && drv->resume)
-		ret = drv->resume(ldev);
-	return ret;
-}
-
 static int locomo_bus_probe(struct device *dev)
 {
 	struct locomo_dev *ldev = LOCOMO_DEV(dev);
@@ -875,8 +853,6 @@ struct bus_type locomo_bus_type = {
 	.match		= locomo_match,
 	.probe		= locomo_bus_probe,
 	.remove		= locomo_bus_remove,
-	.suspend	= locomo_bus_suspend,
-	.resume		= locomo_bus_resume,
 };
 
 int locomo_driver_register(struct locomo_driver *driver)

Re: [PATCH] PM: ARM: locomo: Drop suspend and resume bus type callbacks

From: "Rafael J. Wysocki" <rafael@kernel.org>
Date: 2017-10-03 00:43:27

Hi,

On Tue, Sep 26, 2017 at 10:45 PM, Rafael J. Wysocki [off-list ref] wrote:
From: Rafael J. Wysocki <redacted>

None of the locomo drivers in the tree implements the suspend and
resume callbacks from struct locomo_driver, so drop them and drop
the corresponding callbacks from locomo_bus_type.

Signed-off-by: Rafael J. Wysocki <redacted>
Any concerns here?

If not, I'd like to queue this up for 4.15.
quoted hunk
---
 arch/arm/common/locomo.c               |   24 ------------------------
 arch/arm/include/asm/hardware/locomo.h |    2 --
 2 files changed, 26 deletions(-)

Index: linux-pm/arch/arm/include/asm/hardware/locomo.h
===================================================================
--- linux-pm.orig/arch/arm/include/asm/hardware/locomo.h
+++ linux-pm/arch/arm/include/asm/hardware/locomo.h
@@ -189,8 +189,6 @@ struct locomo_driver {
        unsigned int            devid;
        int (*probe)(struct locomo_dev *);
        int (*remove)(struct locomo_dev *);
-       int (*suspend)(struct locomo_dev *, pm_message_t);
-       int (*resume)(struct locomo_dev *);
 };

 #define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
Index: linux-pm/arch/arm/common/locomo.c
===================================================================
--- linux-pm.orig/arch/arm/common/locomo.c
+++ linux-pm/arch/arm/common/locomo.c
@@ -826,28 +826,6 @@ static int locomo_match(struct device *_
        return dev->devid == drv->devid;
 }

-static int locomo_bus_suspend(struct device *dev, pm_message_t state)
-{
-       struct locomo_dev *ldev = LOCOMO_DEV(dev);
-       struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
-       int ret = 0;
-
-       if (drv && drv->suspend)
-               ret = drv->suspend(ldev, state);
-       return ret;
-}
-
-static int locomo_bus_resume(struct device *dev)
-{
-       struct locomo_dev *ldev = LOCOMO_DEV(dev);
-       struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
-       int ret = 0;
-
-       if (drv && drv->resume)
-               ret = drv->resume(ldev);
-       return ret;
-}
-
 static int locomo_bus_probe(struct device *dev)
 {
        struct locomo_dev *ldev = LOCOMO_DEV(dev);
@@ -875,8 +853,6 @@ struct bus_type locomo_bus_type = {
        .match          = locomo_match,
        .probe          = locomo_bus_probe,
        .remove         = locomo_bus_remove,
-       .suspend        = locomo_bus_suspend,
-       .resume         = locomo_bus_resume,
 };

 int locomo_driver_register(struct locomo_driver *driver)

Re: [PATCH] PM: ARM: locomo: Drop suspend and resume bus type callbacks

From: Ulf Hansson <hidden>
Date: 2017-10-03 08:09:25

On 26 September 2017 at 22:45, Rafael J. Wysocki [off-list ref] wrote:
From: Rafael J. Wysocki <redacted>

None of the locomo drivers in the tree implements the suspend and
resume callbacks from struct locomo_driver, so drop them and drop
the corresponding callbacks from locomo_bus_type.

Signed-off-by: Rafael J. Wysocki <redacted>
FWIW:

Reviewed-by: Ulf Hansson <redacted>

Do you also plan to convert the locomo_device_driver (platform_driver)
to be converted to the modern PM callbacks for suspend/resume?

Kind regards
Uffe
quoted hunk
---
 arch/arm/common/locomo.c               |   24 ------------------------
 arch/arm/include/asm/hardware/locomo.h |    2 --
 2 files changed, 26 deletions(-)

Index: linux-pm/arch/arm/include/asm/hardware/locomo.h
===================================================================
--- linux-pm.orig/arch/arm/include/asm/hardware/locomo.h
+++ linux-pm/arch/arm/include/asm/hardware/locomo.h
@@ -189,8 +189,6 @@ struct locomo_driver {
        unsigned int            devid;
        int (*probe)(struct locomo_dev *);
        int (*remove)(struct locomo_dev *);
-       int (*suspend)(struct locomo_dev *, pm_message_t);
-       int (*resume)(struct locomo_dev *);
 };

 #define LOCOMO_DRV(_d) container_of((_d), struct locomo_driver, drv)
Index: linux-pm/arch/arm/common/locomo.c
===================================================================
--- linux-pm.orig/arch/arm/common/locomo.c
+++ linux-pm/arch/arm/common/locomo.c
@@ -826,28 +826,6 @@ static int locomo_match(struct device *_
        return dev->devid == drv->devid;
 }

-static int locomo_bus_suspend(struct device *dev, pm_message_t state)
-{
-       struct locomo_dev *ldev = LOCOMO_DEV(dev);
-       struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
-       int ret = 0;
-
-       if (drv && drv->suspend)
-               ret = drv->suspend(ldev, state);
-       return ret;
-}
-
-static int locomo_bus_resume(struct device *dev)
-{
-       struct locomo_dev *ldev = LOCOMO_DEV(dev);
-       struct locomo_driver *drv = LOCOMO_DRV(dev->driver);
-       int ret = 0;
-
-       if (drv && drv->resume)
-               ret = drv->resume(ldev);
-       return ret;
-}
-
 static int locomo_bus_probe(struct device *dev)
 {
        struct locomo_dev *ldev = LOCOMO_DEV(dev);
@@ -875,8 +853,6 @@ struct bus_type locomo_bus_type = {
        .match          = locomo_match,
        .probe          = locomo_bus_probe,
        .remove         = locomo_bus_remove,
-       .suspend        = locomo_bus_suspend,
-       .resume         = locomo_bus_resume,
 };

 int locomo_driver_register(struct locomo_driver *driver)

Re: [PATCH] PM: ARM: locomo: Drop suspend and resume bus type callbacks

From: Rafael J. Wysocki <hidden>
Date: 2017-10-03 11:54:10

On Tuesday, October 3, 2017 10:09:21 AM CEST Ulf Hansson wrote:
On 26 September 2017 at 22:45, Rafael J. Wysocki [off-list ref] wrote:
quoted
From: Rafael J. Wysocki <redacted>

None of the locomo drivers in the tree implements the suspend and
resume callbacks from struct locomo_driver, so drop them and drop
the corresponding callbacks from locomo_bus_type.

Signed-off-by: Rafael J. Wysocki <redacted>
FWIW:

Reviewed-by: Ulf Hansson <redacted>

Do you also plan to convert the locomo_device_driver (platform_driver)
to be converted to the modern PM callbacks for suspend/resume?
Yes, I do, but that later. :-)

Thanks,
Rafael

Re: [PATCH] PM: ARM: locomo: Drop suspend and resume bus type callbacks

From: Andrea Adami <hidden>
Date: 2017-10-03 14:55:08

On Tue, Oct 3, 2017 at 1:44 PM, Rafael J. Wysocki [off-list ref] wrote:
On Tuesday, October 3, 2017 10:09:21 AM CEST Ulf Hansson wrote:
quoted
On 26 September 2017 at 22:45, Rafael J. Wysocki [off-list ref] wrote:
quoted
From: Rafael J. Wysocki <redacted>

None of the locomo drivers in the tree implements the suspend and
resume callbacks from struct locomo_driver, so drop them and drop
the corresponding callbacks from locomo_bus_type.

Signed-off-by: Rafael J. Wysocki <redacted>
FWIW:

Reviewed-by: Ulf Hansson <redacted>

Do you also plan to convert the locomo_device_driver (platform_driver)
to be converted to the modern PM callbacks for suspend/resume?
Yes, I do, but that later. :-)

Thanks,
Rafael


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Thanks for working on this.

Just FYI,
there is a patch-serie for 4.2/locomo ported up to 4.4: never went
mainline unfortunately.

http://git.infradead.org/users/dbaryshkov/zaurus.git

I have just adapted the patches form 4.2 to 4.4 [1] and tested on real hw.
Unfortunately it is not trivial updating it (must be adapted to GPIO
descriptors, etc.).

As far as I see in the new driver there isn't anymore the use of the
bus, so your patch shouldn't harm.
I'll put Dmitry in cc to get his confirmation.

Regards
Andrea

[1] http://cgit.openembedded.org/meta-handheld/tree/recipes-kernel/linux/linux-handheld-4.4/locomo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help