From patchwork Wed Dec 16 11:41:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7860971 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C175BEEE1 for ; Wed, 16 Dec 2015 11:41:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7122120382 for ; Wed, 16 Dec 2015 11:41:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 569B4202EC for ; Wed, 16 Dec 2015 11:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932543AbbLPLlm (ORCPT ); Wed, 16 Dec 2015 06:41:42 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33384 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932530AbbLPLll (ORCPT ); Wed, 16 Dec 2015 06:41:41 -0500 Received: by mail-pf0-f173.google.com with SMTP id e66so11432447pfe.0; Wed, 16 Dec 2015 03:41:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=dc244kcCFwhXS4iX2CDucTkWkC9M/9eZMqyS4HhiKIc=; b=qtOP6O4zfXeXB1YWmT20Q3JCagJNlZ0Sc8F84f8kKtowzBmoMII54J9JLQnuefKEE0 WUEEAC4lLe0z8uM/KrwygM0HlnNBbokne/1WpCCrUjGNbnJh1XvKZcFQsBfq/jHl8tkj dd0ICbLzPt/94hTk9nHAPgnN31ZxYDC/ZZagdu6bk19qn8GpsolkEzlwyb+eWw5MnQ9Q DP6PPtXVupP+L/gzOC5UcIchZCDB3Ajl/ZVDJ54xhw5VR1ZVgIn3LJn8ZICimsAiTSLI 3ryEyvxg7C9WRAsDUteXuv0xG4ryiwwhK9yqYGQnjwkcdA/Fpwc0P/aCRvURBqab+0Qu OfZA== X-Received: by 10.98.71.1 with SMTP id u1mr4554486pfa.139.1450266101207; Wed, 16 Dec 2015 03:41:41 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([122.169.160.163]) by smtp.gmail.com with ESMTPSA id jj5sm8824028pac.4.2015.12.16.03.41.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Dec 2015 03:41:40 -0800 (PST) From: Sudip Mukherjee To: "Rafael J. Wysocki" , Pavel Machek , Len Brown Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Sudip Mukherjee , Eric Anholt Subject: [PATCH] PM / sleep: define inline functions Date: Wed, 16 Dec 2015 17:11:39 +0530 Message-Id: <1450266099-4352-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 defined then the functions are defined as NULL. And as a result we are getting build failure with alpha allmodconfig with the error: drivers/gpu/drm/vc4/vc4_v3d.c: In function 'vc4_v3d_set_power': include/linux/stddef.h:7:14: error: called object is not a function or function pointer #define NULL ((void *)0) ^ 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); ^ include/linux/stddef.h:7:14: error: called object is not a function or function pointer #define NULL ((void *)0) ^ include/linux/pm.h:764:28: note: in expansion of macro 'NULL' #define pm_generic_resume NULL ^ drivers/gpu/drm/vc4/vc4_v3d.c:159:10: note: in expansion of macro 'pm_generic_resume' return pm_generic_resume(&vc4->v3d->pdev->dev); ^ Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") Cc: Eric Anholt Signed-off-by: Sudip Mukherjee --- build log is at: https://travis-ci.org/sudipm-mukherjee/parport/jobs/97149763 Also tested with x86_64 allmodconfig. include/linux/pm.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/pm.h b/include/linux/pm.h index 528be67..5fe5dbb 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -755,13 +755,22 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void { } +static inline int pm_generic_resume(struct device *dev) +{ + return 0; +} + +static inline int pm_generic_poweroff(struct device *dev) +{ + return 0; +} + #define pm_generic_prepare NULL #define pm_generic_suspend_late NULL #define pm_generic_suspend_noirq NULL #define pm_generic_suspend NULL #define pm_generic_resume_early NULL #define pm_generic_resume_noirq NULL -#define pm_generic_resume NULL #define pm_generic_freeze_noirq NULL #define pm_generic_freeze_late NULL #define pm_generic_freeze NULL @@ -773,7 +782,6 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void #define pm_generic_restore NULL #define pm_generic_poweroff_noirq NULL #define pm_generic_poweroff_late NULL -#define pm_generic_poweroff NULL #define pm_generic_complete NULL #endif /* !CONFIG_PM_SLEEP */