From: Guenter Roeck <linux@roeck-us.net>
To: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>, Eric Anholt <eric@anholt.net>
Subject: [PATCH -next] drm/vc4: Do not call pm functions if CONFIG_PM_SLEEP is not configured
Date: Sat, 9 Jan 2016 10:13:34 -0800 [thread overview]
Message-ID: <1452363214-969-1-git-send-email-linux@roeck-us.net> (raw)
If CONFIG_PM_SLEEP is not configured, the build fails with
include/linux/pm.h:776:30: note: in expansion of macro 'NULL'
#define pm_generic_poweroff NULL
drivers/gpu/drm/vc4/vc4_v3d.c:157:10: note:
in expansion of macro 'pm_generic_poweroff'
return pm_generic_poweroff(&vc4->v3d->pdev->dev);
pm_generic_poweroff and pm_generic_resume are defined as NULL if
CONFIG_PM_SLEEP is not configured and can therefore not be called
in that case. Create a wrapper for the calling function to solve
the problem.
Fixes: d5b1a78a772f1 ("drm/vc4: Add support for drawing 3D frames.")
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/gpu/drm/vc4/vc4_drv.h | 8 ++++++++
drivers/gpu/drm/vc4/vc4_v3d.c | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h
index 080865ec2bae..5948e2b1b7d9 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.h
+++ b/drivers/gpu/drm/vc4/vc4_drv.h
@@ -434,7 +434,15 @@ void vc4_plane_async_set_fb(struct drm_plane *plane,
extern struct platform_driver vc4_v3d_driver;
int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused);
int vc4_v3d_debugfs_regs(struct seq_file *m, void *unused);
+
+#ifdef CONFIG_PM_SLEEP
int vc4_v3d_set_power(struct vc4_dev *vc4, bool on);
+#else
+static inline int vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
+{
+ return 0;
+}
+#endif
/* vc4_validate.c */
int
diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index 424d515ffcda..4789de303f2f 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -150,6 +150,8 @@ int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused)
* This may be doable with just the clocks interface, though this
* packet does some other register setup from the firmware, too.
*/
+#ifdef CONFIG_PM_SLEEP
+
int
vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
{
@@ -159,6 +161,8 @@ vc4_v3d_set_power(struct vc4_dev *vc4, bool on)
return pm_generic_resume(&vc4->v3d->pdev->dev);
}
+#endif /* CONFIG_PM_SLEEP */
+
static void vc4_v3d_init_hw(struct drm_device *dev)
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
--
2.1.4
reply other threads:[~2016-01-09 18:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1452363214-969-1-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®