From mboxrd@z Thu Jan 1 00:00:00 1970 From: Miquel Raynal Date: Fri, 25 Oct 2019 19:38:56 +0200 Subject: [U-Boot] [PATCH v5 24/26] cmd: nand/sf: isolate legacy code In-Reply-To: References: <20191003175028.17015-1-miquel.raynal@bootlin.com> <20191003175028.17015-25-miquel.raynal@bootlin.com> <20191025112508.18f9e820@xps13> <20191025113609.29501658@xps13> Message-ID: <20191025193856.7c838529@xps13> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de Hi Jagan, Jagan Teki wrote on Fri, 25 Oct 2019 15:16:38 +0530: > On Fri, Oct 25, 2019 at 3:06 PM Miquel Raynal = wrote: > > > > Hi Jagan, > > > > Jagan Teki wrote on Fri, 25 Oct 2019 > > 14:57:36 +0530: > > =20 > > > Hi Miquel, > > > > > > On Fri, Oct 25, 2019 at 2:55 PM Miquel Raynal wrote: =20 > > > > > > > > Hi Jagan, > > > > > > > > Jagan Teki wrote on Fri, 25 Oct 2019 > > > > 14:44:38 +0530: > > > > =20 > > > > > On Thu, Oct 3, 2019 at 11:21 PM Miquel Raynal wrote: =20 > > > > > > > > > > > > The 'sf' command is not supposed to rely on the MTD stack, but = both > > > > > > 'sf' and 'nand' commands use helpers located in mtd_uboot.c. De= spite > > > > > > their location, these functions do not depend at all on the MTD > > > > > > stack. > > > > > > > > > > > > This file (drivers/mtd/mtd_uboot.c) is only compiled if CONFIG_= MTD is > > > > > > selected, which is inconsistent with the current situation. Sol= ve this > > > > > > by moving these three functions (which are only used by the abo= ve two > > > > > > commands) out of mtd_uboot.c and put them in a C file only comp= iled > > > > > > with cmd/sf.c and cmd/nand.c. > > > > > > > > > > > > Signed-off-by: Miquel Raynal > > > > > > --- > > > > > > cmd/Makefile | 3 ++ > > > > > > cmd/legacy-mtd-utils.c | 99 +++++++++++++++++++++++++++++++++= ++++++++ > > > > > > cmd/legacy-mtd-utils.h | 14 ++++++ > > > > > > cmd/nand.c | 2 + > > > > > > cmd/sf.c | 2 + > > > > > > drivers/mtd/mtd_uboot.c | 94 ---------------------------------= ----- =20 > > > > > > > > > > Better to drop CMD_SF, CMD_NAND in makefile so-that it can't build > > > > > this file in this patch. =20 > > > > > > > > I don't understand what you mean. Can you please detail what you ha= ve > > > > in mind for this patch? > > > > > > > > Is it something blocking for you? Or is it something that should be > > > > taken care of after? =20 > > > > > > I think it is simple rebase, this patch is moving code from > > > mtd_uboot.c to legacy-mtd-utils.c but mtd_uboot still building. I'm > > > saying to make change on drivers/mtd/Makefile to drop SF, NAND > > > dependency. =20 > > > > What do you mean by "mtd_uboot still building"? Do you mean it is a > > problem? Or did I forgot something? > > > > I don't see what CMD_SF/CMD_NAND dependency you are referring to. Can > > you please share a snippet of code? =20 >=20 > -ifneq (,$(findstring > y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_NAND)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD= _SF)$(CONFIG_CMD_MTD))) > +ifneq (,$(findstring > y,$(CONFIG_MTD_DEVICE)$(CONFIG_CMD_ONENAND)$(CONFIG_CMD_MTD))) > obj-y +=3D mtdcore.o mtd_uboot.o > endif > obj-$(CONFIG_MTD) +=3D mtd-uclass.o Indeed! Thanks for the clarification. Please apply patches 1 to 23 of this series, I am resending 24-26 corrected. Thanks, Miqu=C3=A8l