ACPI: Print diagnostic messages if device links cannot be created
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Aug 2013 14:19:19 +0000 (16:19 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Aug 2013 22:54:52 +0000 (00:54 +0200)
Although the device links created by acpi_bind_one() are not
essential from the kernel functionality point of view, user space
may be confused when they are missing, so print diagnostic messages
to the kernel log if they can't be created.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
drivers/acpi/glue.c

index f3ead0ce37ab455e92e625d084b9b5e79e39609c..94672297e1b1bc6f3b482b3e0985cda28786ee10 100644 (file)
@@ -252,8 +252,15 @@ int acpi_bind_one(struct device *dev, acpi_handle handle)
        acpi_physnode_link_name(physical_node_name, node_id);
        retval = sysfs_create_link(&acpi_dev->dev.kobj, &dev->kobj,
                                   physical_node_name);
+       if (retval)
+               dev_err(&acpi_dev->dev, "Failed to create link %s (%d)\n",
+                       physical_node_name, retval);
+
        retval = sysfs_create_link(&dev->kobj, &acpi_dev->dev.kobj,
                                   "firmware_node");
+       if (retval)
+               dev_err(dev, "Failed to create link firmware_node (%d)\n",
+                       retval);
 
        mutex_unlock(&acpi_dev->physical_node_lock);