@@ -89,7 +89,8 @@ static void release_slot(struct hotplug_slot *hotplug_slot)
89
89
{
90
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
95
kfree (slot -> hotplug_slot -> info );
95
96
kfree (slot -> hotplug_slot );
@@ -135,13 +136,14 @@ static int init_slots(struct controller *ctrl)
135
136
snprintf (name , SLOT_NAME_SIZE , "%d" , slot -> number );
136
137
hotplug_slot -> ops = & shpchp_hotplug_slot_ops ;
137
138
138
- dbg ( "Registering bus=%x dev=%x hp_slot=%x sun=%x "
139
- "slot_device_offset=%x\n" , slot -> bus , slot -> device ,
140
- slot -> hp_slot , slot -> number , ctrl -> slot_device_offset );
139
+ ctrl_dbg ( ctrl , "Registering bus=%x dev=%x hp_slot=%x sun=%x "
140
+ "slot_device_offset=%x\n" , slot -> bus , slot -> device ,
141
+ slot -> hp_slot , slot -> number , ctrl -> slot_device_offset );
141
142
retval = pci_hp_register (slot -> hotplug_slot ,
142
143
ctrl -> pci_dev -> subordinate , slot -> device , name );
143
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
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
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
195
hotplug_slot -> info -> attention_status = status ;
193
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
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
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
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
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
223
struct slot * slot = get_slot (hotplug_slot );
219
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
229
retval = slot -> hpc_ops -> get_power_status (slot , value );
224
230
if (retval < 0 )
@@ -232,7 +238,8 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
232
238
struct slot * slot = get_slot (hotplug_slot );
233
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
244
retval = slot -> hpc_ops -> get_attention_status (slot , value );
238
245
if (retval < 0 )
@@ -246,7 +253,8 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
246
253
struct slot * slot = get_slot (hotplug_slot );
247
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
259
retval = slot -> hpc_ops -> get_latch_status (slot , value );
252
260
if (retval < 0 )
@@ -260,7 +268,8 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
260
268
struct slot * slot = get_slot (hotplug_slot );
261
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" ,
272
+ __func__ , slot_name (slot ));
264
273
265
274
retval = slot -> hpc_ops -> get_adapter_status (slot , value );
266
275
if (retval < 0 )
@@ -275,7 +284,8 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot,
275
284
struct slot * slot = get_slot (hotplug_slot );
276
285
int retval ;
277
286
278
- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
287
+ ctrl_dbg (slot -> ctrl , "%s - physical_slot = %s\n" ,
288
+ __func__ , slot_name (slot ));
279
289
280
290
retval = slot -> hpc_ops -> get_max_bus_speed (slot , value );
281
291
if (retval < 0 )
@@ -289,7 +299,8 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
289
299
struct slot * slot = get_slot (hotplug_slot );
290
300
int retval ;
291
301
292
- dbg ("%s - physical_slot = %s\n" , __func__ , slot_name (slot ));
302
+ ctrl_dbg (slot -> ctrl , "%s - physical_slot = %s\n" ,
303
+ __func__ , slot_name (slot ));
293
304
294
305
retval = slot -> hpc_ops -> get_cur_bus_speed (slot , value );
295
306
if (retval < 0 )
@@ -320,15 +331,14 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
320
331
321
332
ctrl = kzalloc (sizeof (* ctrl ), GFP_KERNEL );
322
333
if (!ctrl ) {
323
- err ( "%s : out of memory\n" , __func__ );
334
+ dev_err ( & pdev -> dev , "%s : out of memory\n" , __func__ );
324
335
goto err_out_none ;
325
336
}
326
337
INIT_LIST_HEAD (& ctrl -> slot_list );
327
338
328
339
rc = shpc_init (ctrl , pdev );
329
340
if (rc ) {
330
- dbg ("%s: controller initialization failed\n" ,
331
- SHPC_MODULE_NAME );
341
+ ctrl_dbg (ctrl , "controller initialization failed\n" );
332
342
goto err_out_free_ctrl ;
333
343
}
334
344
@@ -337,7 +347,7 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
337
347
/* Setup the slot information structures */
338
348
rc = init_slots (ctrl );
339
349
if (rc ) {
340
- err ( "%s: slot initialization failed\n", SHPC_MODULE_NAME );
350
+ ctrl_err ( ctrl , " slot initialization failed\n" );
341
351
goto err_out_release_ctlr ;
342
352
}
343
353
0 commit comments