diff options
author | Simon Glass <sjg@chromium.org> | 2016-01-22 02:43:25 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-01-22 03:42:34 (GMT) |
commit | 0379597e55c17519be36fdf357d4463279da5aca (patch) | |
tree | dfa3d1fa88721295529fb9aeda56e9c71029ae63 /drivers/core/device.c | |
parent | b6517a0d024f7430dac6bed97fac296f42d5c66b (diff) | |
download | u-boot-0379597e55c17519be36fdf357d4463279da5aca.tar.xz |
dm: core: Don't set pinctrl for pinctrl devices
There is sort-of race condition when a pinctrl device is probed. The pinctrl
function is called which may end up using the same device as is being
probed. This results in operations being used before the device is actually
probed.
For now, disallow pinctrl operations on pinctrl devices while probing. An
alternative solution would be to move the operation to later in the
device_probe() function (for pinctrl devices only) but this needs more
thought.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r-- | drivers/core/device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c index 1e5584a..f5def35 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -299,9 +299,11 @@ int device_probe_child(struct udevice *dev, void *parent_priv) /* * Process pinctrl for everything except the root device, and - * continue regardless of the result of pinctrl. + * continue regardless of the result of pinctrl. Don't process pinctrl + * settings for pinctrl devices since the device may not yet be + * probed. */ - if (dev->parent) + if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL) pinctrl_select_state(dev, "default"); ret = uclass_pre_probe_device(dev); |