Lines Matching refs:acpi_dev
163 int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) in acpi_bind_one() argument
172 if (acpi_dev) { in acpi_bind_one()
176 acpi_dev = ACPI_COMPANION(dev); in acpi_bind_one()
179 if (!acpi_dev) in acpi_bind_one()
182 acpi_dev_get(acpi_dev); in acpi_bind_one()
190 mutex_lock(&acpi_dev->physical_node_lock); in acpi_bind_one()
196 physnode_list = &acpi_dev->physical_node_list; in acpi_bind_one()
198 list_for_each_entry(pn, &acpi_dev->physical_node_list, node) { in acpi_bind_one()
201 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_bind_one()
205 if (ACPI_COMPANION(dev) != acpi_dev) in acpi_bind_one()
209 acpi_dev_put(acpi_dev); in acpi_bind_one()
221 acpi_dev->physical_node_count++; in acpi_bind_one()
224 ACPI_COMPANION_SET(dev, acpi_dev); in acpi_bind_one()
227 retval = sysfs_create_link(&acpi_dev->dev.kobj, &dev->kobj, in acpi_bind_one()
230 dev_err(&acpi_dev->dev, "Failed to create link %s (%d)\n", in acpi_bind_one()
233 retval = sysfs_create_link(&dev->kobj, &acpi_dev->dev.kobj, in acpi_bind_one()
239 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_bind_one()
241 if (acpi_dev->wakeup.flags.valid) in acpi_bind_one()
249 acpi_dev_put(acpi_dev); in acpi_bind_one()
256 struct acpi_device *acpi_dev = ACPI_COMPANION(dev); in acpi_unbind_one() local
259 if (!acpi_dev) in acpi_unbind_one()
262 mutex_lock(&acpi_dev->physical_node_lock); in acpi_unbind_one()
264 list_for_each_entry(entry, &acpi_dev->physical_node_list, node) in acpi_unbind_one()
269 acpi_dev->physical_node_count--; in acpi_unbind_one()
272 sysfs_remove_link(&acpi_dev->dev.kobj, physnode_name); in acpi_unbind_one()
277 acpi_dev_put(acpi_dev); in acpi_unbind_one()
282 mutex_unlock(&acpi_dev->physical_node_lock); in acpi_unbind_one()