From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Mon, 1 Oct 2018 21:45:45 +0530 Subject: [U-Boot] [PATCH v12 1/8] dm: drop unused helper in MTD header In-Reply-To: <20181001154044.3dcb3680@xps13> References: <20180929105830.13530-1-miquel.raynal@bootlin.com> <20180929105830.13530-2-miquel.raynal@bootlin.com> <20181001120230.5937a631@xps13> <20181001154044.3dcb3680@xps13> Message-ID: <5180aa18-2366-b4fb-8478-7412fd1a9422@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday 01 October 2018 07:10 PM, Miquel Raynal wrote: > Hi Jagan, > > Jagan Teki wrote on Mon, 1 Oct 2018 > 17:08:30 +0530: > >> On Mon, Oct 1, 2018 at 3:32 PM Miquel Raynal wrote: >>> >>> Hi Jagan, >>> >>> Jagan Teki wrote on Mon, 1 Oct 2018 >>> 15:23:46 +0530: >>> >>>> On Sat, Sep 29, 2018 at 4:29 PM Miquel Raynal wrote: >>>>> >>>>> include/mtd.h might be included by files even if CONFIG_DM is not >>>>> enabled. In this case, the call to dev_get_uclass_priv() would trigger >>>>> a build error. Because this helper has no user, let's drop it off. >>>> >>>> Why would they use DM include file w/o using it? we need to fix in those places. >>> >>> There was no user of include/mtd.h not using CONFIG_DM. >>> >>> But now I am creating cmd/mtd.c which should work with both CONFIG_DM >>> and no CONFIG_DM support. So include/mtd.h has reasons to be included. >> >> Then use ifdef CONFIG_MTD on the same file so it can arrange dm and >> non-dm include at one place. > > The helper is not used, why do we keep it? The whole point of placing ifdef is to support dm and non-dm at one include.