From patchwork Sat Jan 9 18:13:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 7998641 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 431AC9F6FA for ; Mon, 11 Jan 2016 00:53:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4476A20303 for ; Mon, 11 Jan 2016 00:53:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 63E65202FE for ; Mon, 11 Jan 2016 00:53:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C09146E0FD; Sun, 10 Jan 2016 16:53:26 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 2325 seconds by postgrey-1.34 at gabe; Sat, 09 Jan 2016 10:52:23 PST Received: from bh-25.webhostbox.net (bh-25.webhostbox.net [208.91.199.152]) by gabe.freedesktop.org (Postfix) with ESMTPS id C2F876E0EF for ; Sat, 9 Jan 2016 10:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=bIXqVm/E5e5LcO02AbH3Lb8KCAGBscWAtJd/9ICaCio=; b=ZDzwMSwTskQY3xq70Wkr6zz03z ynQi3/Ywp+14lJJkLlsSpyH2lssUPpnRYpkOags5i64srlOVSviJn44D/VqxpNvRUG7LX2tQNaeRL 7iSMh1SW9gODQVsVU18w5iXXT/zQAF7efDH0bZQp/kDPvd+6PHBZy90tkkCD5DPUGm60=; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:41639 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86) (envelope-from ) id 1aHy1V-000Rtt-7I; Sat, 09 Jan 2016 18:13:57 +0000 From: Guenter Roeck To: David Airlie 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 Message-Id: <1452363214-969-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.1.4 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - lists.freedesktop.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: X-Mailman-Approved-At: Sun, 10 Jan 2016 16:53:22 -0800 Cc: Guenter Roeck , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Guenter Roeck --- 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);