On 04/08/2013 12:36 PM, Guennadi Liakhovetski wrote:
> On Mon, 18 Mar 2013, Sylwester Nawrocki wrote:
>
> [snip]
>
>>> +unsigned long v4l2_clk_get_rate(struct v4l2_clk *clk)
>>> +{
>>> + if (!clk->ops->get_rate)
>>> + return -ENOSYS;
>>
>> I guess we should just WARN if this callback is null and return 0
>> or return value type of this function needs to be 'long'. Otherwise
>> we'll get insanely large frequency value by casting this error code
>> to unsigned long.
>
> Comparing to the CCF: AFAICS, they do the same, you're supposed to use
> IS_ERR_VALUE() on the clock rate, obtained from clk_get_rate().
Hmm, that might work. Nevertheless I consider that a pretty horrible
pattern. I couldn't find any references to IS_ERR_VALUE in the clock
code though. Only that 0 is returned when clk is NULL.
Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html