[PATCH 2/2] sf: Simplify probe for dm code

Tom Rini trini at konsulko.com
Fri May 22 16:30:13 CEST 2020


On Fri, May 22, 2020 at 08:24:58AM -0600, Simon Glass wrote:
> Hi Jagan,
> 
> On Thu, 14 May 2020 at 12:09, Jagan Teki <jagan at amarulasolutions.com> wrote:
> >
> > Handling probing code for a particular uclass between
> > dm vs nodm always confusing and requires additional
> > ifdefs to handle them properly.
> >
> > But, having separate low-level code bases for dm and
> > nodm can make it easy for the command level to use same
> > function name to probe the devices. This would indeed
> > avoid extra ifdef call in source code.
> >
> > So, this patch probes the spi flash in common legacy
> > call spi_flash_probe for both dm and nodm devices and
> > give a chance to handle on respective code bases based
> > on the build files.
> >
> > Cc: Simon Glass <sjg at chromium.org>
> > Cc: Vignesh R <vigneshr at ti.com>
> > Cc: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
> > Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> > ---
> >  cmd/sf.c                    | 22 ---------------------
> >  drivers/mtd/spi/sf-uclass.c | 38 +++++++++++++------------------------
> >  drivers/net/fm/fm.c         | 20 -------------------
> >  env/sf.c                    | 17 +----------------
> >  include/spi_flash.h         | 20 +++++--------------
> >  5 files changed, 19 insertions(+), 98 deletions(-)
> 
> +Tom Rini
> 
> This is really going the wrong way. You would cement the code in limbo
> forever and no one would be able to migrate property.
> 
> Instead, you should add a patch to disable SPI flash on boards which
> have not migrated. Then we can actually clean up the mess properly.
> 
> The deadline has passed and people have had more than 5 years to migrate.
> 
> It is time to make the cut.

Yes.  I'm currently trying to come up with a series that drops MMC/USB
that haven't migrated as that's a full year past the build warning
deadline we set.  It won't go in for v2020.07 but it will go in for
right after.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200522/a0bcfc53/attachment.sig>


More information about the U-Boot mailing list