aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-12-08 23:30:10 -0500
committerLen Brown <len.brown@intel.com>2008-12-30 21:10:17 -0500
commit3b8249de43ecf05407888c1ca6ca6e4945ff823c (patch)
treeb3322f9072d24c58a9337953cce534cb6067610e /drivers/acpi
parent21a53283a012f21764f2aaaac9414849e1153d93 (diff)
ACPI: PCI: remove unnecessary null pointer checks
Better to oops and learn about a bug than to silently cover it up. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/pci_irq.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 63a132609991..6c04060d063b 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -178,10 +178,6 @@ acpi_pci_irq_add_entry(acpi_handle handle,
178{ 178{
179 struct acpi_prt_entry *entry = NULL; 179 struct acpi_prt_entry *entry = NULL;
180 180
181
182 if (!prt)
183 return -EINVAL;
184
185 entry = kzalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL); 181 entry = kzalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);
186 if (!entry) 182 if (!entry)
187 return -ENOMEM; 183 return -ENOMEM;
@@ -432,9 +428,6 @@ acpi_pci_irq_derive(struct pci_dev *dev,
432 u8 bridge_pin = 0, orig_pin = pin; 428 u8 bridge_pin = 0, orig_pin = pin;
433 429
434 430
435 if (!dev)
436 return -EINVAL;
437
438 /* 431 /*
439 * Attempt to derive an IRQ for this device from a parent bridge's 432 * Attempt to derive an IRQ for this device from a parent bridge's
440 * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). 433 * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge).
@@ -491,9 +484,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
491 int rc; 484 int rc;
492 485
493 486
494 if (!dev)
495 return -EINVAL;
496
497 pin = dev->pin; 487 pin = dev->pin;
498 if (!pin) { 488 if (!pin) {
499 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 489 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -503,11 +493,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
503 } 493 }
504 pin--; 494 pin--;
505 495
506 if (!dev->bus) {
507 dev_err(&dev->dev, "invalid (NULL) 'bus' field\n");
508 return -ENODEV;
509 }
510
511 /* 496 /*
512 * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT 497 * First we check the PCI IRQ routing table (PRT) for an IRQ. PRT
513 * values override any BIOS-assigned IRQs set during boot. 498 * values override any BIOS-assigned IRQs set during boot.
@@ -586,9 +571,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
586 int polarity = ACPI_ACTIVE_LOW; 571 int polarity = ACPI_ACTIVE_LOW;
587 572
588 573
589 if (!dev || !dev->bus)
590 return;
591
592 pin = dev->pin; 574 pin = dev->pin;
593 if (!pin) 575 if (!pin)
594 return; 576 return;