Lines Matching refs:acpi_dev
228 int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) in acpi_bind_one() argument
237 if (acpi_dev) { in acpi_bind_one()
241 acpi_dev = ACPI_COMPANION(dev); in acpi_bind_one()
244 if (!acpi_dev) in acpi_bind_one()
247 acpi_dev_get(acpi_dev); in acpi_bind_one()
255 mutex_lock(&acpi_dev->physical_node_lock); in acpi_bind_one()
261 physnode_list = &acpi_dev->physical_node_list; in acpi_bind_one()
263 list_for_each_entry(pn, &acpi_dev->physical_node_list, node) { in acpi_bind_one()
266 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_bind_one()
270 if (ACPI_COMPANION(dev) != acpi_dev) in acpi_bind_one()
274 acpi_dev_put(acpi_dev); in acpi_bind_one()
286 acpi_dev->physical_node_count++; in acpi_bind_one()
289 ACPI_COMPANION_SET(dev, acpi_dev); in acpi_bind_one()
292 retval = sysfs_create_link(&acpi_dev->dev.kobj, &dev->kobj, in acpi_bind_one()
295 dev_err(&acpi_dev->dev, "Failed to create link %s (%d)\n", in acpi_bind_one()
298 retval = sysfs_create_link(&dev->kobj, &acpi_dev->dev.kobj, in acpi_bind_one()
304 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_bind_one()
306 if (acpi_dev->wakeup.flags.valid) in acpi_bind_one()
314 acpi_dev_put(acpi_dev); in acpi_bind_one()
321 struct acpi_device *acpi_dev = ACPI_COMPANION(dev); in acpi_unbind_one() local
324 if (!acpi_dev) in acpi_unbind_one()
327 mutex_lock(&acpi_dev->physical_node_lock); in acpi_unbind_one()
329 list_for_each_entry(entry, &acpi_dev->physical_node_list, node) in acpi_unbind_one()
334 acpi_dev->physical_node_count--; in acpi_unbind_one()
337 sysfs_remove_link(&acpi_dev->dev.kobj, physnode_name); in acpi_unbind_one()
342 acpi_dev_put(acpi_dev); in acpi_unbind_one()
347 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_unbind_one()