Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422753Ab2JLMfx (ORCPT ); Fri, 12 Oct 2012 08:35:53 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:2484 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S933542Ab2JLMfc (ORCPT ); Fri, 12 Oct 2012 08:35:32 -0400 X-IronPort-AV: E=Sophos;i="4.80,577,1344182400"; d="scan'208";a="5990353" From: Tang Chen To: bhelgaas@google.com, lenb@kernel.org, yinghai@kernel.org, jiang.liu@huawei.com, izumi.taku@jp.fujitsu.com, isimatu.yasuaki@jp.fujitsu.com, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tang Chen Subject: [PATCH 3/3 v2] Check exit status of acpi_install_notify_handler() in find_root_bridges(). Date: Fri, 12 Oct 2012 20:34:21 +0800 Message-Id: <1350045261-7344-4-git-send-email-tangchen@cn.fujitsu.com> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: <1350045261-7344-1-git-send-email-tangchen@cn.fujitsu.com> References: <1350045261-7344-1-git-send-email-tangchen@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/10/12 20:35:16, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/10/12 20:35:17, Serialize complete at 2012/10/12 20:35:17 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1721 Lines: 46 acpi_install_notify_handler() could fail. So check the exit status and give a better debug info. Signed-off-by: Tang Chen --- drivers/acpi/pci_root_hp.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/pci_root_hp.c b/drivers/acpi/pci_root_hp.c index 1f60533..4c18573 100644 --- a/drivers/acpi/pci_root_hp.c +++ b/drivers/acpi/pci_root_hp.c @@ -242,6 +242,7 @@ static void handle_hotplug_event_root(acpi_handle handle, u32 type, static acpi_status __init find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv) { + acpi_status status; char objname[64]; struct acpi_buffer buffer = { .length = sizeof(objname), .pointer = objname }; @@ -254,9 +255,14 @@ find_root_bridges(acpi_handle handle, u32 lvl, void *context, void **rv) acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); - acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, - handle_hotplug_event_root, NULL); - printk(KERN_DEBUG "acpi root: %s notify handler installed\n", objname); + status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY, + handle_hotplug_event_root, NULL); + if (ACPI_FAILURE(status)) + printk(KERN_DEBUG "acpi root: %s notify handler not installed\n" + "acpi root: exit status: %u\n", + objname, (unsigned int)status); + else + printk(KERN_DEBUG "acpi root: %s notify handler installed\n", objname); add_acpi_root_bridge(handle); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/