[U-Boot] [PATCH v2 8/8] spi: sun4i: Driver cleanup

Jagan Teki jagan at amarulasolutions.com
Fri Feb 15 16:48:17 UTC 2019


On Fri, Feb 15, 2019 at 5:30 AM André Przywara <andre.przywara at arm.com> wrote:
>
> On 14/02/2019 08:36, Jagan Teki wrote:
> > - drop unused macros.
> > - use base instead of base_addr, for better code readability
>
> Actually this part is now pretty pointless, since we use it only a few
> times, and base_addr is actually more descriptive than just "base".

base can be easily understood as base address, I would usually prefer
as simple and meaningful as possible.

>
> > - move .probe and .ofdata_to_platdata functions in required
> >   places to add platdata support in future.
>
> I don't get the reason for that move?

As I explained above, if you add platdata in future we need separate
ifdefs, move above U_BOOT_DRIVER macro would keep the common code in
one place with one macro. and in fact it just follow similar to other
spi dm drivers. where probe and of_pladata core calls are below.

Example: drivers/spi/davinci_spi.c

>
> > - use sentinel sun4i_spi_ids.
> >
> > Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> > ---
> >  drivers/spi/sun4i_spi.c | 190 +++++++++++++++++-----------------------
> >  image.map               |   4 +
>
> Please keep this file for you ;-)

Sorry, its 3:00 AM work ;)


More information about the U-Boot mailing list