aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/glue.c16
-rw-r--r--drivers/acpi/scan.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 3e75d6e5a469..01551840d236 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -134,12 +134,12 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
134 char physical_node_name[sizeof(PHYSICAL_NODE_STRING) + 2]; 134 char physical_node_name[sizeof(PHYSICAL_NODE_STRING) + 2];
135 int retval = -EINVAL; 135 int retval = -EINVAL;
136 136
137 if (dev->acpi_handle) { 137 if (ACPI_HANDLE(dev)) {
138 if (handle) { 138 if (handle) {
139 dev_warn(dev, "ACPI handle is already set\n"); 139 dev_warn(dev, "ACPI handle is already set\n");
140 return -EINVAL; 140 return -EINVAL;
141 } else { 141 } else {
142 handle = dev->acpi_handle; 142 handle = ACPI_HANDLE(dev);
143 } 143 }
144 } 144 }
145 if (!handle) 145 if (!handle)
@@ -181,8 +181,8 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
181 181
182 mutex_unlock(&acpi_dev->physical_node_lock); 182 mutex_unlock(&acpi_dev->physical_node_lock);
183 183
184 if (!dev->acpi_handle) 184 if (!ACPI_HANDLE(dev))
185 dev->acpi_handle = handle; 185 ACPI_HANDLE_SET(dev, acpi_dev->handle);
186 186
187 if (!physical_node->node_id) 187 if (!physical_node->node_id)
188 strcpy(physical_node_name, PHYSICAL_NODE_STRING); 188 strcpy(physical_node_name, PHYSICAL_NODE_STRING);
@@ -200,7 +200,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
200 return 0; 200 return 0;
201 201
202 err: 202 err:
203 dev->acpi_handle = NULL; 203 ACPI_HANDLE_SET(dev, NULL);
204 put_device(dev); 204 put_device(dev);
205 return retval; 205 return retval;
206 206
@@ -217,10 +217,10 @@ static int acpi_unbind_one(struct device *dev)
217 acpi_status status; 217 acpi_status status;
218 struct list_head *node, *next; 218 struct list_head *node, *next;
219 219
220 if (!dev->acpi_handle) 220 if (!ACPI_HANDLE(dev))
221 return 0; 221 return 0;
222 222
223 status = acpi_bus_get_device(dev->acpi_handle, &acpi_dev); 223 status = acpi_bus_get_device(ACPI_HANDLE(dev), &acpi_dev);
224 if (ACPI_FAILURE(status)) 224 if (ACPI_FAILURE(status))
225 goto err; 225 goto err;
226 226
@@ -246,7 +246,7 @@ static int acpi_unbind_one(struct device *dev)
246 246
247 sysfs_remove_link(&acpi_dev->dev.kobj, physical_node_name); 247 sysfs_remove_link(&acpi_dev->dev.kobj, physical_node_name);
248 sysfs_remove_link(&dev->kobj, "firmware_node"); 248 sysfs_remove_link(&dev->kobj, "firmware_node");
249 dev->acpi_handle = NULL; 249 ACPI_HANDLE_SET(dev, NULL);
250 /* acpi_bind_one increase refcnt by one */ 250 /* acpi_bind_one increase refcnt by one */
251 put_device(dev); 251 put_device(dev);
252 kfree(entry); 252 kfree(entry);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d842569395a9..e92ca67d0e46 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -386,8 +386,8 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
386{ 386{
387 struct acpi_device *adev; 387 struct acpi_device *adev;
388 388
389 if (!ids || !dev->acpi_handle 389 if (!ids || !ACPI_HANDLE(dev)
390 || ACPI_FAILURE(acpi_bus_get_device(dev->acpi_handle, &adev))) 390 || ACPI_FAILURE(acpi_bus_get_device(ACPI_HANDLE(dev), &adev)))
391 return NULL; 391 return NULL;
392 392
393 return __acpi_match_device(adev, ids); 393 return __acpi_match_device(adev, ids);