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: 47785 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8G04AIN020605 for ; Wed, 16 Sep 2009 00:04:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbZIPAEG (ORCPT ); Tue, 15 Sep 2009 20:04:06 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752996AbZIPAEG (ORCPT ); Tue, 15 Sep 2009 20:04:06 -0400 Received: from outbound-mail-23.bluehost.com ([69.89.21.18]:52523 "HELO outbound-mail-23.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751530AbZIPAEF convert rfc822-to-8bit (ORCPT ); Tue, 15 Sep 2009 20:04:05 -0400 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Sep 2009 20:04:05 EDT 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 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=virtuousgeek.org; h=Received:Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=r9ItGas5Cw7ymT6Yn43macpdkZs0O3pAgEUbn6xq/wv9vGqqNziu6qXG9e834wny3zUg75dnihuT6NgFt+J/eqp9WuxHVUb6lHenNcZpAYirwa8Z2r8s1oxht4xxghJJ; 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 Cc: "intel-gfx@lists.freedesktop.org" , linux-acpi@vger.kernel.org, eric@anholt.net Subject: [PATCH] ACPI: make ACPI button funcs no-ops if not built in 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} Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.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 */