Return-Path: From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= To: linux-bluetooth@vger.kernel.org Cc: Claudio Takahasi Subject: [PATCH 02/21] hog: Add checking for 'EnableGatt' Date: Tue, 3 Jul 2012 15:42:54 -0300 Message-Id: <1341340993-7480-3-git-send-email-jprvita@openbossa.org> In-Reply-To: <1341340993-7480-1-git-send-email-jprvita@openbossa.org> References: <1341340993-7480-1-git-send-email-jprvita@openbossa.org> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: From: Claudio Takahasi This patch adds the verification for 'EnableGatt' config option on HoG plugin. HoG should not be enabled if EnableGatt is disabled. --- input/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/input/main.c b/input/main.c index 2aac3db..722bc49 100644 --- a/input/main.c +++ b/input/main.c @@ -32,6 +32,7 @@ #include #include "plugin.h" +#include "hcid.h" #include "log.h" #include "manager.h" @@ -87,11 +88,19 @@ BLUETOOTH_PLUGIN_DEFINE(input, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT, static int hog_init(void) { + if (!main_opts.gatt_enabled) { + DBG("GATT is disabled"); + return -ENOTSUP; + } + return hog_manager_init(); } static void hog_exit(void) { + if (!main_opts.gatt_enabled) + return; + hog_manager_exit(); } -- 1.7.10.4