lkml.org 
[lkml]   [2013]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PM: Add pm_ops_ptr() macro
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?

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-05-30 13:41    [W:0.072 / U:0.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site