aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaku Izumi <izumi.taku@jp.fujitsu.com>2008-10-22 22:52:12 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-10-23 19:11:50 -0400
commitf98ca311f3a32e2adc229fecd6bf732db07fcca3 (patch)
tree70605c5063f72f93a08d350b0fcb66fd359b7996
parent388c8c16abafc2e74dff173b5de9ee519ea8d32f (diff)
PCI hotplug: shpchp: replace printk with dev_printk
This patch replaces printks within shpchp module with dev_printks. Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/hotplug/shpchp.h23
-rw-r--r--drivers/pci/hotplug/shpchp_core.c46
-rw-r--r--drivers/pci/hotplug/shpchp_ctrl.c162
-rw-r--r--drivers/pci/hotplug/shpchp_hpc.c120
-rw-r--r--drivers/pci/hotplug/shpchp_pci.c32
5 files changed, 224 insertions, 159 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index 4d9fed00e1d0..0d48d38cbf41 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -59,6 +59,20 @@ extern struct workqueue_struct *shpchp_wq;
59#define warn(format, arg...) \ 59#define warn(format, arg...) \
60 printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) 60 printk(KERN_WARNING "%s: " format, MY_NAME , ## arg)
61 61
62#define ctrl_dbg(ctrl, format, arg...) \
63 do { \
64 if (shpchp_debug) \
65 dev_printk(, &ctrl->pci_dev->dev, \
66 format, ## arg); \
67 } while (0)
68#define ctrl_err(ctrl, format, arg...) \
69 dev_err(&ctrl->pci_dev->dev, format, ## arg)
70#define ctrl_info(ctrl, format, arg...) \
71 dev_info(&ctrl->pci_dev->dev, format, ## arg)
72#define ctrl_warn(ctrl, format, arg...) \
73 dev_warn(&ctrl->pci_dev->dev, format, ## arg)
74
75
62#define SLOT_NAME_SIZE 10 76#define SLOT_NAME_SIZE 10
63struct slot { 77struct slot {
64 u8 bus; 78 u8 bus;
@@ -239,7 +253,7 @@ static inline struct slot *shpchp_find_slot(struct controller *ctrl, u8 device)
239 return slot; 253 return slot;
240 } 254 }
241 255
242 err("%s: slot (device=0x%x) not found\n", __func__, device); 256 ctrl_err(ctrl, "%s: slot (device=0x%x) not found\n", __func__, device);
243 return NULL; 257 return NULL;
244} 258}
245 259
@@ -273,7 +287,9 @@ static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot)
273 pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, &pcix_bridge_errors_reg); 287 pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, &pcix_bridge_errors_reg);
274 perr_set = pcix_bridge_errors_reg & PERR_OBSERVED_MASK; 288 perr_set = pcix_bridge_errors_reg & PERR_OBSERVED_MASK;
275 if (perr_set) { 289 if (perr_set) {
276 dbg ("%s W1C: Bridge_Errors[ PERR_OBSERVED = %08X]\n",__func__ , perr_set); 290 ctrl_dbg(p_slot->ctrl,
291 "%s W1C: Bridge_Errors[ PERR_OBSERVED = %08X]\n",
292 __func__ , perr_set);
277 293
278 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, perr_set); 294 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, perr_set);
279 } 295 }
@@ -282,7 +298,8 @@ static inline void amd_pogo_errata_restore_misc_reg(struct slot *p_slot)
282 pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, &pcix_mem_base_reg); 298 pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, &pcix_mem_base_reg);
283 rse_set = pcix_mem_base_reg & RSE_MASK; 299 rse_set = pcix_mem_base_reg & RSE_MASK;
284 if (rse_set) { 300 if (rse_set) {
285 dbg ("%s W1C: Memory_Base_Limit[ RSE ]\n",__func__ ); 301 ctrl_dbg(p_slot->ctrl, "%s W1C: Memory_Base_Limit[ RSE ]\n",
302 __func__);
286 303
287 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set); 304 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set);
288 } 305 }
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index 7af9191df4d6..214633bf4abc 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -89,7 +89,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
89{ 89{
90 struct slot *slot = hotplug_slot->private; 90 struct slot *slot = hotplug_slot->private;
91 91
92 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 92 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
93 __func__, slot_name(slot));
93 94
94 kfree(slot->hotplug_slot->info); 95 kfree(slot->hotplug_slot->info);
95 kfree(slot->hotplug_slot); 96 kfree(slot->hotplug_slot);
@@ -135,13 +136,14 @@ static int init_slots(struct controller *ctrl)
135 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); 136 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number);
136 hotplug_slot->ops = &shpchp_hotplug_slot_ops; 137 hotplug_slot->ops = &shpchp_hotplug_slot_ops;
137 138
138 dbg("Registering bus=%x dev=%x hp_slot=%x sun=%x " 139 ctrl_dbg(ctrl, "Registering bus=%x dev=%x hp_slot=%x sun=%x "
139 "slot_device_offset=%x\n", slot->bus, slot->device, 140 "slot_device_offset=%x\n", slot->bus, slot->device,
140 slot->hp_slot, slot->number, ctrl->slot_device_offset); 141 slot->hp_slot, slot->number, ctrl->slot_device_offset);
141 retval = pci_hp_register(slot->hotplug_slot, 142 retval = pci_hp_register(slot->hotplug_slot,
142 ctrl->pci_dev->subordinate, slot->device, name); 143 ctrl->pci_dev->subordinate, slot->device, name);
143 if (retval) { 144 if (retval) {
144 err("pci_hp_register failed with error %d\n", retval); 145 ctrl_err(ctrl, "pci_hp_register failed with error %d\n",
146 retval);
145 goto error_info; 147 goto error_info;
146 } 148 }
147 149
@@ -187,7 +189,8 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
187{ 189{
188 struct slot *slot = get_slot(hotplug_slot); 190 struct slot *slot = get_slot(hotplug_slot);
189 191
190 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 192 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
193 __func__, slot_name(slot));
191 194
192 hotplug_slot->info->attention_status = status; 195 hotplug_slot->info->attention_status = status;
193 slot->hpc_ops->set_attention_status(slot, status); 196 slot->hpc_ops->set_attention_status(slot, status);
@@ -199,7 +202,8 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
199{ 202{
200 struct slot *slot = get_slot(hotplug_slot); 203 struct slot *slot = get_slot(hotplug_slot);
201 204
202 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 205 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
206 __func__, slot_name(slot));
203 207
204 return shpchp_sysfs_enable_slot(slot); 208 return shpchp_sysfs_enable_slot(slot);
205} 209}
@@ -208,7 +212,8 @@ static int disable_slot (struct hotplug_slot *hotplug_slot)
208{ 212{
209 struct slot *slot = get_slot(hotplug_slot); 213 struct slot *slot = get_slot(hotplug_slot);
210 214
211 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 215 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
216 __func__, slot_name(slot));
212 217
213 return shpchp_sysfs_disable_slot(slot); 218 return shpchp_sysfs_disable_slot(slot);
214} 219}
@@ -218,7 +223,8 @@ static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
218 struct slot *slot = get_slot(hotplug_slot); 223 struct slot *slot = get_slot(hotplug_slot);
219 int retval; 224 int retval;
220 225
221 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 226 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
227 __func__, slot_name(slot));
222 228
223 retval = slot->hpc_ops->get_power_status(slot, value); 229 retval = slot->hpc_ops->get_power_status(slot, value);
224 if (retval < 0) 230 if (retval < 0)
@@ -232,7 +238,8 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
232 struct slot *slot = get_slot(hotplug_slot); 238 struct slot *slot = get_slot(hotplug_slot);
233 int retval; 239 int retval;
234 240
235 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 241 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
242 __func__, slot_name(slot));
236 243
237 retval = slot->hpc_ops->get_attention_status(slot, value); 244 retval = slot->hpc_ops->get_attention_status(slot, value);
238 if (retval < 0) 245 if (retval < 0)
@@ -246,7 +253,8 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
246 struct slot *slot = get_slot(hotplug_slot); 253 struct slot *slot = get_slot(hotplug_slot);
247 int retval; 254 int retval;
248 255
249 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 256 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",
257 __func__, slot_name(slot));
250 258
251 retval = slot->hpc_ops->get_latch_status(slot, value); 259 retval = slot->hpc_ops->get_latch_status(slot, value);
252 if (retval < 0) 260 if (retval < 0)
@@ -260,7 +268,8 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
260 struct slot *slot = get_slot(hotplug_slot); 268 struct slot *slot = get_slot(hotplug_slot);
261 int retval; 269 int retval;
262 270
263 dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 271 ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n",