Lines Matching refs:dev

67 static struct acpi_bus_type *acpi_get_bus_type(struct device *dev)
73 if (tmp->match(dev)) {
163 int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
171 if (ACPI_COMPANION(dev)) {
173 dev_warn(dev, "ACPI companion already set\n");
176 acpi_dev = ACPI_COMPANION(dev);
182 get_device(&acpi_dev->dev);
183 get_device(dev);
200 if (pn->dev == dev) {
203 dev_warn(dev, "Already associated with ACPI node\n");
205 if (ACPI_COMPANION(dev) != acpi_dev)
208 put_device(dev);
209 put_device(&acpi_dev->dev);
219 physical_node->dev = dev;
223 if (!ACPI_COMPANION(dev))
224 ACPI_COMPANION_SET(dev, acpi_dev);
227 retval = sysfs_create_link(&acpi_dev->dev.kobj, &dev->kobj,
230 dev_err(&acpi_dev->dev, "Failed to create link %s (%d)\n",
233 retval = sysfs_create_link(&dev->kobj, &acpi_dev->dev.kobj,
236 dev_err(dev, "Failed to create link firmware_node (%d)\n",
242 device_set_wakeup_capable(dev, true);
247 ACPI_COMPANION_SET(dev, NULL);
248 put_device(dev);
249 put_device(&acpi_dev->dev);
254 int acpi_unbind_one(struct device *dev)
256 struct acpi_device *acpi_dev = ACPI_COMPANION(dev);
265 if (entry->dev == dev) {
272 sysfs_remove_link(&acpi_dev->dev.kobj, physnode_name);
273 sysfs_remove_link(&dev->kobj, "firmware_node");
274 ACPI_COMPANION_SET(dev, NULL);
276 put_device(dev);
277 put_device(&acpi_dev->dev);
287 static int acpi_platform_notify(struct device *dev)
289 struct acpi_bus_type *type = acpi_get_bus_type(dev);
293 ret = acpi_bind_one(dev, NULL);
297 adev = type->find_companion(dev);
299 DBG("Unable to get handle for %s\n", dev_name(dev));
303 ret = acpi_bind_one(dev, adev);
307 adev = ACPI_COMPANION(dev);
312 type->setup(dev);
314 adev->handler->bind(dev);
321 acpi_get_name(ACPI_HANDLE(dev), ACPI_FULL_PATHNAME, &buffer);
322 DBG("Device %s -> %s\n", dev_name(dev), (char *)buffer.pointer);
325 DBG("Device %s -> No ACPI support\n", dev_name(dev));
331 static int acpi_platform_notify_remove(struct device *dev)
333 struct acpi_device *adev = ACPI_COMPANION(dev);
339 type = acpi_get_bus_type(dev);
341 type->cleanup(dev);
343 adev->handler->unbind(dev);
345 acpi_unbind_one(dev);