From: "Wu, Songjun" <Songjun.Wu@microchip.com>
To: Arnd Bergmann <arnd@arndb.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Hans Verkuil <hans.verkuil@cisco.com>,
<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>
Subject: Re: [PATCH 2/2] [media] atmel-isc: mark PM functions as __maybe_unused
Date: Tue, 13 Sep 2016 10:11:48 +0800 [thread overview]
Message-ID: <a89552fc-6048-4a43-ed4f-40cf19875b1f@microchip.com> (raw)
In-Reply-To: <20160912153322.3098750-2-arnd@arndb.de>
Hi Arnd,
Thank you for your patch.
I think it's better to add switch CONFIG_PM, but the PM feature is a
must, or the ISC can not work, maybe the best choice is to add 'depends
on PM' in Kconfig.
#ifdef CONFIG_PM
isc_runtime_suspend
{
XXX
}
isc_runtime_resume
{
XXX
}
static const struct dev_pm_ops atmel_isc_dev_pm_ops = {
SET_RUNTIME_PM_OPS(isc_runtime_suspend, isc_runtime_resume, NULL)
};
#define ATMEL_ISC_PM_OPS (&atmel_isc_dev_pm_ops)
#else
#define ATMEL_ISC_PM_OPS NULL
#endif
static struct platform_driver atmel_isc_driver = {
.probe = atmel_isc_probe,
.remove = atmel_isc_remove,
.driver = {
.name = ATMEL_ISC_NAME,
.pm = ATMEL_ISC_PM_OPS,
.of_match_table = of_match_ptr(atmel_isc_of_match),
},
};
On 9/12/2016 23:32, Arnd Bergmann wrote:
> The newly added atmel-isc driver uses SET_RUNTIME_PM_OPS() to
> refer to its suspend/resume functions, causing a warning when
> CONFIG_PM is not set:
>
> media/platform/atmel/atmel-isc.c:1477:12: error: 'isc_runtime_resume' defined but not used [-Werror=unused-function]
> media/platform/atmel/atmel-isc.c:1467:12: error: 'isc_runtime_suspend' defined but not used [-Werror=unused-function]
>
> This adds __maybe_unused annotations to avoid the warning without
> adding an error-prone #ifdef around it.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/media/platform/atmel/atmel-isc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c
> index db6773de92f0..a9ab7ae89f04 100644
> --- a/drivers/media/platform/atmel/atmel-isc.c
> +++ b/drivers/media/platform/atmel/atmel-isc.c
> @@ -1464,7 +1464,7 @@ static int atmel_isc_remove(struct platform_device *pdev)
> return 0;
> }
>
> -static int isc_runtime_suspend(struct device *dev)
> +static int __maybe_unused isc_runtime_suspend(struct device *dev)
> {
> struct isc_device *isc = dev_get_drvdata(dev);
>
> @@ -1474,7 +1474,7 @@ static int isc_runtime_suspend(struct device *dev)
> return 0;
> }
>
> -static int isc_runtime_resume(struct device *dev)
> +static int __maybe_unused isc_runtime_resume(struct device *dev)
> {
> struct isc_device *isc = dev_get_drvdata(dev);
> int ret;
>
next prev parent reply other threads:[~2016-09-13 2:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 15:32 [PATCH 1/2] [media] ad5820: use __maybe_unused for PM functions Arnd Bergmann
2016-09-12 15:32 ` [PATCH 2/2] [media] atmel-isc: mark PM functions as __maybe_unused Arnd Bergmann
2016-09-13 2:11 ` Wu, Songjun [this message]
2016-09-12 17:52 ` [PATCH 1/2] [media] ad5820: use __maybe_unused for PM functions Pavel Machek
2016-09-13 8:31 ` Sakari Ailus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a89552fc-6048-4a43-ed4f-40cf19875b1f@microchip.com \
--to=songjun.wu@microchip.com \
--cc=arnd@arndb.de \
--cc=hans.verkuil@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas.ferre@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).