3131 *
3232 */
3333
34+ #define pr_fmt (fmt ) "acpiphp: " fmt
35+
3436#include <linux/init.h>
3537#include <linux/module.h>
3638#include <linux/moduleparam.h>
4345#include <linux/smp.h>
4446#include "acpiphp.h"
4547
46- #define MY_NAME "acpiphp"
47-
4848/* name size which is used for entries in pcihpfs */
4949#define SLOT_NAME_SIZE 21 /* {_SUN} */
5050
51- bool acpiphp_debug ;
5251bool acpiphp_disabled ;
5352
5453/* local variables */
@@ -61,9 +60,7 @@ static struct acpiphp_attention_info *attention_info;
6160MODULE_AUTHOR (DRIVER_AUTHOR );
6261MODULE_DESCRIPTION (DRIVER_DESC );
6362MODULE_LICENSE ("GPL" );
64- MODULE_PARM_DESC (debug , "Debugging mode enabled or not" );
6563MODULE_PARM_DESC (disable , "disable acpiphp driver" );
66- module_param_named (debug , acpiphp_debug , bool , 0644 );
6764module_param_named (disable , acpiphp_disabled , bool , 0444 );
6865
6966/* export the attention callback registration methods */
@@ -139,7 +136,7 @@ static int enable_slot(struct hotplug_slot *hotplug_slot)
139136{
140137 struct slot * slot = hotplug_slot -> private ;
141138
142- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
139+ pr_debug ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
143140
144141 /* enable the specified slot */
145142 return acpiphp_enable_slot (slot -> acpi_slot );
@@ -156,7 +153,7 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
156153{
157154 struct slot * slot = hotplug_slot -> private ;
158155
159- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
156+ pr_debug ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
160157
161158 /* disable the specified slot */
162159 return acpiphp_disable_and_eject_slot (slot -> acpi_slot );
@@ -176,8 +173,9 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
176173 {
177174 int retval = - ENODEV ;
178175
179- dbg ("%s - physical_slot = %s\n" , __func__ , hotplug_slot_name (hotplug_slot ));
180-
176+ pr_debug ("%s - physical_slot = %s\n" , __func__ ,
177+ hotplug_slot_name (hotplug_slot ));
178+
181179 if (attention_info && try_module_get (attention_info -> owner )) {
182180 retval = attention_info -> set_attn (hotplug_slot , status );
183181 module_put (attention_info -> owner );
@@ -199,7 +197,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
199197{
200198 struct slot * slot = hotplug_slot -> private ;
201199
202- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
200+ pr_debug ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
203201
204202 * value = acpiphp_get_power_status (slot -> acpi_slot );
205203
@@ -221,7 +219,8 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
221219{
222220 int retval = - EINVAL ;
223221
224- dbg ("%s - physical_slot = %s\n" , __func__ , hotplug_slot_name (hotplug_slot ));
222+ pr_debug ("%s - physical_slot = %s\n" , __func__ ,
223+ hotplug_slot_name (hotplug_slot ));
225224
226225 if (attention_info && try_module_get (attention_info -> owner )) {
227226 retval = attention_info -> get_attn (hotplug_slot , value );
@@ -244,7 +243,7 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
244243{
245244 struct slot * slot = hotplug_slot -> private ;
246245
247- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
246+ pr_debug ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
248247
249248 * value = acpiphp_get_latch_status (slot -> acpi_slot );
250249
@@ -264,7 +263,7 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
264263{
265264 struct slot * slot = hotplug_slot -> private ;
266265
267- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
266+ pr_debug ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
268267
269268 * value = acpiphp_get_adapter_status (slot -> acpi_slot );
270269
@@ -279,7 +278,7 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
279278{
280279 struct slot * slot = hotplug_slot -> private ;
281280
282- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
281+ pr_debug ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
283282
284283 kfree (slot -> hotplug_slot );
285284 kfree (slot );
@@ -322,11 +321,11 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot,
322321 if (retval == - EBUSY )
323322 goto error_hpslot ;
324323 if (retval ) {
325- err ("pci_hp_register failed with error %d\n" , retval );
324+ pr_err ("pci_hp_register failed with error %d\n" , retval );
326325 goto error_hpslot ;
327326 }
328327
329- info ("Slot [%s] registered\n" , slot_name (slot ));
328+ pr_info ("Slot [%s] registered\n" , slot_name (slot ));
330329
331330 return 0 ;
332331error_hpslot :
@@ -343,17 +342,17 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
343342 struct slot * slot = acpiphp_slot -> slot ;
344343 int retval = 0 ;
345344
346- info ("Slot [%s] unregistered\n" , slot_name (slot ));
345+ pr_info ("Slot [%s] unregistered\n" , slot_name (slot ));
347346
348347 retval = pci_hp_deregister (slot -> hotplug_slot );
349348 if (retval )
350- err ("pci_hp_deregister failed with error %d\n" , retval );
349+ pr_err ("pci_hp_deregister failed with error %d\n" , retval );
351350}
352351
353352
354353void __init acpiphp_init (void )
355354{
356- info (DRIVER_DESC " version: " DRIVER_VERSION "%s\n" ,
355+ pr_info (DRIVER_DESC " version: " DRIVER_VERSION "%s\n" ,
357356 acpiphp_disabled ? ", disabled by user; please report a bug"
358357 : "" );
359358}
0 commit comments