* [PATCH] PM: Add pm_ops_ptr() macro
@ 2013-04-30 1:09 ` Jingoo Han
0 siblings, 0 replies; 16+ messages in thread
From: Jingoo Han @ 2013-04-30 1:09 UTC (permalink / raw)
To: 'Rafael J. Wysocki'
Cc: linux-pm, 'Len Brown', 'Pavel Machek',
'Andrew Morton',
linux-kernel, Wolfram Sang, linux-i2c, Jingoo Han
Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
to be assigned without having an #define xxx NULL for the case that PM is
not enabled.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/i2c/busses/i2c-s3c2410.c | 8 +-------
include/linux/pm.h | 2 ++
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 6e8ee92..e7b6639 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
}
#endif
-#ifdef CONFIG_PM
static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
#ifdef CONFIG_PM_SLEEP
.suspend_noirq = s3c24xx_i2c_suspend_noirq,
@@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
#endif
};
-#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
-#else
-#define S3C24XX_DEV_PM_OPS NULL
-#endif
-
/* device driver for platform bus bits */
static struct platform_driver s3c24xx_i2c_driver = {
@@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "s3c-i2c",
- .pm = S3C24XX_DEV_PM_OPS,
+ .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
.of_match_table = of_match_ptr(s3c24xx_i2c_match),
},
};
diff --git a/include/linux/pm.h b/include/linux/pm.h
index a224c7f..bd50d15 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -55,8 +55,10 @@ struct device;
#ifdef CONFIG_PM
extern const char power_group_name[]; /* = "power" */
+#define pm_ops_ptr(_ptr) (_ptr)
#else
#define power_group_name NULL
+#define pm_ops_ptr(_ptr) NULL
#endif
typedef struct pm_message {
--
1.7.2.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH] PM: Add pm_ops_ptr() macro
@ 2013-04-30 1:09 ` Jingoo Han
0 siblings, 0 replies; 16+ messages in thread
From: Jingoo Han @ 2013-04-30 1:09 UTC (permalink / raw)
To: 'Rafael J. Wysocki'
Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA, 'Len Brown',
'Pavel Machek', 'Andrew Morton',
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang,
linux-i2c-u79uwXL29TY76Z2rM5mHXA, Jingoo Han
Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
to be assigned without having an #define xxx NULL for the case that PM is
not enabled.
Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
drivers/i2c/busses/i2c-s3c2410.c | 8 +-------
include/linux/pm.h | 2 ++
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 6e8ee92..e7b6639 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
}
#endif
-#ifdef CONFIG_PM
static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
#ifdef CONFIG_PM_SLEEP
.suspend_noirq = s3c24xx_i2c_suspend_noirq,
@@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
#endif
};
-#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
-#else
-#define S3C24XX_DEV_PM_OPS NULL
-#endif
-
/* device driver for platform bus bits */
static struct platform_driver s3c24xx_i2c_driver = {
@@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "s3c-i2c",
- .pm = S3C24XX_DEV_PM_OPS,
+ .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
.of_match_table = of_match_ptr(s3c24xx_i2c_match),
},
};
diff --git a/include/linux/pm.h b/include/linux/pm.h
index a224c7f..bd50d15 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -55,8 +55,10 @@ struct device;
#ifdef CONFIG_PM
extern const char power_group_name[]; /* = "power" */
+#define pm_ops_ptr(_ptr) (_ptr)
#else
#define power_group_name NULL
+#define pm_ops_ptr(_ptr) NULL
#endif
typedef struct pm_message {
--
1.7.2.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-04-30 1:09 ` Jingoo Han
@ 2013-05-02 21:18 ` Rafael J. Wysocki
-1 siblings, 0 replies; 16+ messages in thread
From: Rafael J. Wysocki @ 2013-05-02 21:18 UTC (permalink / raw)
To: Jingoo Han
Cc: linux-pm, 'Len Brown', 'Pavel Machek',
'Andrew Morton',
linux-kernel, Wolfram Sang, linux-i2c
On Tuesday, April 30, 2013 10:09:22 AM Jingoo Han wrote:
> Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> to be assigned without having an #define xxx NULL for the case that PM is
> not enabled.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
I've queued this up as v3.11 material.
Thanks,
Rafael
> ---
> drivers/i2c/busses/i2c-s3c2410.c | 8 +-------
> include/linux/pm.h | 2 ++
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index 6e8ee92..e7b6639 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> }
> #endif
>
> -#ifdef CONFIG_PM
> static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #ifdef CONFIG_PM_SLEEP
> .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #endif
> };
>
> -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> -#else
> -#define S3C24XX_DEV_PM_OPS NULL
> -#endif
> -
> /* device driver for platform bus bits */
>
> static struct platform_driver s3c24xx_i2c_driver = {
> @@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
> .driver = {
> .owner = THIS_MODULE,
> .name = "s3c-i2c",
> - .pm = S3C24XX_DEV_PM_OPS,
> + .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
> .of_match_table = of_match_ptr(s3c24xx_i2c_match),
> },
> };
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index a224c7f..bd50d15 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -55,8 +55,10 @@ struct device;
>
> #ifdef CONFIG_PM
> extern const char power_group_name[]; /* = "power" */
> +#define pm_ops_ptr(_ptr) (_ptr)
> #else
> #define power_group_name NULL
> +#define pm_ops_ptr(_ptr) NULL
> #endif
>
> typedef struct pm_message {
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
@ 2013-05-02 21:18 ` Rafael J. Wysocki
0 siblings, 0 replies; 16+ messages in thread
From: Rafael J. Wysocki @ 2013-05-02 21:18 UTC (permalink / raw)
To: Jingoo Han
Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA, 'Len Brown',
'Pavel Machek', 'Andrew Morton',
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Tuesday, April 30, 2013 10:09:22 AM Jingoo Han wrote:
> Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> to be assigned without having an #define xxx NULL for the case that PM is
> not enabled.
>
> Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
I've queued this up as v3.11 material.
Thanks,
Rafael
> ---
> drivers/i2c/busses/i2c-s3c2410.c | 8 +-------
> include/linux/pm.h | 2 ++
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
> index 6e8ee92..e7b6639 100644
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> }
> #endif
>
> -#ifdef CONFIG_PM
> static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #ifdef CONFIG_PM_SLEEP
> .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #endif
> };
>
> -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> -#else
> -#define S3C24XX_DEV_PM_OPS NULL
> -#endif
> -
> /* device driver for platform bus bits */
>
> static struct platform_driver s3c24xx_i2c_driver = {
> @@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
> .driver = {
> .owner = THIS_MODULE,
> .name = "s3c-i2c",
> - .pm = S3C24XX_DEV_PM_OPS,
> + .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
> .of_match_table = of_match_ptr(s3c24xx_i2c_match),
> },
> };
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index a224c7f..bd50d15 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -55,8 +55,10 @@ struct device;
>
> #ifdef CONFIG_PM
> extern const char power_group_name[]; /* = "power" */
> +#define pm_ops_ptr(_ptr) (_ptr)
> #else
> #define power_group_name NULL
> +#define pm_ops_ptr(_ptr) NULL
> #endif
>
> typedef struct pm_message {
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-05-02 21:18 ` Rafael J. Wysocki
(?)
@ 2013-05-03 9:23 ` Pavel Machek
2013-05-30 10:56 ` Wolfram Sang
-1 siblings, 1 reply; 16+ messages in thread
From: Pavel Machek @ 2013-05-03 9:23 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Jingoo Han, linux-pm, 'Len Brown',
'Andrew Morton',
linux-kernel, Wolfram Sang, linux-i2c
Hi!
> > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > to be assigned without having an #define xxx NULL for the case that PM is
> > not enabled.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>
> I've queued this up as v3.11 material.
> > --- a/drivers/i2c/busses/i2c-s3c2410.c
> > +++ b/drivers/i2c/busses/i2c-s3c2410.c
> > @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> > }
> > #endif
> >
> > -#ifdef CONFIG_PM
> > static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > #ifdef CONFIG_PM_SLEEP
> > .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> > @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > #endif
> > };
> >
> > -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> > -#else
> > -#define S3C24XX_DEV_PM_OPS NULL
> > -#endif
> > -
> > /* device driver for platform bus bits */
Will not this enlarge .data by sizeof(struct dev_pm_ops)?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
@ 2013-05-30 10:56 ` Wolfram Sang
0 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2013-05-30 10:56 UTC (permalink / raw)
To: Pavel Machek
Cc: Rafael J. Wysocki, Jingoo Han, linux-pm, 'Len Brown',
'Andrew Morton',
linux-kernel, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]
On Fri, May 03, 2013 at 11:23:11AM +0200, Pavel Machek wrote:
> Hi!
>
> > > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > > to be assigned without having an #define xxx NULL for the case that PM is
> > > not enabled.
> > >
> > > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> >
> > I've queued this up as v3.11 material.
>
> > > --- a/drivers/i2c/busses/i2c-s3c2410.c
> > > +++ b/drivers/i2c/busses/i2c-s3c2410.c
> > > @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> > > }
> > > #endif
> > >
> > > -#ifdef CONFIG_PM
> > > static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > #ifdef CONFIG_PM_SLEEP
> > > .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> > > @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > #endif
> > > };
> > >
> > > -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> > > -#else
> > > -#define S3C24XX_DEV_PM_OPS NULL
> > > -#endif
> > > -
> > > /* device driver for platform bus bits */
>
> Will not this enlarge .data by sizeof(struct dev_pm_ops)?
Same question here. Is it the preferred way now to use this new macro
although having the cost of having an empty dev_pm_ops?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
@ 2013-05-30 10:56 ` Wolfram Sang
0 siblings, 0 replies; 16+ messages in thread
From: Wolfram Sang @ 2013-05-30 10:56 UTC (permalink / raw)
To: Pavel Machek
Cc: Rafael J. Wysocki, Jingoo Han, linux-pm-u79uwXL29TY76Z2rM5mHXA,
'Len Brown', 'Andrew Morton',
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]
On Fri, May 03, 2013 at 11:23:11AM +0200, Pavel Machek wrote:
> Hi!
>
> > > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > > to be assigned without having an #define xxx NULL for the case that PM is
> > > not enabled.
> > >
> > > Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> >
> > I've queued this up as v3.11 material.
>
> > > --- a/drivers/i2c/busses/i2c-s3c2410.c
> > > +++ b/drivers/i2c/busses/i2c-s3c2410.c
> > > @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> > > }
> > > #endif
> > >
> > > -#ifdef CONFIG_PM
> > > static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > #ifdef CONFIG_PM_SLEEP
> > > .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> > > @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > #endif
> > > };
> > >
> > > -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> > > -#else
> > > -#define S3C24XX_DEV_PM_OPS NULL
> > > -#endif
> > > -
> > > /* device driver for platform bus bits */
>
> Will not this enlarge .data by sizeof(struct dev_pm_ops)?
Same question here. Is it the preferred way now to use this new macro
although having the cost of having an empty dev_pm_ops?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-05-30 10:56 ` Wolfram Sang
@ 2013-05-30 13:54 ` Rafael J. Wysocki
-1 siblings, 0 replies; 16+ messages in thread
From: Rafael J. Wysocki @ 2013-05-30 13:54 UTC (permalink / raw)
To: Wolfram Sang
Cc: Pavel Machek, Jingoo Han, linux-pm, 'Len Brown',
'Andrew Morton',
linux-kernel, linux-i2c
On Thursday, May 30, 2013 12:56:45 PM Wolfram Sang wrote:
> On Fri, May 03, 2013 at 11:23:11AM +0200, Pavel Machek wrote:
> > Hi!
> >
> > > > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > > > to be assigned without having an #define xxx NULL for the case that PM is
> > > > not enabled.
> > > >
> > > > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > >
> > > I've queued this up as v3.11 material.
> >
> > > > --- a/drivers/i2c/busses/i2c-s3c2410.c
> > > > +++ b/drivers/i2c/busses/i2c-s3c2410.c
> > > > @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> > > > }
> > > > #endif
> > > >
> > > > -#ifdef CONFIG_PM
> > > > static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > > #ifdef CONFIG_PM_SLEEP
> > > > .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> > > > @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > > #endif
> > > > };
> > > >
> > > > -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> > > > -#else
> > > > -#define S3C24XX_DEV_PM_OPS NULL
> > > > -#endif
> > > > -
> > > > /* device driver for platform bus bits */
> >
> > Will not this enlarge .data by sizeof(struct dev_pm_ops)?
>
> Same question here. Is it the preferred way now to use this new macro
> although having the cost of having an empty dev_pm_ops?
No, it isn't, but if someone wants to use it, I don't really care that much.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
@ 2013-05-30 13:54 ` Rafael J. Wysocki
0 siblings, 0 replies; 16+ messages in thread
From: Rafael J. Wysocki @ 2013-05-30 13:54 UTC (permalink / raw)
To: Wolfram Sang
Cc: Pavel Machek, Jingoo Han, linux-pm-u79uwXL29TY76Z2rM5mHXA,
'Len Brown', 'Andrew Morton',
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA
On Thursday, May 30, 2013 12:56:45 PM Wolfram Sang wrote:
> On Fri, May 03, 2013 at 11:23:11AM +0200, Pavel Machek wrote:
> > Hi!
> >
> > > > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > > > to be assigned without having an #define xxx NULL for the case that PM is
> > > > not enabled.
> > > >
> > > > Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > >
> > > I've queued this up as v3.11 material.
> >
> > > > --- a/drivers/i2c/busses/i2c-s3c2410.c
> > > > +++ b/drivers/i2c/busses/i2c-s3c2410.c
> > > > @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> > > > }
> > > > #endif
> > > >
> > > > -#ifdef CONFIG_PM
> > > > static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > > #ifdef CONFIG_PM_SLEEP
> > > > .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> > > > @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > > > #endif
> > > > };
> > > >
> > > > -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> > > > -#else
> > > > -#define S3C24XX_DEV_PM_OPS NULL
> > > > -#endif
> > > > -
> > > > /* device driver for platform bus bits */
> >
> > Will not this enlarge .data by sizeof(struct dev_pm_ops)?
>
> Same question here. Is it the preferred way now to use this new macro
> although having the cost of having an empty dev_pm_ops?
No, it isn't, but if someone wants to use it, I don't really care that much.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-04-29 12:12 ` Lars-Peter Clausen
@ 2013-04-30 0:54 ` Jingoo Han
0 siblings, 0 replies; 16+ messages in thread
From: Jingoo Han @ 2013-04-30 0:54 UTC (permalink / raw)
To: 'Lars-Peter Clausen'
Cc: 'Rafael J. Wysocki', 'Andrew Morton',
linux-kernel, 'Len Brown', 'Pavel Machek',
linux-pm, Jingoo Han
On Monday, April 29, 2013 9:13 PM, Lars-Peter Clausen wrote:
> On 04/29/2013 07:41 AM, Jingoo Han wrote:
> > On Saturday, April 27, 2013 11:41 PM, Rafael J. Wysocki:
> >>
> >> On Saturday, April 27, 2013 11:54:50 AM Jingoo Han wrote:
> >>> Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> >>> to be assigned without having an #define xxx NULL for the case that PM is
> >>> not enabled.
> >>>
> >>> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> >>
> >> First, I'm not taking any more PM patches for v3.10 (that don't fix recent
> >> regressions).
> >>
> >> Second, please add that macro along with a user.
> >
> > Hi Rafael,
> >
> > This macro can be used as below:
> > This macro cannot affect the procedure of suspend/resume
> > calls; thus, there is no side effect.
> > It just reduces the code size of each drivers.
> > In this way, of_match_ptr() macro has been already used.
> >
> >
> > --- a/drivers/i2c/busses/i2c-s3c2410.c
> > +++ b/drivers/i2c/busses/i2c-s3c2410.c
> > @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> > }
> > #endif
> >
> > -#ifdef CONFIG_PM
> > static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > #ifdef CONFIG_PM_SLEEP
> > .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> > @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > #endif
> > };
> >
> > -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> > -#else
> > -#define S3C24XX_DEV_PM_OPS NULL
> > -#endif
> > -
> > /* device driver for platform bus bits */
> >
> > static struct platform_driver s3c24xx_i2c_driver = {
> > @@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
> > .driver = {
> > .owner = THIS_MODULE,
> > .name = "s3c-i2c",
> > - .pm = S3C24XX_DEV_PM_OPS,
> > + .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
> > .of_match_table = of_match_ptr(s3c24xx_i2c_match),
> > },
> > };
>
> Won't that generate a warning about an unused s3c24xx_i2c_dev_pm_ops when
> CONFIG_PM is not enabled?
No, there is no build warning, when CONFIG_PM is not enabled.
In this way, of_match_ptr() macro has been already used
without build warnings.
Best regards,
Jingoo Han
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-04-29 11:35 ` Rafael J. Wysocki
@ 2013-04-30 0:21 ` Jingoo Han
0 siblings, 0 replies; 16+ messages in thread
From: Jingoo Han @ 2013-04-30 0:21 UTC (permalink / raw)
To: 'Rafael J. Wysocki'
Cc: 'Andrew Morton', linux-kernel, 'Len Brown',
'Pavel Machek',
linux-pm, Jingoo Han
On Monday, April 29, 2013 8:35 PM, Rafael J. Wysocki:
> On Monday, April 29, 2013 02:41:48 PM Jingoo Han wrote:
> > On Saturday, April 27, 2013 11:41 PM, Rafael J. Wysocki:
> > >
> > > On Saturday, April 27, 2013 11:54:50 AM Jingoo Han wrote:
> > > > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > > > to be assigned without having an #define xxx NULL for the case that PM is
> > > > not enabled.
> > > >
> > > > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> > >
> > > First, I'm not taking any more PM patches for v3.10 (that don't fix recent
> > > regressions).
> > >
> > > Second, please add that macro along with a user.
> >
> > Hi Rafael,
> >
> > This macro can be used as below:
> > This macro cannot affect the procedure of suspend/resume
> > calls; thus, there is no side effect.
> > It just reduces the code size of each drivers.
> > In this way, of_match_ptr() macro has been already used.
>
> OK, so care to fold the below into your original patch?
OK, I will fold it into my original patch.
Then, I will send v2 patch, soon.
Thank you.
Best regards,
Jingoo Han
>
> Rafael
>
>
> > --- a/drivers/i2c/busses/i2c-s3c2410.c
> > +++ b/drivers/i2c/busses/i2c-s3c2410.c
> > @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> > }
> > #endif
> >
> > -#ifdef CONFIG_PM
> > static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > #ifdef CONFIG_PM_SLEEP
> > .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> > @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> > #endif
> > };
> >
> > -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> > -#else
> > -#define S3C24XX_DEV_PM_OPS NULL
> > -#endif
> > -
> > /* device driver for platform bus bits */
> >
> > static struct platform_driver s3c24xx_i2c_driver = {
> > @@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
> > .driver = {
> > .owner = THIS_MODULE,
> > .name = "s3c-i2c",
> > - .pm = S3C24XX_DEV_PM_OPS,
> > + .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
> > .of_match_table = of_match_ptr(s3c24xx_i2c_match),
> > },
> > };
> >
> > Best regards,
> > Jingoo Han
> >
> >
> > >
> > > Thanks,
> > > Rafael
> > >
> > >
> > > > ---
> > > > include/linux/pm.h | 2 ++
> > > > 1 files changed, 2 insertions(+), 0 deletions(-)
> > > >
> > > > diff --git a/include/linux/pm.h b/include/linux/pm.h
> > > > index a224c7f..bd50d15 100644
> > > > --- a/include/linux/pm.h
> > > > +++ b/include/linux/pm.h
> > > > @@ -55,8 +55,10 @@ struct device;
> > > >
> > > > #ifdef CONFIG_PM
> > > > extern const char power_group_name[]; /* = "power" */
> > > > +#define pm_ops_ptr(_ptr) (_ptr)
> > > > #else
> > > > #define power_group_name NULL
> > > > +#define pm_ops_ptr(_ptr) NULL
> > > > #endif
> > > >
> > > > typedef struct pm_message {
> > > >
> > > --
> > > I speak only for myself.
> > > Rafael J. Wysocki, Intel Open Source Technology Center.
> >
> > --
> > 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
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-04-29 5:41 ` Jingoo Han
2013-04-29 11:35 ` Rafael J. Wysocki
@ 2013-04-29 12:12 ` Lars-Peter Clausen
2013-04-30 0:54 ` Jingoo Han
1 sibling, 1 reply; 16+ messages in thread
From: Lars-Peter Clausen @ 2013-04-29 12:12 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Rafael J. Wysocki', 'Andrew Morton',
linux-kernel, 'Len Brown', 'Pavel Machek',
linux-pm
On 04/29/2013 07:41 AM, Jingoo Han wrote:
> On Saturday, April 27, 2013 11:41 PM, Rafael J. Wysocki:
>>
>> On Saturday, April 27, 2013 11:54:50 AM Jingoo Han wrote:
>>> Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
>>> to be assigned without having an #define xxx NULL for the case that PM is
>>> not enabled.
>>>
>>> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>>
>> First, I'm not taking any more PM patches for v3.10 (that don't fix recent
>> regressions).
>>
>> Second, please add that macro along with a user.
>
> Hi Rafael,
>
> This macro can be used as below:
> This macro cannot affect the procedure of suspend/resume
> calls; thus, there is no side effect.
> It just reduces the code size of each drivers.
> In this way, of_match_ptr() macro has been already used.
>
>
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> }
> #endif
>
> -#ifdef CONFIG_PM
> static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #ifdef CONFIG_PM_SLEEP
> .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #endif
> };
>
> -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> -#else
> -#define S3C24XX_DEV_PM_OPS NULL
> -#endif
> -
> /* device driver for platform bus bits */
>
> static struct platform_driver s3c24xx_i2c_driver = {
> @@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
> .driver = {
> .owner = THIS_MODULE,
> .name = "s3c-i2c",
> - .pm = S3C24XX_DEV_PM_OPS,
> + .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
> .of_match_table = of_match_ptr(s3c24xx_i2c_match),
> },
> };
Won't that generate a warning about an unused s3c24xx_i2c_dev_pm_ops when
CONFIG_PM is not enabled?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-04-29 5:41 ` Jingoo Han
@ 2013-04-29 11:35 ` Rafael J. Wysocki
2013-04-30 0:21 ` Jingoo Han
2013-04-29 12:12 ` Lars-Peter Clausen
1 sibling, 1 reply; 16+ messages in thread
From: Rafael J. Wysocki @ 2013-04-29 11:35 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Andrew Morton', linux-kernel, 'Len Brown',
'Pavel Machek',
linux-pm
On Monday, April 29, 2013 02:41:48 PM Jingoo Han wrote:
> On Saturday, April 27, 2013 11:41 PM, Rafael J. Wysocki:
> >
> > On Saturday, April 27, 2013 11:54:50 AM Jingoo Han wrote:
> > > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > > to be assigned without having an #define xxx NULL for the case that PM is
> > > not enabled.
> > >
> > > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> >
> > First, I'm not taking any more PM patches for v3.10 (that don't fix recent
> > regressions).
> >
> > Second, please add that macro along with a user.
>
> Hi Rafael,
>
> This macro can be used as below:
> This macro cannot affect the procedure of suspend/resume
> calls; thus, there is no side effect.
> It just reduces the code size of each drivers.
> In this way, of_match_ptr() macro has been already used.
OK, so care to fold the below into your original patch?
Rafael
> --- a/drivers/i2c/busses/i2c-s3c2410.c
> +++ b/drivers/i2c/busses/i2c-s3c2410.c
> @@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
> }
> #endif
>
> -#ifdef CONFIG_PM
> static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #ifdef CONFIG_PM_SLEEP
> .suspend_noirq = s3c24xx_i2c_suspend_noirq,
> @@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
> #endif
> };
>
> -#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
> -#else
> -#define S3C24XX_DEV_PM_OPS NULL
> -#endif
> -
> /* device driver for platform bus bits */
>
> static struct platform_driver s3c24xx_i2c_driver = {
> @@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
> .driver = {
> .owner = THIS_MODULE,
> .name = "s3c-i2c",
> - .pm = S3C24XX_DEV_PM_OPS,
> + .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
> .of_match_table = of_match_ptr(s3c24xx_i2c_match),
> },
> };
>
> Best regards,
> Jingoo Han
>
>
> >
> > Thanks,
> > Rafael
> >
> >
> > > ---
> > > include/linux/pm.h | 2 ++
> > > 1 files changed, 2 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/include/linux/pm.h b/include/linux/pm.h
> > > index a224c7f..bd50d15 100644
> > > --- a/include/linux/pm.h
> > > +++ b/include/linux/pm.h
> > > @@ -55,8 +55,10 @@ struct device;
> > >
> > > #ifdef CONFIG_PM
> > > extern const char power_group_name[]; /* = "power" */
> > > +#define pm_ops_ptr(_ptr) (_ptr)
> > > #else
> > > #define power_group_name NULL
> > > +#define pm_ops_ptr(_ptr) NULL
> > > #endif
> > >
> > > typedef struct pm_message {
> > >
> > --
> > I speak only for myself.
> > Rafael J. Wysocki, Intel Open Source Technology Center.
>
> --
> 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
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-04-27 14:40 ` Rafael J. Wysocki
@ 2013-04-29 5:41 ` Jingoo Han
2013-04-29 11:35 ` Rafael J. Wysocki
2013-04-29 12:12 ` Lars-Peter Clausen
0 siblings, 2 replies; 16+ messages in thread
From: Jingoo Han @ 2013-04-29 5:41 UTC (permalink / raw)
To: 'Rafael J. Wysocki', 'Andrew Morton'
Cc: linux-kernel, 'Len Brown', 'Pavel Machek',
linux-pm, Jingoo Han
On Saturday, April 27, 2013 11:41 PM, Rafael J. Wysocki:
>
> On Saturday, April 27, 2013 11:54:50 AM Jingoo Han wrote:
> > Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> > to be assigned without having an #define xxx NULL for the case that PM is
> > not enabled.
> >
> > Signed-off-by: Jingoo Han <jg1.han@samsung.com>
>
> First, I'm not taking any more PM patches for v3.10 (that don't fix recent
> regressions).
>
> Second, please add that macro along with a user.
Hi Rafael,
This macro can be used as below:
This macro cannot affect the procedure of suspend/resume
calls; thus, there is no side effect.
It just reduces the code size of each drivers.
In this way, of_match_ptr() macro has been already used.
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -1218,7 +1218,6 @@ static int s3c24xx_i2c_resume(struct device *dev)
}
#endif
-#ifdef CONFIG_PM
static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
#ifdef CONFIG_PM_SLEEP
.suspend_noirq = s3c24xx_i2c_suspend_noirq,
@@ -1226,11 +1225,6 @@ static const struct dev_pm_ops s3c24xx_i2c_dev_pm_ops = {
#endif
};
-#define S3C24XX_DEV_PM_OPS (&s3c24xx_i2c_dev_pm_ops)
-#else
-#define S3C24XX_DEV_PM_OPS NULL
-#endif
-
/* device driver for platform bus bits */
static struct platform_driver s3c24xx_i2c_driver = {
@@ -1240,7 +1234,7 @@ static struct platform_driver s3c24xx_i2c_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "s3c-i2c",
- .pm = S3C24XX_DEV_PM_OPS,
+ .pm = pm_ops_ptr(&s3c24xx_i2c_dev_pm_ops),
.of_match_table = of_match_ptr(s3c24xx_i2c_match),
},
};
Best regards,
Jingoo Han
>
> Thanks,
> Rafael
>
>
> > ---
> > include/linux/pm.h | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/include/linux/pm.h b/include/linux/pm.h
> > index a224c7f..bd50d15 100644
> > --- a/include/linux/pm.h
> > +++ b/include/linux/pm.h
> > @@ -55,8 +55,10 @@ struct device;
> >
> > #ifdef CONFIG_PM
> > extern const char power_group_name[]; /* = "power" */
> > +#define pm_ops_ptr(_ptr) (_ptr)
> > #else
> > #define power_group_name NULL
> > +#define pm_ops_ptr(_ptr) NULL
> > #endif
> >
> > typedef struct pm_message {
> >
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] PM: Add pm_ops_ptr() macro
2013-04-27 2:54 Jingoo Han
@ 2013-04-27 14:40 ` Rafael J. Wysocki
2013-04-29 5:41 ` Jingoo Han
0 siblings, 1 reply; 16+ messages in thread
From: Rafael J. Wysocki @ 2013-04-27 14:40 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Andrew Morton', linux-kernel, 'Len Brown',
'Pavel Machek',
linux-pm
On Saturday, April 27, 2013 11:54:50 AM Jingoo Han wrote:
> Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
> to be assigned without having an #define xxx NULL for the case that PM is
> not enabled.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
First, I'm not taking any more PM patches for v3.10 (that don't fix recent
regressions).
Second, please add that macro along with a user.
Thanks,
Rafael
> ---
> include/linux/pm.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index a224c7f..bd50d15 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -55,8 +55,10 @@ struct device;
>
> #ifdef CONFIG_PM
> extern const char power_group_name[]; /* = "power" */
> +#define pm_ops_ptr(_ptr) (_ptr)
> #else
> #define power_group_name NULL
> +#define pm_ops_ptr(_ptr) NULL
> #endif
>
> typedef struct pm_message {
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH] PM: Add pm_ops_ptr() macro
@ 2013-04-27 2:54 Jingoo Han
2013-04-27 14:40 ` Rafael J. Wysocki
0 siblings, 1 reply; 16+ messages in thread
From: Jingoo Han @ 2013-04-27 2:54 UTC (permalink / raw)
To: 'Andrew Morton'
Cc: linux-kernel, 'Len Brown', 'Pavel Machek',
'Rafael J. Wysocki',
linux-pm, Jingoo Han
Add pm_ops_ptr() macro that allows the .pm entry in the driver structures
to be assigned without having an #define xxx NULL for the case that PM is
not enabled.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
include/linux/pm.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/pm.h b/include/linux/pm.h
index a224c7f..bd50d15 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -55,8 +55,10 @@ struct device;
#ifdef CONFIG_PM
extern const char power_group_name[]; /* = "power" */
+#define pm_ops_ptr(_ptr) (_ptr)
#else
#define power_group_name NULL
+#define pm_ops_ptr(_ptr) NULL
#endif
typedef struct pm_message {
--
1.7.2.5
^ permalink raw reply related [flat|nested] 16+ messages in thread
end of thread, other threads:[~2013-05-30 13:54 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-30 1:09 [PATCH] PM: Add pm_ops_ptr() macro Jingoo Han
2013-04-30 1:09 ` Jingoo Han
2013-05-02 21:18 ` Rafael J. Wysocki
2013-05-02 21:18 ` Rafael J. Wysocki
2013-05-03 9:23 ` Pavel Machek
2013-05-30 10:56 ` Wolfram Sang
2013-05-30 10:56 ` Wolfram Sang
2013-05-30 13:54 ` Rafael J. Wysocki
2013-05-30 13:54 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2013-04-27 2:54 Jingoo Han
2013-04-27 14:40 ` Rafael J. Wysocki
2013-04-29 5:41 ` Jingoo Han
2013-04-29 11:35 ` Rafael J. Wysocki
2013-04-30 0:21 ` Jingoo Han
2013-04-29 12:12 ` Lars-Peter Clausen
2013-04-30 0:54 ` Jingoo Han
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.