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>
This commit is contained in:
Родитель
21a53283a0
Коммит
3b8249de43
|
@ -178,10 +178,6 @@ acpi_pci_irq_add_entry(acpi_handle handle,
|
||||||
{
|
{
|
||||||
struct acpi_prt_entry *entry = NULL;
|
struct acpi_prt_entry *entry = NULL;
|
||||||
|
|
||||||
|
|
||||||
if (!prt)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
entry = kzalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);
|
entry = kzalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -432,9 +428,6 @@ acpi_pci_irq_derive(struct pci_dev *dev,
|
||||||
u8 bridge_pin = 0, orig_pin = pin;
|
u8 bridge_pin = 0, orig_pin = pin;
|
||||||
|
|
||||||
|
|
||||||
if (!dev)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Attempt to derive an IRQ for this device from a parent bridge's
|
* Attempt to derive an IRQ for this device from a parent bridge's
|
||||||
* PCI interrupt routing entry (eg. yenta bridge and add-in card bridge).
|
* 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)
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
|
||||||
if (!dev)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
pin = dev->pin;
|
pin = dev->pin;
|
||||||
if (!pin) {
|
if (!pin) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||||
|
@ -503,11 +493,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
|
||||||
}
|
}
|
||||||
pin--;
|
pin--;
|
||||||
|
|
||||||
if (!dev->bus) {
|
|
||||||
dev_err(&dev->dev, "invalid (NULL) 'bus' field\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT
|
* First we check the PCI IRQ routing table (PRT) for an IRQ. PRT
|
||||||
* values override any BIOS-assigned IRQs set during boot.
|
* values override any BIOS-assigned IRQs set during boot.
|
||||||
|
@ -586,9 +571,6 @@ void acpi_pci_irq_disable(struct pci_dev *dev)
|
||||||
int polarity = ACPI_ACTIVE_LOW;
|
int polarity = ACPI_ACTIVE_LOW;
|
||||||
|
|
||||||
|
|
||||||
if (!dev || !dev->bus)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pin = dev->pin;
|
pin = dev->pin;
|
||||||
if (!pin)
|
if (!pin)
|
||||||
return;
|
return;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче