diff options
author | Randy Dunlap <rdunlap@xenotime.net> | 2006-07-12 02:08:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-07-12 12:51:18 -0400 |
commit | 9b6d97b64eff08b368375efcf9c1d01eba582ea2 (patch) | |
tree | 5fbb5ee62e4e28d9c7d6cd80aa8b6b0bcd071b91 /drivers | |
parent | d568df84f987a9321c1f5826a6c8678ef2bb2b70 (diff) |
ACPI: scan: handle kset/kobject errors
Check and handle kset_register() and kobject_register() init errors.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/scan.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 5fcb50c7b778..698a1540e303 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
7 | #include <linux/kernel.h> | ||
7 | #include <linux/acpi.h> | 8 | #include <linux/acpi.h> |
8 | 9 | ||
9 | #include <acpi/acpi_drivers.h> | 10 | #include <acpi/acpi_drivers.h> |
@@ -113,6 +114,8 @@ static struct kset acpi_namespace_kset = { | |||
113 | static void acpi_device_register(struct acpi_device *device, | 114 | static void acpi_device_register(struct acpi_device *device, |
114 | struct acpi_device *parent) | 115 | struct acpi_device *parent) |
115 | { | 116 | { |
117 | int err; | ||
118 | |||
116 | /* | 119 | /* |
117 | * Linkage | 120 | * Linkage |
118 | * ------- | 121 | * ------- |
@@ -138,7 +141,10 @@ static void acpi_device_register(struct acpi_device *device, | |||
138 | device->kobj.parent = &parent->kobj; | 141 | device->kobj.parent = &parent->kobj; |
139 | device->kobj.ktype = &ktype_acpi_ns; | 142 | device->kobj.ktype = &ktype_acpi_ns; |
140 | device->kobj.kset = &acpi_namespace_kset; | 143 | device->kobj.kset = &acpi_namespace_kset; |
141 | kobject_register(&device->kobj); | 144 | err = kobject_register(&device->kobj); |
145 | if (err < 0) | ||
146 | printk(KERN_WARNING "%s: kobject_register error: %d\n", | ||
147 | __FUNCTION__, err); | ||
142 | create_sysfs_device_files(device); | 148 | create_sysfs_device_files(device); |
143 | } | 149 | } |
144 | 150 | ||
@@ -1450,7 +1456,9 @@ static int __init acpi_scan_init(void) | |||
1450 | if (acpi_disabled) | 1456 | if (acpi_disabled) |
1451 | return 0; | 1457 | return 0; |
1452 | 1458 | ||
1453 | kset_register(&acpi_namespace_kset); | 1459 | result = kset_register(&acpi_namespace_kset); |
1460 | if (result < 0) | ||
1461 | printk(KERN_ERR PREFIX "kset_register error: %d\n", result); | ||
1454 | 1462 | ||
1455 | result = bus_register(&acpi_bus_type); | 1463 | result = bus_register(&acpi_bus_type); |
1456 | if (result) { | 1464 | if (result) { |