David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Link physical devices with ACPI devices support |
| 3 | * |
| 4 | * Copyright (c) 2005 David Shaohua Li <shaohua.li@intel.com> |
| 5 | * Copyright (c) 2005 Intel Corp. |
| 6 | * |
| 7 | * This file is released under the GPLv2. |
| 8 | */ |
Paul Gortmaker | 214f2c9 | 2011-10-26 16:22:14 -0400 | [diff] [blame] | 9 | #include <linux/export.h> |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 10 | #include <linux/init.h> |
| 11 | #include <linux/list.h> |
| 12 | #include <linux/device.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 13 | #include <linux/slab.h> |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 14 | #include <linux/rwsem.h> |
| 15 | #include <linux/acpi.h> |
| 16 | |
Len Brown | a192a95 | 2009-07-28 16:45:54 -0400 | [diff] [blame] | 17 | #include "internal.h" |
| 18 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 19 | #define ACPI_GLUE_DEBUG 0 |
| 20 | #if ACPI_GLUE_DEBUG |
| 21 | #define DBG(x...) printk(PREFIX x) |
| 22 | #else |
Dave Jones | 4ebf83c | 2007-07-09 11:33:14 -0700 | [diff] [blame] | 23 | #define DBG(x...) do { } while(0) |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 24 | #endif |
| 25 | static LIST_HEAD(bus_type_list); |
| 26 | static DECLARE_RWSEM(bus_type_sem); |
| 27 | |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 28 | #define PHYSICAL_NODE_STRING "physical_node" |
| 29 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 30 | int register_acpi_bus_type(struct acpi_bus_type *type) |
| 31 | { |
| 32 | if (acpi_disabled) |
| 33 | return -ENODEV; |
| 34 | if (type && type->bus && type->find_device) { |
| 35 | down_write(&bus_type_sem); |
| 36 | list_add_tail(&type->list, &bus_type_list); |
| 37 | up_write(&bus_type_sem); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 38 | printk(KERN_INFO PREFIX "bus type %s registered\n", |
| 39 | type->bus->name); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 40 | return 0; |
| 41 | } |
| 42 | return -ENODEV; |
| 43 | } |
Jeff Garzik | 91e4d5a | 2012-07-25 14:24:13 -0400 | [diff] [blame] | 44 | EXPORT_SYMBOL_GPL(register_acpi_bus_type); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 45 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 46 | int unregister_acpi_bus_type(struct acpi_bus_type *type) |
| 47 | { |
| 48 | if (acpi_disabled) |
| 49 | return 0; |
| 50 | if (type) { |
| 51 | down_write(&bus_type_sem); |
| 52 | list_del_init(&type->list); |
| 53 | up_write(&bus_type_sem); |
Len Brown | 4be44fc | 2005-08-05 00:44:28 -0400 | [diff] [blame] | 54 | printk(KERN_INFO PREFIX "ACPI bus type %s unregistered\n", |
| 55 | type->bus->name); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 56 | return 0; |
| 57 | } |
| 58 | return -ENODEV; |
| 59 | } |
Jeff Garzik | 91e4d5a | 2012-07-25 14:24:13 -0400 | [diff] [blame] | 60 | EXPORT_SYMBOL_GPL(unregister_acpi_bus_type); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 61 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 62 | static struct acpi_bus_type *acpi_get_bus_type(struct bus_type *type) |
| 63 | { |
| 64 | struct acpi_bus_type *tmp, *ret = NULL; |
| 65 | |
| 66 | down_read(&bus_type_sem); |
| 67 | list_for_each_entry(tmp, &bus_type_list, list) { |
| 68 | if (tmp->bus == type) { |
| 69 | ret = tmp; |
| 70 | break; |
| 71 | } |
| 72 | } |
| 73 | up_read(&bus_type_sem); |
| 74 | return ret; |
| 75 | } |
| 76 | |
| 77 | static int acpi_find_bridge_device(struct device *dev, acpi_handle * handle) |
| 78 | { |
| 79 | struct acpi_bus_type *tmp; |
| 80 | int ret = -ENODEV; |
| 81 | |
| 82 | down_read(&bus_type_sem); |
| 83 | list_for_each_entry(tmp, &bus_type_list, list) { |
| 84 | if (tmp->find_bridge && !tmp->find_bridge(dev, handle)) { |
| 85 | ret = 0; |
| 86 | break; |
| 87 | } |
| 88 | } |
| 89 | up_read(&bus_type_sem); |
| 90 | return ret; |
| 91 | } |
| 92 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 93 | /* Get device's handler per its address under its parent */ |
| 94 | struct acpi_find_child { |
| 95 | acpi_handle handle; |
Lin Ming | 439913f | 2010-01-28 10:53:19 +0800 | [diff] [blame] | 96 | u64 address; |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | static acpi_status |
| 100 | do_acpi_find_child(acpi_handle handle, u32 lvl, void *context, void **rv) |
| 101 | { |
| 102 | acpi_status status; |
| 103 | struct acpi_device_info *info; |
Jan Engelhardt | 50dd096 | 2006-10-01 00:28:50 +0200 | [diff] [blame] | 104 | struct acpi_find_child *find = context; |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 105 | |
Bob Moore | 15b8dd5 | 2009-06-29 13:39:29 +0800 | [diff] [blame] | 106 | status = acpi_get_object_info(handle, &info); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 107 | if (ACPI_SUCCESS(status)) { |
Zhao Yakui | 108029f | 2010-07-13 03:36:08 +0000 | [diff] [blame] | 108 | if ((info->address == find->address) |
| 109 | && (info->valid & ACPI_VALID_ADR)) |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 110 | find->handle = handle; |
Bob Moore | 15b8dd5 | 2009-06-29 13:39:29 +0800 | [diff] [blame] | 111 | kfree(info); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 112 | } |
| 113 | return AE_OK; |
| 114 | } |
| 115 | |
Lin Ming | 439913f | 2010-01-28 10:53:19 +0800 | [diff] [blame] | 116 | acpi_handle acpi_get_child(acpi_handle parent, u64 address) |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 117 | { |
| 118 | struct acpi_find_child find = { NULL, address }; |
| 119 | |
| 120 | if (!parent) |
| 121 | return NULL; |
| 122 | acpi_walk_namespace(ACPI_TYPE_DEVICE, parent, |
Lin Ming | 2263576 | 2009-11-13 10:06:08 +0800 | [diff] [blame] | 123 | 1, do_acpi_find_child, NULL, &find, NULL); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 124 | return find.handle; |
| 125 | } |
| 126 | |
| 127 | EXPORT_SYMBOL(acpi_get_child); |
| 128 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 129 | static int acpi_bind_one(struct device *dev, acpi_handle handle) |
| 130 | { |
David Brownell | 1071695 | 2008-02-22 21:54:24 -0800 | [diff] [blame] | 131 | struct acpi_device *acpi_dev; |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 132 | acpi_status status; |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 133 | struct acpi_device_physical_node *physical_node, *pn; |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 134 | char physical_node_name[sizeof(PHYSICAL_NODE_STRING) + 2]; |
| 135 | int retval = -EINVAL; |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 136 | |
Rafael J. Wysocki | 95f8a08 | 2012-11-21 00:21:50 +0100 | [diff] [blame] | 137 | if (ACPI_HANDLE(dev)) { |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 138 | if (handle) { |
| 139 | dev_warn(dev, "ACPI handle is already set\n"); |
| 140 | return -EINVAL; |
| 141 | } else { |
Rafael J. Wysocki | 95f8a08 | 2012-11-21 00:21:50 +0100 | [diff] [blame] | 142 | handle = ACPI_HANDLE(dev); |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 143 | } |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 144 | } |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 145 | if (!handle) |
| 146 | return -EINVAL; |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 147 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 148 | get_device(dev); |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 149 | status = acpi_bus_get_device(handle, &acpi_dev); |
| 150 | if (ACPI_FAILURE(status)) |
| 151 | goto err; |
| 152 | |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 153 | physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL); |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 154 | if (!physical_node) { |
| 155 | retval = -ENOMEM; |
| 156 | goto err; |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 157 | } |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 158 | |
| 159 | mutex_lock(&acpi_dev->physical_node_lock); |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 160 | |
| 161 | /* Sanity check. */ |
| 162 | list_for_each_entry(pn, &acpi_dev->physical_node_list, node) |
| 163 | if (pn->dev == dev) { |
| 164 | dev_warn(dev, "Already associated with ACPI node\n"); |
| 165 | goto err_free; |
| 166 | } |
| 167 | |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 168 | /* allocate physical node id according to physical_node_id_bitmap */ |
| 169 | physical_node->node_id = |
| 170 | find_first_zero_bit(acpi_dev->physical_node_id_bitmap, |
| 171 | ACPI_MAX_PHYSICAL_NODE); |
| 172 | if (physical_node->node_id >= ACPI_MAX_PHYSICAL_NODE) { |
| 173 | retval = -ENOSPC; |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 174 | goto err_free; |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | set_bit(physical_node->node_id, acpi_dev->physical_node_id_bitmap); |
| 178 | physical_node->dev = dev; |
| 179 | list_add_tail(&physical_node->node, &acpi_dev->physical_node_list); |
| 180 | acpi_dev->physical_node_count++; |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 181 | |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 182 | mutex_unlock(&acpi_dev->physical_node_lock); |
| 183 | |
Rafael J. Wysocki | 95f8a08 | 2012-11-21 00:21:50 +0100 | [diff] [blame] | 184 | if (!ACPI_HANDLE(dev)) |
| 185 | ACPI_HANDLE_SET(dev, acpi_dev->handle); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 186 | |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 187 | if (!physical_node->node_id) |
| 188 | strcpy(physical_node_name, PHYSICAL_NODE_STRING); |
| 189 | else |
| 190 | sprintf(physical_node_name, |
| 191 | "physical_node%d", physical_node->node_id); |
| 192 | retval = sysfs_create_link(&acpi_dev->dev.kobj, &dev->kobj, |
| 193 | physical_node_name); |
| 194 | retval = sysfs_create_link(&dev->kobj, &acpi_dev->dev.kobj, |
| 195 | "firmware_node"); |
David Brownell | 1071695 | 2008-02-22 21:54:24 -0800 | [diff] [blame] | 196 | |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 197 | if (acpi_dev->wakeup.flags.valid) |
| 198 | device_set_wakeup_capable(dev, true); |
David Brownell | 1071695 | 2008-02-22 21:54:24 -0800 | [diff] [blame] | 199 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 200 | return 0; |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 201 | |
| 202 | err: |
Rafael J. Wysocki | 95f8a08 | 2012-11-21 00:21:50 +0100 | [diff] [blame] | 203 | ACPI_HANDLE_SET(dev, NULL); |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 204 | put_device(dev); |
| 205 | return retval; |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 206 | |
| 207 | err_free: |
| 208 | mutex_unlock(&acpi_dev->physical_node_lock); |
| 209 | kfree(physical_node); |
| 210 | goto err; |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 211 | } |
| 212 | |
| 213 | static int acpi_unbind_one(struct device *dev) |
| 214 | { |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 215 | struct acpi_device_physical_node *entry; |
| 216 | struct acpi_device *acpi_dev; |
| 217 | acpi_status status; |
| 218 | struct list_head *node, *next; |
| 219 | |
Rafael J. Wysocki | 95f8a08 | 2012-11-21 00:21:50 +0100 | [diff] [blame] | 220 | if (!ACPI_HANDLE(dev)) |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 221 | return 0; |
David Brownell | 1071695 | 2008-02-22 21:54:24 -0800 | [diff] [blame] | 222 | |
Rafael J. Wysocki | 95f8a08 | 2012-11-21 00:21:50 +0100 | [diff] [blame] | 223 | status = acpi_bus_get_device(ACPI_HANDLE(dev), &acpi_dev); |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 224 | if (ACPI_FAILURE(status)) |
| 225 | goto err; |
David Brownell | 1071695 | 2008-02-22 21:54:24 -0800 | [diff] [blame] | 226 | |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 227 | mutex_lock(&acpi_dev->physical_node_lock); |
| 228 | list_for_each_safe(node, next, &acpi_dev->physical_node_list) { |
| 229 | char physical_node_name[sizeof(PHYSICAL_NODE_STRING) + 2]; |
David Brownell | 1071695 | 2008-02-22 21:54:24 -0800 | [diff] [blame] | 230 | |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 231 | entry = list_entry(node, struct acpi_device_physical_node, |
| 232 | node); |
| 233 | if (entry->dev != dev) |
| 234 | continue; |
| 235 | |
| 236 | list_del(node); |
| 237 | clear_bit(entry->node_id, acpi_dev->physical_node_id_bitmap); |
| 238 | |
| 239 | acpi_dev->physical_node_count--; |
| 240 | |
| 241 | if (!entry->node_id) |
| 242 | strcpy(physical_node_name, PHYSICAL_NODE_STRING); |
| 243 | else |
| 244 | sprintf(physical_node_name, |
| 245 | "physical_node%d", entry->node_id); |
| 246 | |
| 247 | sysfs_remove_link(&acpi_dev->dev.kobj, physical_node_name); |
| 248 | sysfs_remove_link(&dev->kobj, "firmware_node"); |
Rafael J. Wysocki | 95f8a08 | 2012-11-21 00:21:50 +0100 | [diff] [blame] | 249 | ACPI_HANDLE_SET(dev, NULL); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 250 | /* acpi_bind_one increase refcnt by one */ |
| 251 | put_device(dev); |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 252 | kfree(entry); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 253 | } |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 254 | mutex_unlock(&acpi_dev->physical_node_lock); |
| 255 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 256 | return 0; |
Lan Tianyu | 1033f90 | 2012-08-17 14:44:09 +0800 | [diff] [blame] | 257 | |
| 258 | err: |
| 259 | dev_err(dev, "Oops, 'acpi_handle' corrupt\n"); |
| 260 | return -EINVAL; |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 261 | } |
| 262 | |
| 263 | static int acpi_platform_notify(struct device *dev) |
| 264 | { |
| 265 | struct acpi_bus_type *type; |
| 266 | acpi_handle handle; |
| 267 | int ret = -EINVAL; |
| 268 | |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 269 | ret = acpi_bind_one(dev, NULL); |
| 270 | if (!ret) |
| 271 | goto out; |
| 272 | |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 273 | if (!dev->bus || !dev->parent) { |
| 274 | /* bridge devices genernally haven't bus or parent */ |
| 275 | ret = acpi_find_bridge_device(dev, &handle); |
| 276 | goto end; |
| 277 | } |
| 278 | type = acpi_get_bus_type(dev->bus); |
| 279 | if (!type) { |
Kay Sievers | db1461a | 2009-01-25 23:40:56 +0100 | [diff] [blame] | 280 | DBG("No ACPI bus support for %s\n", dev_name(dev)); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 281 | ret = -EINVAL; |
| 282 | goto end; |
| 283 | } |
| 284 | if ((ret = type->find_device(dev, &handle)) != 0) |
Kay Sievers | db1461a | 2009-01-25 23:40:56 +0100 | [diff] [blame] | 285 | DBG("Can't get handler for %s\n", dev_name(dev)); |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 286 | end: |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 287 | if (!ret) |
| 288 | acpi_bind_one(dev, handle); |
| 289 | |
Rafael J. Wysocki | f3fd0c8 | 2012-11-21 00:21:39 +0100 | [diff] [blame] | 290 | out: |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 291 | #if ACPI_GLUE_DEBUG |
| 292 | if (!ret) { |
| 293 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
| 294 | |
Mika Westerberg | 06f64c8 | 2012-10-31 22:44:33 +0100 | [diff] [blame] | 295 | acpi_get_name(dev->acpi_handle, ACPI_FULL_PATHNAME, &buffer); |
Kay Sievers | db1461a | 2009-01-25 23:40:56 +0100 | [diff] [blame] | 296 | DBG("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer); |
Len Brown | 02438d8 | 2006-06-30 03:19:10 -0400 | [diff] [blame] | 297 | kfree(buffer.pointer); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 298 | } else |
Kay Sievers | db1461a | 2009-01-25 23:40:56 +0100 | [diff] [blame] | 299 | DBG("Device %s -> No ACPI support\n", dev_name(dev)); |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 300 | #endif |
| 301 | |
| 302 | return ret; |
| 303 | } |
| 304 | |
| 305 | static int acpi_platform_notify_remove(struct device *dev) |
| 306 | { |
| 307 | acpi_unbind_one(dev); |
| 308 | return 0; |
| 309 | } |
| 310 | |
Bjorn Helgaas | 0e46517 | 2009-03-24 16:50:09 -0600 | [diff] [blame] | 311 | int __init init_acpi_device_notify(void) |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 312 | { |
David Shaohua Li | 4e10d12 | 2005-03-18 18:45:35 -0500 | [diff] [blame] | 313 | if (platform_notify || platform_notify_remove) { |
| 314 | printk(KERN_ERR PREFIX "Can't use platform_notify\n"); |
| 315 | return 0; |
| 316 | } |
| 317 | platform_notify = acpi_platform_notify; |
| 318 | platform_notify_remove = acpi_platform_notify_remove; |
| 319 | return 0; |
| 320 | } |