login
Header Space

 
 

[PATCH 10/16] PCI slot: Replace dbg with pr_debug (Not for mainline!)

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Alex Chiang <achiang@...>, Greg KH <gregkh@...>
Cc: Gary Hade <garyhade@...>, Kristen Carlson Accardi <kristen.c.accardi@...>, Matthew Wilcox <matthew@...>, <warthog19@...>, <rick.jones2@...>, <linux-kernel@...>, <linux-pci@...>, <linux-acpi@...>
Date: Friday, March 21, 2008 - 12:17 am

The dbg() macro doesn't work because the 'pci_slot_debug' flag never
be set unless we manually modify drivers/pci/slots.c. So we should use
pr_debug() instead. This patch replaces dbg() with pr_debug().

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>

---
 drivers/pci/slot.c |   38 +++++++++++++++-----------------------
 1 file changed, 15 insertions(+), 23 deletions(-)

Index: linux-2.6.25-rc6/drivers/pci/slot.c
===================================================================
--- linux-2.6.25-rc6.orig/drivers/pci/slot.c
+++ linux-2.6.25-rc6/drivers/pci/slot.c
@@ -9,15 +9,6 @@
 #include <linux/pci.h>
 #include "pci.h"
 
-static int pci_slot_debug;
-#define MY_NAME "slot"
-#define dbg(format, arg...)					\
-	do {							\
-		if (pci_slot_debug)				\
-			printk(KERN_DEBUG "%s: " format,	\
-				MY_NAME , ## arg);		\
-	} while (0)
-
 struct kset *pci_slots_kset;
 EXPORT_SYMBOL_GPL(pci_slots_kset);
 
@@ -71,8 +62,8 @@ static void pci_slot_release(struct kobj
 {
 	struct pci_slot *slot = to_pci_slot(kobj);
 
-	dbg("%s: releasing pci_slot on %x:%d\n", __func__,
-		slot->bus->number, slot->number);
+	pr_debug("%s: releasing pci_slot on %x:%d\n", __func__,
+		 slot->bus->number, slot->number);
 
 	list_del(&slot->list);
 
@@ -109,19 +100,19 @@ int pci_slot_add_hotplug(struct pci_bus 
 	}
 
 	if (!found) {
-		dbg("%s: slot not found\n", __func__);
+		pr_debug("%s: slot not found\n", __func__);
 		retval = -EEXIST;
 		goto out;
 	}
 
 	if (slot->release) {
-		dbg("%s: already claimed\n", __func__);
+		pr_debug("%s: already claimed\n", __func__);
 		retval = -EBUSY;
 		goto out;
 	}
 
-	dbg("%s: adding release function to %x:%d\n",
-		__func__, parent->number, slot_nr);
+	pr_debug("%s: adding release function to %x:%d\n",
+		 __func__, parent->number, slot_nr);
 	slot->release = release;
  out:
 	up_write(&pci_bus_sem);
@@ -141,9 +132,10 @@ struct pci_slot *pci_create_slot(struct 
 	list_for_each_entry(slot, &parent->slots, list) {
 		if (slot->number == slot_nr) {
 			kobject_get(&slot->kobj);
-			dbg("%s: bumped refcount to %d on %x:%d\n",
-			    __func__, atomic_read(&slot->kobj.kref.refcount),
-			    parent->number, slot_nr);
+			pr_debug("%s: bumped refcount to %d on %x:%d\n",
+				 __func__,
+				 atomic_read(&slot->kobj.kref.refcount),
+				 parent->number, slot_nr);
 			goto out;
 		}
 	}
@@ -173,8 +165,8 @@ struct pci_slot *pci_create_slot(struct 
 	INIT_LIST_HEAD(&slot->list);
 	list_add(&slot->list, &parent->slots);
 
-	dbg("%s: created pci_slot on %x:%d\n",
-		__func__, parent->number, slot_nr);
+	pr_debug("%s: created pci_slot on %x:%d\n",
+		 __func__, parent->number, slot_nr);
 
  out:
 	up_write(&pci_bus_sem);
@@ -191,9 +183,9 @@ EXPORT_SYMBOL_GPL(pci_create_slot);
 
 int pci_destroy_slot(struct pci_slot *slot)
 {
-	dbg("%s: decreased refcount to %d on %x:%d\n", __func__,
-	    atomic_read(&slot->kobj.kref.refcount) - 1, slot->bus->number,
-	    slot->number);
+	pr_debug("%s: decreased refcount to %d on %x:%d\n", __func__,
+		 atomic_read(&slot->kobj.kref.refcount) - 1, slot->bus->number,
+		 slot->number);
 
 	down_write(&pci_bus_sem);
 	kobject_put(&slot->kobj);


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects, Alex Chiang, (Tue Mar 18, 5:05 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects, Kenji Kaneshige, (Fri Mar 21, 12:07 am)
[PATCH 10/16] PCI slot: Replace dbg with pr_debug (Not for m..., Kenji Kaneshige, (Fri Mar 21, 12:17 am)
[PATCH 1/3] Construct one fakephp slot per pci slot, Alex Chiang, (Tue Mar 18, 5:08 pm)
[PATCH 2/3] Introduce pci_slot, Alex Chiang, (Tue Mar 18, 5:09 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects, Matthew Wilcox, (Tue Mar 18, 8:55 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects, Kenji Kaneshige, (Tue Mar 18, 10:24 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects, Kenji Kaneshige, (Tue Mar 18, 10:34 pm)
[PATCH 3/3] ACPI PCI slot detection driver, Alex Chiang, (Tue Mar 18, 5:09 pm)
speck-geostationary