diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 14:52:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 14:52:52 -0400 |
commit | 08acd4f8af42affd8cbed81cc1b69fa12ddb213f (patch) | |
tree | 988d15db6233b20db6a500cd5f590c6d2041462d /drivers/pnp/driver.c | |
parent | ccf2779544eecfcc5447e2028d1029b6d4ff7bb6 (diff) | |
parent | 008238b54ac2350babf195084ecedbcf7851a202 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (179 commits)
ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
acpi: fix section mismatch warning in pnpacpi
intel_menlo: fix build warning
ACPI: Cleanup: Remove unneeded, multiple local dummy variables
ACPI: video - fix permissions on some proc entries
ACPI: video - properly handle errors when registering proc elements
ACPI: video - do not store invalid entries in attached_array list
ACPI: re-name acpi_pm_ops to acpi_suspend_ops
ACER_WMI/ASUS_LAPTOP: fix build bug
thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
ACPI: check a return value correctly in acpi_power_get_context()
#if 0 acpi/bay.c:eject_removable_drive()
eeepc-laptop: add hwmon fan control
eeepc-laptop: add backlight
eeepc-laptop: add base driver
ACPI: thinkpad-acpi: bump up version to 0.20
ACPI: thinkpad-acpi: fix selects in Kconfig
ACPI: thinkpad-acpi: use a private workqueue
ACPI: thinkpad-acpi: fluff really minor fix
ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation
...
Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c
manually.
Diffstat (limited to 'drivers/pnp/driver.c')
-rw-r--r-- | drivers/pnp/driver.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index e85cbf116db1..d3f869ee1d92 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -226,22 +226,36 @@ void pnp_unregister_driver(struct pnp_driver *drv) | |||
226 | 226 | ||
227 | /** | 227 | /** |
228 | * pnp_add_id - adds an EISA id to the specified device | 228 | * pnp_add_id - adds an EISA id to the specified device |
229 | * @id: pointer to a pnp_id structure | ||
230 | * @dev: pointer to the desired device | 229 | * @dev: pointer to the desired device |
230 | * @id: pointer to an EISA id string | ||
231 | */ | 231 | */ |
232 | int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) | 232 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id) |
233 | { | 233 | { |
234 | struct pnp_id *ptr; | 234 | struct pnp_id *dev_id, *ptr; |
235 | 235 | ||
236 | id->next = NULL; | 236 | dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); |
237 | if (!dev_id) | ||
238 | return NULL; | ||
239 | |||
240 | dev_id->id[0] = id[0]; | ||
241 | dev_id->id[1] = id[1]; | ||
242 | dev_id->id[2] = id[2]; | ||
243 | dev_id->id[3] = tolower(id[3]); | ||
244 | dev_id->id[4] = tolower(id[4]); | ||
245 | dev_id->id[5] = tolower(id[5]); | ||
246 | dev_id->id[6] = tolower(id[6]); | ||
247 | dev_id->id[7] = '\0'; | ||
248 | |||
249 | dev_id->next = NULL; | ||
237 | ptr = dev->id; | 250 | ptr = dev->id; |
238 | while (ptr && ptr->next) | 251 | while (ptr && ptr->next) |
239 | ptr = ptr->next; | 252 | ptr = ptr->next; |
240 | if (ptr) | 253 | if (ptr) |
241 | ptr->next = id; | 254 | ptr->next = dev_id; |
242 | else | 255 | else |
243 | dev->id = id; | 256 | dev->id = dev_id; |
244 | return 0; | 257 | |
258 | return dev_id; | ||
245 | } | 259 | } |
246 | 260 | ||
247 | EXPORT_SYMBOL(pnp_register_driver); | 261 | EXPORT_SYMBOL(pnp_register_driver); |