aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/sgi_hotplug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/sgi_hotplug.c')
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index 339bce0403dd..78b6bdbb3a39 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -1,8 +1,5 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005-2006 Silicon Graphics, Inc. All rights reserved. 3 * Copyright (C) 2005-2006 Silicon Graphics, Inc. All rights reserved.
7 * 4 *
8 * This work was based on the 2.4/2.6 kernel development by Dick Reigner. 5 * This work was based on the 2.4/2.6 kernel development by Dick Reigner.
@@ -245,18 +242,18 @@ static int sn_slot_enable(struct hotplug_slot *bss_hotplug_slot,
245 242
246 243
247 if (rc == PCI_SLOT_ALREADY_UP) { 244 if (rc == PCI_SLOT_ALREADY_UP) {
248 dev_dbg(&slot->pci_bus->self->dev, "is already active\n"); 245 pci_dbg(slot->pci_bus->self, "is already active\n");
249 return 1; /* return 1 to user */ 246 return 1; /* return 1 to user */
250 } 247 }
251 248
252 if (rc == PCI_L1_ERR) { 249 if (rc == PCI_L1_ERR) {
253 dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message: %s", 250 pci_dbg(slot->pci_bus->self, "L1 failure %d with message: %s",
254 resp.resp_sub_errno, resp.resp_l1_msg); 251 resp.resp_sub_errno, resp.resp_l1_msg);
255 return -EPERM; 252 return -EPERM;
256 } 253 }
257 254
258 if (rc) { 255 if (rc) {
259 dev_dbg(&slot->pci_bus->self->dev, "insert failed with error %d sub-error %d\n", 256 pci_dbg(slot->pci_bus->self, "insert failed with error %d sub-error %d\n",
260 rc, resp.resp_sub_errno); 257 rc, resp.resp_sub_errno);
261 return -EIO; 258 return -EIO;
262 } 259 }
@@ -281,23 +278,23 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
281 278
282 if ((action == PCI_REQ_SLOT_ELIGIBLE) && 279 if ((action == PCI_REQ_SLOT_ELIGIBLE) &&
283 (rc == PCI_SLOT_ALREADY_DOWN)) { 280 (rc == PCI_SLOT_ALREADY_DOWN)) {
284 dev_dbg(&slot->pci_bus->self->dev, "Slot %s already inactive\n", slot->physical_path); 281 pci_dbg(slot->pci_bus->self, "Slot %s already inactive\n", slot->physical_path);
285 return 1; /* return 1 to user */ 282 return 1; /* return 1 to user */
286 } 283 }
287 284
288 if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) { 285 if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_EMPTY_33MHZ)) {
289 dev_dbg(&slot->pci_bus->self->dev, "Cannot remove last 33MHz card\n"); 286 pci_dbg(slot->pci_bus->self, "Cannot remove last 33MHz card\n");
290 return -EPERM; 287 return -EPERM;
291 } 288 }
292 289
293 if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) { 290 if ((action == PCI_REQ_SLOT_ELIGIBLE) && (rc == PCI_L1_ERR)) {
294 dev_dbg(&slot->pci_bus->self->dev, "L1 failure %d with message \n%s\n", 291 pci_dbg(slot->pci_bus->self, "L1 failure %d with message \n%s\n",
295 resp.resp_sub_errno, resp.resp_l1_msg); 292 resp.resp_sub_errno, resp.resp_l1_msg);
296 return -EPERM; 293 return -EPERM;
297 } 294 }
298 295
299 if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) { 296 if ((action == PCI_REQ_SLOT_ELIGIBLE) && rc) {
300 dev_dbg(&slot->pci_bus->self->dev, "remove failed with error %d sub-error %d\n", 297 pci_dbg(slot->pci_bus->self, "remove failed with error %d sub-error %d\n",
301 rc, resp.resp_sub_errno); 298 rc, resp.resp_sub_errno);
302 return -EIO; 299 return -EIO;
303 } 300 }
@@ -308,12 +305,12 @@ static int sn_slot_disable(struct hotplug_slot *bss_hotplug_slot,
308 if ((action == PCI_REQ_SLOT_DISABLE) && !rc) { 305 if ((action == PCI_REQ_SLOT_DISABLE) && !rc) {
309 pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus); 306 pcibus_info = SN_PCIBUS_BUSSOFT_INFO(slot->pci_bus);
310 pcibus_info->pbi_enabled_devices &= ~(1 << device_num); 307 pcibus_info->pbi_enabled_devices &= ~(1 << device_num);
311 dev_dbg(&slot->pci_bus->self->dev, "remove successful\n"); 308 pci_dbg(slot->pci_bus->self, "remove successful\n");
312 return 0; 309 return 0;
313 } 310 }
314 311
315 if ((action == PCI_REQ_SLOT_DISABLE) && rc) { 312 if ((action == PCI_REQ_SLOT_DISABLE) && rc) {
316 dev_dbg(&slot->pci_bus->self->dev, "remove failed rc = %d\n", rc); 313 pci_dbg(slot->pci_bus->self, "remove failed rc = %d\n", rc);
317 } 314 }
318 315
319 return rc; 316 return rc;
@@ -366,7 +363,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
366 num_funcs = pci_scan_slot(slot->pci_bus, 363 num_funcs = pci_scan_slot(slot->pci_bus,
367 PCI_DEVFN(slot->device_num + 1, 0)); 364 PCI_DEVFN(slot->device_num + 1, 0));
368 if (!num_funcs) { 365 if (!num_funcs) {
369 dev_dbg(&slot->pci_bus->self->dev, "no device in slot\n"); 366 pci_dbg(slot->pci_bus->self, "no device in slot\n");
370 mutex_unlock(&sn_hotplug_mutex); 367 mutex_unlock(&sn_hotplug_mutex);
371 return -ENODEV; 368 return -ENODEV;
372 } 369 }
@@ -412,7 +409,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
412 phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion); 409 phandle = acpi_device_handle(PCI_CONTROLLER(slot->pci_bus)->companion);
413 410
414 if (acpi_bus_get_device(phandle, &pdevice)) { 411 if (acpi_bus_get_device(phandle, &pdevice)) {
415 dev_dbg(&slot->pci_bus->self->dev, "no parent device, assuming NULL\n"); 412 pci_dbg(slot->pci_bus->self, "no parent device, assuming NULL\n");
416 pdevice = NULL; 413 pdevice = NULL;
417 } 414 }
418 415
@@ -463,9 +460,9 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
463 mutex_unlock(&sn_hotplug_mutex); 460 mutex_unlock(&sn_hotplug_mutex);
464 461
465 if (rc == 0) 462 if (rc == 0)
466 dev_dbg(&slot->pci_bus->self->dev, "insert operation successful\n"); 463 pci_dbg(slot->pci_bus->self, "insert operation successful\n");
467 else 464 else
468 dev_dbg(&slot->pci_bus->self->dev, "insert operation failed rc = %d\n", rc); 465 pci_dbg(slot->pci_bus->self, "insert operation failed rc = %d\n", rc);
469 466
470 return rc; 467 return rc;
471} 468}
@@ -643,16 +640,16 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
643 if (rc) 640 if (rc)
644 goto register_err; 641 goto register_err;
645 } 642 }
646 dev_dbg(&pci_bus->self->dev, "Registered bus with hotplug\n"); 643 pci_dbg(pci_bus->self, "Registered bus with hotplug\n");
647 return rc; 644 return rc;
648 645
649register_err: 646register_err:
650 dev_dbg(&pci_bus->self->dev, "bus failed to register with err = %d\n", 647 pci_dbg(pci_bus->self, "bus failed to register with err = %d\n",
651 rc); 648 rc);
652 649
653alloc_err: 650alloc_err:
654 if (rc == -ENOMEM) 651 if (rc == -ENOMEM)
655 dev_dbg(&pci_bus->self->dev, "Memory allocation error\n"); 652 pci_dbg(pci_bus->self, "Memory allocation error\n");
656 653
657 /* destroy THIS element */ 654 /* destroy THIS element */
658 if (bss_hotplug_slot) 655 if (bss_hotplug_slot)
@@ -685,10 +682,10 @@ static int __init sn_pci_hotplug_init(void)
685 682
686 rc = sn_pci_bus_valid(pci_bus); 683 rc = sn_pci_bus_valid(pci_bus);
687 if (rc != 1) { 684 if (rc != 1) {
688 dev_dbg(&pci_bus->self->dev, "not a valid hotplug bus\n"); 685 pci_dbg(pci_bus->self, "not a valid hotplug bus\n");
689 continue; 686 continue;
690 } 687 }
691 dev_dbg(&pci_bus->self->dev, "valid hotplug bus\n"); 688 pci_dbg(pci_bus->self, "valid hotplug bus\n");
692 689
693 rc = sn_hotplug_slot_register(pci_bus); 690 rc = sn_hotplug_slot_register(pci_bus);
694 if (!rc) { 691 if (!rc) {