Lines Matching refs:acpi_dev
164 int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) in acpi_bind_one() argument
173 if (acpi_dev) { in acpi_bind_one()
177 acpi_dev = ACPI_COMPANION(dev); in acpi_bind_one()
180 if (!acpi_dev) in acpi_bind_one()
183 acpi_dev_get(acpi_dev); in acpi_bind_one()
191 mutex_lock(&acpi_dev->physical_node_lock); in acpi_bind_one()
197 physnode_list = &acpi_dev->physical_node_list; in acpi_bind_one()
199 list_for_each_entry(pn, &acpi_dev->physical_node_list, node) { in acpi_bind_one()
202 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_bind_one()
206 if (ACPI_COMPANION(dev) != acpi_dev) in acpi_bind_one()
210 acpi_dev_put(acpi_dev); in acpi_bind_one()
222 acpi_dev->physical_node_count++; in acpi_bind_one()
225 ACPI_COMPANION_SET(dev, acpi_dev); in acpi_bind_one()
228 retval = sysfs_create_link(&acpi_dev->dev.kobj, &dev->kobj, in acpi_bind_one()
231 dev_err(&acpi_dev->dev, "Failed to create link %s (%d)\n", in acpi_bind_one()
234 retval = sysfs_create_link(&dev->kobj, &acpi_dev->dev.kobj, in acpi_bind_one()
240 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_bind_one()
242 if (acpi_dev->wakeup.flags.valid) in acpi_bind_one()
250 acpi_dev_put(acpi_dev); in acpi_bind_one()
257 struct acpi_device *acpi_dev = ACPI_COMPANION(dev); in acpi_unbind_one() local
260 if (!acpi_dev) in acpi_unbind_one()
263 mutex_lock(&acpi_dev->physical_node_lock); in acpi_unbind_one()
265 list_for_each_entry(entry, &acpi_dev->physical_node_list, node) in acpi_unbind_one()
270 acpi_dev->physical_node_count--; in acpi_unbind_one()
273 sysfs_remove_link(&acpi_dev->dev.kobj, physnode_name); in acpi_unbind_one()
278 acpi_dev_put(acpi_dev); in acpi_unbind_one()
283 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_unbind_one()