From: Simon Glass Date: Sat, 12 Mar 2016 05:06:49 +0000 (-0700) Subject: syscon: Avoid returning a device on failure X-Git-Tag: v2016.05-rc1~302 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=532f2435cfe94e54e01ba68572daa853d7752afa;p=u-boot 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 Reviewed-by: Bin Meng --- diff --git a/drivers/core/syscon-uclass.c b/drivers/core/syscon-uclass.c index a0666d0bac..e03f46af57 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;