diff options
author | Simon Glass <sjg@chromium.org> | 2016-03-12 05:06:49 (GMT) |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2016-03-17 02:27:24 (GMT) |
commit | 532f2435cfe94e54e01ba68572daa853d7752afa (patch) | |
tree | 2ad2439fe2a930b8a9cf3b48967f4428b014ae41 /drivers | |
parent | d74d6b444c9f1596c24d492e57af9423efbd113b (diff) | |
download | u-boot-532f2435cfe94e54e01ba68572daa853d7752afa.tar.xz |
syscon: Avoid returning a device on failure
If the device cannot be probed, syscon_get_by_driver_data() will still
return a useful value in its devp parameter. Ensure that it returns NULL
instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/core/syscon-uclass.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c index a0666d0..e03f46a 100644 --- a/drivers/core/syscon-uclass.c +++ b/drivers/core/syscon-uclass.c @@ -38,6 +38,7 @@ int syscon_get_by_driver_data(ulong driver_data, struct udevice **devp) struct uclass *uc; int ret; + *devp = NULL; ret = uclass_get(UCLASS_SYSCON, &uc); if (ret) return ret; |