summaryrefslogtreecommitdiff
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2020-07-13 16:43:22 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-30 09:03:43 +0200
commitd090b70ede02370014a1cf8acd211d1ed0fa9fd9 (patch)
tree82ca03525f2fcdafa671b580fd2db3d9b8398123 /drivers/base/base.h
parenta787e5400a1ceeb0ef92d71ec43aeb35b1fa1334 (diff)
driver core: add deferring probe reason to devices_deferred property
/sys/kernel/debug/devices_deferred property contains list of deferred devices. This list does not contain reason why the driver deferred probe, the patch improves it. The natural place to set the reason is dev_err_probe function introduced recently, ie. if dev_err_probe will be called with -EPROBE_DEFER instead of printk the message will be attached to a deferred device and printed when user reads devices_deferred property. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Mark Brown <broonie@kernel.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Rafael J. Wysocki <rafael@kernel.org> Link: https://lore.kernel.org/r/20200713144324.23654-3-a.hajda@samsung.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 40fb069a8a7e..91cfb8405abd 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -93,6 +93,7 @@ struct device_private {
struct klist_node knode_class;
struct list_head deferred_probe;
struct device_driver *async_driver;
+ char *deferred_probe_reason;
struct device *device;
u8 dead:1;
};
@@ -134,6 +135,8 @@ extern void device_release_driver_internal(struct device *dev,
extern void driver_detach(struct device_driver *drv);
extern int driver_probe_device(struct device_driver *drv, struct device *dev);
extern void driver_deferred_probe_del(struct device *dev);
+extern void device_set_deferred_probe_reason(const struct device *dev,
+ struct va_format *vaf);
static inline int driver_match_device(struct device_driver *drv,
struct device *dev)
{