Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 121b090e authored by Tang Chen's avatar Tang Chen Committed by Bjorn Helgaas
Browse files

PCI/ACPI: Print info if host bridge notify handler installation fails



acpi_install_notify_handler() could fail.  So check the exit status
and give a better debug info.

Signed-off-by: default avatarTang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 668192b6
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -769,6 +769,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 };
@@ -781,9 +782,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,
	status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
					handle_hotplug_event_root, NULL);
	printk(KERN_DEBUG "acpi root: %s notify handler installed\n", objname);
	if (ACPI_FAILURE(status))
		printk(KERN_DEBUG "acpi root: %s notify handler is not installed, exit status: %u\n",
				  objname, (unsigned int)status);
	else
		printk(KERN_DEBUG "acpi root: %s notify handler is installed\n",
				 objname);

	return AE_OK;
}