aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2016-08-16 09:34:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-10 11:22:23 -0500
commit6751667a29d6fd64afb9ce30567ad616b68ed789 (patch)
tree128403d3fb1187222f340b3676310ef376d17699 /drivers/base/core.c
parentbaa8809f60971d10220dfe79248f54b2b265f003 (diff)
driver core: Add deferred_probe attribute to devices in sysfs
It is sometimes useful to know that a device is on the deferred probe list rather than, say, not having a driver available. Expose this information to user-space. Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index d0c9df5cdd9e..b8b2f6105476 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1060,8 +1060,14 @@ static int device_add_attrs(struct device *dev)
1060 goto err_remove_dev_groups; 1060 goto err_remove_dev_groups;
1061 } 1061 }
1062 1062
1063 error = device_create_file(dev, &dev_attr_deferred_probe);
1064 if (error)
1065 goto err_remove_online;
1066
1063 return 0; 1067 return 0;
1064 1068
1069 err_remove_online:
1070 device_remove_file(dev, &dev_attr_online);
1065 err_remove_dev_groups: 1071 err_remove_dev_groups:
1066 device_remove_groups(dev, dev->groups); 1072 device_remove_groups(dev, dev->groups);
1067 err_remove_type_groups: 1073 err_remove_type_groups:
@@ -1079,6 +1085,7 @@ static void device_remove_attrs(struct device *dev)
1079 struct class *class = dev->class; 1085 struct class *class = dev->class;
1080 const struct device_type *type = dev->type; 1086 const struct device_type *type = dev->type;
1081 1087
1088 device_remove_file(dev, &dev_attr_deferred_probe);
1082 device_remove_file(dev, &dev_attr_online); 1089 device_remove_file(dev, &dev_attr_online);
1083 device_remove_groups(dev, dev->groups); 1090 device_remove_groups(dev, dev->groups);
1084 1091