Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] acpi_pcihp: Remove improper error message about OSHP

This patch converts the improper error message about OSHP evaluation
to debug message which is displayed only when pci_hotplug.ko is loaded
with debugging mode enabled. To do this, this patch adds a new module
parameter "debug_acpi" to pci_hotplug.ko for enabling/disabling debug
messages in acpi_pcihp.c.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Kristen Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Kenji Kaneshige and committed by
Greg Kroah-Hartman
aad20cab 7430e34c

+19 -2
+19 -2
drivers/pci/hotplug/acpi_pcihp.c
··· 25 25 */ 26 26 27 27 #include <linux/module.h> 28 + #include <linux/moduleparam.h> 28 29 #include <linux/kernel.h> 29 30 #include <linux/types.h> 30 31 #include <linux/pci.h> ··· 34 33 #include <acpi/actypes.h> 35 34 #include "pci_hotplug.h" 36 35 36 + #define MY_NAME "acpi_pcihp" 37 + 38 + #define dbg(fmt, arg...) do { if (debug_acpi) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0) 39 + #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg) 40 + #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg) 41 + #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg) 42 + 37 43 #define METHOD_NAME__SUN "_SUN" 38 44 #define METHOD_NAME__HPP "_HPP" 39 45 #define METHOD_NAME_OSHP "OSHP" 46 + 47 + static int debug_acpi; 40 48 41 49 42 50 static acpi_status ··· 140 130 /* run OSHP */ 141 131 status = acpi_evaluate_object(handle, METHOD_NAME_OSHP, NULL, NULL); 142 132 if (ACPI_FAILURE(status)) 143 - printk(KERN_ERR "%s:%s OSHP fails=0x%x\n", __FUNCTION__, 144 - (char *)string.pointer, status); 133 + if (status != AE_NOT_FOUND) 134 + printk(KERN_ERR "%s:%s OSHP fails=0x%x\n", 135 + __FUNCTION__, (char *)string.pointer, status); 136 + else 137 + dbg("%s:%s OSHP not found\n", 138 + __FUNCTION__, (char *)string.pointer); 145 139 else 146 140 pr_debug("%s:%s OSHP passes\n", __FUNCTION__, 147 141 (char *)string.pointer); ··· 237 223 return 0; 238 224 } 239 225 EXPORT_SYMBOL_GPL(acpi_root_bridge); 226 + 227 + module_param(debug_acpi, bool, 0644); 228 + MODULE_PARM_DESC(debug_acpi, "Debugging mode for ACPI enabled or not");