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;