[U-Boot] [PATCH RFT] gpio: lpc32xx: Use priv data instead of platdata

Albert ARIBAUD albert.aribaud at 3adev.fr
Tue Apr 14 07:45:49 CEST 2015


Hi Axel,

Le Tue, 14 Apr 2015 08:30:03 +0800, Axel Lin <axel.lin at ingics.com> a
écrit :

> 2015-04-13 16:41 GMT+08:00 Albert ARIBAUD <albert.aribaud at 3adev.fr>:
> > Hi Axel,
> >
> > Le Sat, 11 Apr 2015 10:20:08 +0800, Axel Lin <axel.lin at ingics.com> a
> > écrit :
> >
> >> Initially I found this driver has set priv_auto_alloc_size but it actually
> >> never use dev->priv. The U_BOOT_DEVICE(lpc32xx_gpios) does not provide the
> >> platdata and all fields in struct lpc32xx_gpio_platdata are set in probe.
> >> It looks like the struct lpc32xx_gpio_platdata actually should be a priv
> >> data. Thus this patch renames lpc32xx_gpio_platdata to lpc32xx_gpio_priv
> >> and converts all dev_get_platdata() to dev_get_priv().
> >>
> >> Signed-off-by: Axel Lin <axel.lin at ingics.com>
> >> ---
> >> Hi Albert,
> >> I don't have this h/w for testing, so only compile test.
> >> I'd appreciate if you can review and test this patch.
> >> Thanks,
> >> Axel
> >
> > Indeed the driver allocates priv and does not use it. However, I think
> > that the allocation should be removed as useless, rather than plat data
> > be converted to priv. IIUC, priv is a way to apply a single driver to
> > several similar devices, and LPC32XX only has one GPIO device.
> 
> Hi Albert,
> 
> I think it's fine to use privdata here even though LPC32XX only has
> one GPIO device.
> gpio_platdata->function stores the runtime state which should be
> stored in privdata.
> I don't see any good reason to use platdata here, that is why I think it's a
> misue of platdata and thus convert it to use privdata.

That's a good point, sorry to have missed it.

Can you please reword the commit message so that it describes what you
just wrote? Something along the lines of "The LPC32XX GPIO driver
platdata currently contains GPIO state information, which should go
into priv_data"?

Thanks in advance.

> Regards,
> Axel

Cordialement,
Albert ARIBAUD
3ADEV


More information about the U-Boot mailing list