[U-Boot] [PATCH v1] clk: clk-uclass: Check ops pointer before use it

Stephen Warren swarren at wwwdotorg.org
Wed Aug 17 17:59:03 CEST 2016


On 08/17/2016 01:05 AM, Wenyou Yang wrote:
> Add check ops pointer before use it. Otherwise, it will cause
> the runtime error for the clk devices without ops callback.

Other uclasses like reset, power domain, and mailbox don't do this. All 
drivers must have an ops pointer, or they can't be useful. I'm not sure 
this patch is necessary. Is it just a debugging aid so if the driver 
writer forgets to set the ops pointer the system will error out rather 
than crashing? If so, a post-bind hook in the uclass that refuses the 
driver if it hasn't set the ops pointer would be better.


More information about the U-Boot mailing list