[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <517E63C8.6040809@metafoo.de>
Date: Mon, 29 Apr 2013 14:12:56 +0200
From: Lars-Peter Clausen <lars@...afoo.de>
To: Jingoo Han <jg1.han@...sung.com>
CC: "'Rafael J. Wysocki'" <rjw@...k.pl>,
'Andrew Morton' <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, 'Len Brown' <len.brown@...el.com>,
'Pavel Machek' <pavel@....cz>, linux-pm@...r.kernel.org
Subject: Re: [PATCH] PM: Add pm_ops_ptr() macro
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@...sung.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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists