[U-Boot] [PATCH 1/1] video: rk3399_mipi: correct error checking

Dr. Philipp Tomsich philipp.tomsich at theobroma-systems.com
Mon Mar 19 17:22:20 UTC 2018


Punit,

> On 19 Mar 2018, at 18:21, Punit Agrawal <punit.agrawal at arm.com> wrote:
> 
> Heinrich Schuchardt <xypron.glpk at gmx.de <mailto:xypron.glpk at gmx.de>> writes:
> 
>> Pointers are never negative. Use macro IS_ERR() for checking.
>> cf. rk3288_mipi.c
>> 
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>> ---
>> drivers/video/rockchip/rk3399_mipi.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/video/rockchip/rk3399_mipi.c b/drivers/video/rockchip/rk3399_mipi.c
>> index 9ef202bf09..7560e0c07b 100644
>> --- a/drivers/video/rockchip/rk3399_mipi.c
>> +++ b/drivers/video/rockchip/rk3399_mipi.c
>> @@ -128,7 +128,7 @@ static int rk_mipi_ofdata_to_platdata(struct udevice *dev)
>> 	struct rk_mipi_priv *priv = dev_get_priv(dev);
>> 
>> 	priv->grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
>> -	if (priv->grf <= 0) {
>> +	if (!priv->grf || IS_ERR(priv->grf)) {
> 
> The above two checks can be combined into IS_ERR_OR_NULL().

Please submit a patch and I’ll squash it onto this one.

Thanks,
Philipp.

> 
>> 		debug("%s: Get syscon grf failed (ret=%p)\n",
>> 		      __func__, priv->grf);
>> 		return  -ENXIO;



More information about the U-Boot mailing list