[U-Boot] [PATCH V2 2/2] sunxi: gpio: convert bind() to use driver data

Hans de Goede hdegoede at redhat.com
Thu May 12 19:51:53 CEST 2016


Hi,

On 12-05-16 19:50, Stephen Warren wrote:
> On 05/12/2016 11:43 AM, Simon Glass wrote:
>> Hi Stephen,
>>
>> On 11 May 2016 at 15:26, Stephen Warren <swarren at wwwdotorg.org> wrote:
>>> From: Stephen Warren <swarren at nvidia.com>
>>>
>>> Now that the DM core sets driver_data before calling bind(), this driver
>>> can make use of driver_data to determine the set of child devices to
>>> create, rather than manually re-implementing the matching logic in code.
>
>>> diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c
>
>>> +#define ID(_compat_, _soc_data_) \
>>> +       { .compatible = _compat_, .data = (ulong)&soc_data_##_soc_data_ }
>>> +
>>>   static const struct udevice_id sunxi_gpio_ids[] = {
>>> -       { .compatible = "allwinner,sun4i-a10-pinctrl" },
>>> -       { .compatible = "allwinner,sun5i-a10s-pinctrl" },
>>> -       { .compatible = "allwinner,sun5i-a13-pinctrl" },
> ...
>>> +       ID("allwinner,sun4i-a10-pinctrl",       a_all),
>>> +       ID("allwinner,sun5i-a10s-pinctrl",      a_all),
>>
>> I don't think the #define adds a lot of value - consider removing it
>> an writing things out in full?
>
> I originally did that, but you either end up with lines over 80 columns which checkpatch complains about, or multiple lines per entry which makes it harder to read for such a large table. Still, I can convert it if you want.

I'm fine with keeping the ID define:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Simon, I assume that you will upstream this one through your
tree ?

Regards,

Hans


More information about the U-Boot mailing list