From patchwork Mon Apr 29 05:41:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 2498631 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3E7CC3FD85 for ; Mon, 29 Apr 2013 05:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750803Ab3D2Flv (ORCPT ); Mon, 29 Apr 2013 01:41:51 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:37157 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801Ab3D2Flu (ORCPT ); Mon, 29 Apr 2013 01:41:50 -0400 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MM000K9C557HUI0@mailout2.samsung.com>; Mon, 29 Apr 2013 14:41:49 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.49]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 8C.EB.13955.C180E715; Mon, 29 Apr 2013 14:41:49 +0900 (KST) X-AuditID: cbfee68f-b7f066d000003683-f4-517e081cc9b3 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 72.15.01422.C180E715; Mon, 29 Apr 2013 14:41:48 +0900 (KST) Received: from DOJG1HAN03 ([12.23.120.99]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MM0004EZ55O7SF1@mmp2.samsung.com>; Mon, 29 Apr 2013 14:41:48 +0900 (KST) From: Jingoo Han To: "'Rafael J. Wysocki'" , 'Andrew Morton' Cc: linux-kernel@vger.kernel.org, 'Len Brown' , 'Pavel Machek' , linux-pm@vger.kernel.org, Jingoo Han References: <000001ce42f2$96128cc0$c237a640$@samsung.com> <20119404.Sfu5WntByi@vostro.rjw.lan> In-reply-to: <20119404.Sfu5WntByi@vostro.rjw.lan> Subject: Re: [PATCH] PM: Add pm_ops_ptr() macro Date: Mon, 29 Apr 2013 14:41:48 +0900 Message-id: <000001ce449c$3e1ce0f0$ba56a2d0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQGZyojvIl/md4KPBeuZMYPjUO77jQIGGS6nmUVwj5A= Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBIsWRmVeSWpSXmKPExsVy+t8zQ11ZjrpAg/XXGS3mrF/DZnF54SVW i1lT9jJZXN41h83ic+8RRou7p46yWfQv7GVyYPdYvOclk8eJGb9ZPPq2rGL0eLS4hdFjxerv 7B6fN8kFsEVx2aSk5mSWpRbp2yVwZWzY0MZUcEq44s2mFuYGxk98XYycHBICJhKdfz6xQdhi EhfurQeyuTiEBJYxSpz78YwJpmjx2WXsEInpjBJL70+DqvrFKPFu7WwWkCo2ATWJL18Os4PY IgJhErO2HQIrYhZYxCjxZtVWZpCEkECCxPkbL8HGcgoYSky73wwU5+AQFtCXOL7UAyTMIqAq ce5lF1g5r4ClRM+0blYIW1Dix+R7YLuYBdQlJs1bxAxhy0tsXvOWGeJSBYkdZ18zQtxgJbGs YRYrRI2IxL4X7xhB7pEQ+MoucX3lfiaIZQIS3yYfYgG5QUJAVmLTAag5khIHV9xgmcAoMQvJ 6llIVs9CsnoWkhULGFlWMYqmFiQXFCelFxnrFSfmFpfmpesl5+duYoTEcv8OxrsHrA8xJgOt n8gsJZqcD0wFeSXxhsZmRhamJqbGRuaWZqQJK4nzqrVYBwoJpCeWpGanphakFsUXleakFh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207bn2dguLtBNOAN3/nH6c+53G9I FwgekXxkGyxwVqx+bh+fr92SJZzK4prGUT6z7KvbvdLWrU7Ye91h8hEvliAlluKMREMt5qLi RABZ+0cmWAMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 > > 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. 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 --- 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), }, };