From: Tom Rini Date: Fri, 22 May 2020 13:27:43 -0400 Subject: [PATCH 2/2] sf: Simplify probe for dm code In-Reply-To: References: <20200514180941.21542-1-jagan@amarulasolutions.com> <20200514180941.21542-2-jagan@amarulasolutions.com> Message-ID: <20200522172743.GU26741@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, May 22, 2020 at 10:50:35AM -0600, Simon Glass wrote: > Hi Jagan, > > On Fri, 22 May 2020 at 08:41, Jagan Teki wrote: > > > > Hi Simon, > > > > On Fri, May 22, 2020 at 7:55 PM Simon Glass wrote: > > > > > > Hi Jagan, > > > > > > On Thu, 14 May 2020 at 12:09, Jagan Teki 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 > > > > Cc: Vignesh R > > > > Cc: Daniel Schwierzeck > > > > Signed-off-by: Jagan Teki > > > > --- > > > > 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. > > > > It's not entirely about migration, but also the future development > > with MTD uclass. I'm trying to separate the code for dm vs nodm, and > > dm files would be further developed to use MTD uclass (series will > > send soon) and nodm keep it as static and drop at a later point. I > > take the clean part early before moving into MTD uclass since the > > migration from SPI flash to MTD is smooth. > > To me it looks like the DM way is being removed. > > I really feel this should be done in the reverse order. Remove the old > code and then refactor. > > The old code does not understand DT at all. It means we are stuck with > things like CONFIG variables for the bus to use for SPI environment, > etc. > > Please let's just migrate. It is *well* past time. I strongly agree. We're about to be a full year past the build warning of "this will be removed". I had even started by including SPI stuff in my "drop these boards" local series but ran in to enough problems being exposed I started with just the BLK related stuff. So please, lets start with disabling in or entirely removing defconfigs that are tripping up the SPI migration warning. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: