From patchwork Tue Sep 15 23:57:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 47784 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8FNvVe2019869 for ; Tue, 15 Sep 2009 23:57:31 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D18429E7FA; Tue, 15 Sep 2009 16:57:30 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from outbound-mail-23.bluehost.com (outbound-mail-23.bluehost.com [69.89.21.18]) by gabe.freedesktop.org (Postfix) with SMTP id D57EC9E787 for ; Tue, 15 Sep 2009 16:57:28 -0700 (PDT) Received: (qmail 9716 invoked by uid 0); 15 Sep 2009 23:57:28 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by outboundproxy2.bluehost.com with SMTP; 15 Sep 2009 23:57:28 -0000 Received: from [75.111.28.251] (helo=jbarnes-g45) by box514.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Mnhto-00045o-2B; Tue, 15 Sep 2009 17:57:28 -0600 Date: Tue, 15 Sep 2009 16:57:24 -0700 From: Jesse Barnes To: ykzhao Message-ID: <20090915165724.4e4a1229@jbarnes-g45> In-Reply-To: <1252630922.3609.200.camel@localhost.localdomain> References: <1252621686-27307-1-git-send-email-jbarnes@virtuousgeek.org> <1252621686-27307-2-git-send-email-jbarnes@virtuousgeek.org> <1252630922.3609.200.camel@localhost.localdomain> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.17.5; i486-pc-linux-gnu) Mime-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 75.111.28.251 authed with jbarnes@virtuousgeek.org} Cc: linux-acpi@vger.kernel.org, "intel-gfx@lists.freedesktop.org" Subject: [Intel-gfx] [PATCH] ACPI: make ACPI button funcs no-ops if not built in X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org On Fri, 11 Sep 2009 09:02:02 +0800 ykzhao wrote: > > +#ifndef ACPI_BUTTON_H > > +#define ACPI_BUTTON_H > It will be better that the function prototype is defined in the > following: > > #if (defined(CONFIG_ACPI_BUTTON) || > defined(CONFIG_ACPI_BUTTON_MODULE)) extern int > acpi_lid_notifier_register(struct notifier_block *nb); extern int > acpi_lid_notifier_unregister(struct notifier_block *nb); extern int > acpi_lid_open(void); #else > static inline int acpi_lid_notifier_register( ...) { return 0;} > static inline int acpi_lid_notifier_unregister(struct notifier_block > *nb) { return 0; } > static inline int acpi_lid_open(void) { return 1; } > #endif Here you go. diff --git a/include/acpi/button.h b/include/acpi/button.h index bb643a7..97eea0e 100644 --- a/include/acpi/button.h +++ b/include/acpi/button.h @@ -3,8 +3,23 @@ #include +#if defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) extern int acpi_lid_notifier_register(struct notifier_block *nb); extern int acpi_lid_notifier_unregister(struct notifier_block *nb); extern int acpi_lid_open(void); +#else +static inline int acpi_lid_notifier_register(struct notifier_block *nb) +{ + return 0; +} +static inline int acpi_lid_notifier_unregister(struct notifier_block *nb) +{ + return 0; +} +static inline int acpi_lid_open(void) +{ + return 1; +} +#endif /* defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) */ #endif /* ACPI_BUTTON_H */