aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.com>2016-02-15 03:25:06 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2016-02-16 11:28:51 -0500
commit656b8035b0eebcac0172b24ca04e448c70dd047f (patch)
tree9310d64d29e0130957ef33362d34c46392f6b42f /include/linux/device.h
parent17f29d36e4732b91ae299a163d34ed1954500f42 (diff)
ARM: 8524/1: driver cohandle -EPROBE_DEFER from bus_type.match()
Allow implementations of the match() callback in struct bus_type to return errors and if it's -EPROBE_DEFER then queue the device for deferred probing. This is useful to buses such as AMBA in which devices are registered before their matching information can be retrieved from the HW (typically because a clock driver hasn't probed yet). [changed if-else code structure, adjusted documentation to match the code, extended comments] Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 6d6f1fec092f..8f2ec813d215 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -70,8 +70,11 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
70 * @dev_groups: Default attributes of the devices on the bus. 70 * @dev_groups: Default attributes of the devices on the bus.
71 * @drv_groups: Default attributes of the device drivers on the bus. 71 * @drv_groups: Default attributes of the device drivers on the bus.
72 * @match: Called, perhaps multiple times, whenever a new device or driver 72 * @match: Called, perhaps multiple times, whenever a new device or driver
73 * is added for this bus. It should return a nonzero value if the 73 * is added for this bus. It should return a positive value if the
74 * given device can be handled by the given driver. 74 * given device can be handled by the given driver and zero
75 * otherwise. It may also return error code if determining that
76 * the driver supports the device is not possible. In case of
77 * -EPROBE_DEFER it will queue the device for deferred probing.
75 * @uevent: Called when a device is added, removed, or a few other things 78 * @uevent: Called when a device is added, removed, or a few other things
76 * that generate uevents to add the environment variables. 79 * that generate uevents to add the environment variables.
77 * @probe: Called when a new device or driver add to this bus, and callback 80 * @probe: Called when a new device or driver add to this bus, and callback