Re: [PATCH 11/17] soc: ti: pruss: add pruss_get()/put() API

David Lechner
2018-11-26T21:18:36Z

On 11/22/18 5:39 AM, Roger Quadros wrote:

> + pruss = platform_get_drvdata(ppdev);
> + if (pruss)
> + get_device(pruss->dev);
> +
> + return pruss ? pruss : ERR_PTR(-ENODEV);
> +}

This might be a bit easier to follow if we handle the error
path first:

if (!pruss)
return ERR_PTR(-ENODEV);

get_device(pruss->dev);

return pruss;