mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user