* [PATCH v2 1/3] usb: chipidea: core: fix when building without CONFIG_PM support
@ 2015-09-23 11:56 Felipe F. Tonello
2015-09-24 1:17 ` Peter Chen
0 siblings, 1 reply; 4+ messages in thread
From: Felipe F. Tonello @ 2015-09-23 11:56 UTC (permalink / raw)
To: linux-usb
Cc: linux-kernel, Peter Chen, Greg Kroah-Hartman, Felipe Balbi,
Andrzej Pietrasiewicz, Felipe F. Tonello
If CONFIG_PM or CONFIG_PM_SLEEP is not set, driver will not compile
properly.
Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
Changes for v2:
* removed unnecessary #ifdef CONFIG_PM_SLEEP.
drivers/usb/chipidea/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 3ad48e1..382b4af 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1009,18 +1009,20 @@ static int ci_runtime_resume(struct device *dev)
return ci_controller_resume(dev);
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops ci_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(ci_suspend, ci_resume)
SET_RUNTIME_PM_OPS(ci_runtime_suspend, ci_runtime_resume, NULL)
};
+#endif /* CONFIG_PM */
static struct platform_driver ci_hdrc_driver = {
.probe = ci_hdrc_probe,
.remove = ci_hdrc_remove,
.driver = {
.name = "ci_hdrc",
+#ifdef CONFIG_PM
.pm = &ci_pm_ops,
+#endif
},
};
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/3] usb: chipidea: core: fix when building without CONFIG_PM support
2015-09-23 11:56 [PATCH v2 1/3] usb: chipidea: core: fix when building without CONFIG_PM support Felipe F. Tonello
@ 2015-09-24 1:17 ` Peter Chen
2015-09-25 8:26 ` Felipe Tonello
0 siblings, 1 reply; 4+ messages in thread
From: Peter Chen @ 2015-09-24 1:17 UTC (permalink / raw)
To: Felipe F. Tonello
Cc: linux-usb, linux-kernel, Greg Kroah-Hartman, Felipe Balbi,
Andrzej Pietrasiewicz
On Wed, Sep 23, 2015 at 12:56:58PM +0100, Felipe F. Tonello wrote:
> If CONFIG_PM or CONFIG_PM_SLEEP is not set, driver will not compile
> properly.
>
Would you post the warning or error messages?
I just tried at v4.3-rc1 (v4.2 should be same), without any problems.
Peter
> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
> ---
>
> Changes for v2:
> * removed unnecessary #ifdef CONFIG_PM_SLEEP.
>
> drivers/usb/chipidea/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 3ad48e1..382b4af 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -1009,18 +1009,20 @@ static int ci_runtime_resume(struct device *dev)
> return ci_controller_resume(dev);
> }
>
> -#endif /* CONFIG_PM */
> static const struct dev_pm_ops ci_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(ci_suspend, ci_resume)
> SET_RUNTIME_PM_OPS(ci_runtime_suspend, ci_runtime_resume, NULL)
> };
> +#endif /* CONFIG_PM */
>
> static struct platform_driver ci_hdrc_driver = {
> .probe = ci_hdrc_probe,
> .remove = ci_hdrc_remove,
> .driver = {
> .name = "ci_hdrc",
> +#ifdef CONFIG_PM
> .pm = &ci_pm_ops,
> +#endif
> },
> };
>
> --
> 2.1.4
>
--
Best Regards,
Peter Chen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/3] usb: chipidea: core: fix when building without CONFIG_PM support
2015-09-24 1:17 ` Peter Chen
@ 2015-09-25 8:26 ` Felipe Tonello
2015-09-25 9:01 ` Peter Chen
0 siblings, 1 reply; 4+ messages in thread
From: Felipe Tonello @ 2015-09-25 8:26 UTC (permalink / raw)
To: Peter Chen
Cc: USB list, Kernel development list, Greg Kroah-Hartman,
Felipe Balbi, Andrzej Pietrasiewicz
Hi Peter,
On Thu, Sep 24, 2015 at 2:17 AM, Peter Chen <peter.chen@freescale.com> wrote:
> On Wed, Sep 23, 2015 at 12:56:58PM +0100, Felipe F. Tonello wrote:
>> If CONFIG_PM or CONFIG_PM_SLEEP is not set, driver will not compile
>> properly.
>>
>
> Would you post the warning or error messages?
>
> I just tried at v4.3-rc1 (v4.2 should be same), without any problems.
Actually I tested again with the latest and it doesn't break. But
still I believe it is the right thing to do, even though it builds.
Just good practice to make sure the ifdefs are correct on driver code.
Felipe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/3] usb: chipidea: core: fix when building without CONFIG_PM support
2015-09-25 8:26 ` Felipe Tonello
@ 2015-09-25 9:01 ` Peter Chen
0 siblings, 0 replies; 4+ messages in thread
From: Peter Chen @ 2015-09-25 9:01 UTC (permalink / raw)
To: Felipe Tonello
Cc: USB list, Kernel development list, Greg Kroah-Hartman,
Felipe Balbi, Andrzej Pietrasiewicz
On Fri, Sep 25, 2015 at 09:26:21AM +0100, Felipe Tonello wrote:
> Hi Peter,
>
> On Thu, Sep 24, 2015 at 2:17 AM, Peter Chen <peter.chen@freescale.com> wrote:
> > On Wed, Sep 23, 2015 at 12:56:58PM +0100, Felipe F. Tonello wrote:
> >> If CONFIG_PM or CONFIG_PM_SLEEP is not set, driver will not compile
> >> properly.
> >>
> >
> > Would you post the warning or error messages?
> >
> > I just tried at v4.3-rc1 (v4.2 should be same), without any problems.
>
> Actually I tested again with the latest and it doesn't break. But
> still I believe it is the right thing to do, even though it builds.
> Just good practice to make sure the ifdefs are correct on driver code.
>
We need to decrease #ifdefs as less as possible, only add it if it
really needs.
--
Best Regards,
Peter Chen
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-09-25 9:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-23 11:56 [PATCH v2 1/3] usb: chipidea: core: fix when building without CONFIG_PM support Felipe F. Tonello
2015-09-24 1:17 ` Peter Chen
2015-09-25 8:26 ` Felipe Tonello
2015-09-25 9:01 ` Peter Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).