From patchwork Sun Dec 13 21:16:11 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 67046 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBDKJxui006932 for ; Sun, 13 Dec 2009 20:19:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754155AbZLMUT6 (ORCPT ); Sun, 13 Dec 2009 15:19:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754163AbZLMUT6 (ORCPT ); Sun, 13 Dec 2009 15:19:58 -0500 Received: from iksaif.net ([88.191.73.63]:55306 "HELO iksaif.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754155AbZLMUT5 (ORCPT ); Sun, 13 Dec 2009 15:19:57 -0500 Received: from localhost.localdomain (cxr69-11-88-180-139-205.fbx.proxad.net [88.180.139.205]) (Authenticated sender: corentincj@iksaif.net) by iksaif.net (Postfix) with ESMTPA id B04E8C90013; Sun, 13 Dec 2009 21:19:55 +0100 (CET) From: Corentin Chary To: andrej.gelenberg@udo.edu Cc: Matthew Garrett , Alan Jenkins , linux acpi , acpi4asus-user@lists.sourceforge.net, Corentin Chary Subject: [PATCH] eeepc-laptop: disable pci hotplug code when all notifiers fail to load Date: Sun, 13 Dec 2009 22:16:11 +0100 Message-Id: <1260738971-25456-1-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <20091207212848.GA9171@srcf.ucam.org> References: <20091207212848.GA9171@srcf.ucam.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 356ca11..45c3f52 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -177,6 +177,7 @@ struct eeepc_laptop { struct hotplug_slot *hotplug_slot; struct mutex hotplug_lock; + bool hotplug_enabled; struct led_classdev tpd_led; int tpd_led_wk; @@ -642,6 +643,7 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc, eeepc); if (ACPI_FAILURE(status)) pr_warning("Failed to register notify on %s\n", node); + eeepc->hotplug_enabled = true; } else return -ENODEV; @@ -845,7 +847,17 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc) if (result && result != -ENODEV) goto exit; - result = eeepc_setup_pci_hotplug(eeepc); + /* + * Register notifiers first, if they all fail, we won't enable + * pci hotplug because it's probably not needed for this model + * (eg: 1005HA) + */ + eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5"); + eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6"); + eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7"); + + if (eeepc->hotplug_enabled) + result = eeepc_setup_pci_hotplug(eeepc); /* * If we get -EBUSY then something else is handling the PCI hotplug - * don't fail in this case @@ -853,9 +865,6 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc) if (result == -EBUSY) result = 0; - eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5"); - eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6"); - eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7"); /* * Refresh pci hotplug in case the rfkill state was changed during * setup.