[PATCH v2] ARM: davinci: da8xx: Fix sleeping function called from invalid context

Alexandre Bailon abailon at baylibre.com
Thu Dec 1 09:04:09 PST 2016


On 12/01/2016 03:59 PM, Arnd Bergmann wrote:
> On Thursday, December 1, 2016 7:47:12 PM CET Sekhar Nori wrote:
>>
>>> @@ -287,9 +281,15 @@ int __init da8xx_register_usb20_phy_clk(bool use_usb_refclkin)
>>>       struct clk *parent;
>>>       int ret = 0;
>>>  
>>> +     usb20_clk = clk_get(&da8xx_usb20_dev.dev, "usb20");
>>> +     if (IS_ERR(usb20_clk))
>>> +             return PTR_ERR(parent);
>>
>> Typo here. Should be PTR_ERR(usb20_clk)
> 
> I found that doing
> 
> 		err = PTR_ERR_OR_ZERO(usb20_clk);
> 		if (err)
> 			return err;
> 
> is less error-prone and leads to better object code.
> 
> 	Arnd
> 
I didn't know that one.
I will use it.

Thanks,
Alexandre



More information about the linux-arm-kernel mailing list