Re: [PATCH 11/17] soc: ti: pruss: add pruss_get()/put() API
From: David Lechner
Date: Mon Nov 26 2018 - 16:18:43 EST
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;