[U-Boot] [PATCH v2 01/50] dm: clk: Add support for decoding clocks from the device tree
Masahiro Yamada
yamada.masahiro at socionext.com
Wed Jan 20 06:38:15 CET 2016
Hi Simon,
>>>
>>> +/**
>>> + * clk_get_by_index() - look up a clock referenced by a device
>>> + *
>>> + * Parse a device's 'clocks' list, returning information on the indexed clock,
>>> + * ensuring that it is activated.
>>> + *
>>> + * @dev: Device containing the clock reference
>>> + * @index: Clock index to return (0 = first)
>>> + * @clk_devp: Returns clock device
>>> + * @return: Peripheral ID for the device to control. This is the first
>>> + * argument after the clock node phandle. If there is no arguemnt,
>>> + * returns 0. Return -ve error code on any error
>>> + */
>>> +int clk_get_by_index(struct udevice *dev, int index, struct udevice **clk_devp);
>>> #endif /* _CLK_H_ */
>>
>>
>> I want #ifdef in the header too, like mine
>> http://patchwork.ozlabs.org/patch/566812/
>
> I am not keen on that idea since it clutters up header files and we'll
> get a link error anyway if something is missing. Anyway, I've added
> it.
I am afraid there is misunderstanding here.
Please see my patch carefully.
What I mean is like this:
#if ...
declaration of function prototype
#else
static inline empty function
#endif
This is a common technique to avoid a link error.
--
Best Regards
Masahiro Yamada
More information about the U-Boot
mailing list