diff options
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r-- | drivers/acpi/pci_root.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 0984a1ee24ed..a860efa2c562 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -98,11 +98,12 @@ void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) | |||
98 | 98 | ||
99 | struct acpi_pci_driver **pptr = &sub_driver; | 99 | struct acpi_pci_driver **pptr = &sub_driver; |
100 | while (*pptr) { | 100 | while (*pptr) { |
101 | if (*pptr != driver) | 101 | if (*pptr == driver) |
102 | continue; | 102 | break; |
103 | *pptr = (*pptr)->next; | 103 | pptr = &(*pptr)->next; |
104 | break; | ||
105 | } | 104 | } |
105 | BUG_ON(!*pptr); | ||
106 | *pptr = (*pptr)->next; | ||
106 | 107 | ||
107 | if (!driver->remove) | 108 | if (!driver->remove) |
108 | return; | 109 | return; |
@@ -119,7 +120,7 @@ EXPORT_SYMBOL(acpi_pci_unregister_driver); | |||
119 | static acpi_status | 120 | static acpi_status |
120 | get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) | 121 | get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) |
121 | { | 122 | { |
122 | int *busnr = (int *)data; | 123 | int *busnr = data; |
123 | struct acpi_resource_address64 address; | 124 | struct acpi_resource_address64 address; |
124 | 125 | ||
125 | if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && | 126 | if (resource->type != ACPI_RESOURCE_TYPE_ADDRESS16 && |
@@ -164,10 +165,9 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
164 | if (!device) | 165 | if (!device) |
165 | return -EINVAL; | 166 | return -EINVAL; |
166 | 167 | ||
167 | root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); | 168 | root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); |
168 | if (!root) | 169 | if (!root) |
169 | return -ENOMEM; | 170 | return -ENOMEM; |
170 | memset(root, 0, sizeof(struct acpi_pci_root)); | ||
171 | INIT_LIST_HEAD(&root->node); | 171 | INIT_LIST_HEAD(&root->node); |
172 | 172 | ||
173 | root->device = device; | 173 | root->device = device; |
@@ -331,7 +331,7 @@ static int acpi_pci_root_remove(struct acpi_device *device, int type) | |||
331 | if (!device || !acpi_driver_data(device)) | 331 | if (!device || !acpi_driver_data(device)) |
332 | return -EINVAL; | 332 | return -EINVAL; |
333 | 333 | ||
334 | root = (struct acpi_pci_root *)acpi_driver_data(device); | 334 | root = acpi_driver_data(device); |
335 | 335 | ||
336 | kfree(root); | 336 | kfree(root); |
337 | 337 | ||