From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Fri, 6 Nov 2015 15:58:15 -0800 Subject: [U-Boot] [PATCH v4 1/3] dm: implement a MTD uclass In-Reply-To: <563CAA58.7060409@wytron.com.tw> References: <1444289667-23775-1-git-send-email-thomas@wytron.com.tw> <1446556146-9876-1-git-send-email-thomas@wytron.com.tw> <563CAA58.7060409@wytron.com.tw> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Thomas, On 6 November 2015 at 05:25, Thomas Chou wrote: > Hi Simon, > > On 2015?11?06? 20:06, Simon Glass wrote: >>> >>> diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h >>> index e3d3fc7..0ab6128 100644 >>> --- a/include/linux/mtd/mtd.h >>> +++ b/include/linux/mtd/mtd.h >>> @@ -18,6 +18,7 @@ >>> >>> #include >>> #else >>> +#include >> >> >> I'm not keen on adding this header here. Why is it needed? Can we >> instead include in the C files that need it? >> > > It is needed for the udevice in mtd_info. Some drivers use mtd.h but are not > converted to driver model. Maybe I should remove the dm here, and add an > #elif for the udevice below? Are you sure? It should be possible to declare a 'struct udevice *' without this header. > >>> #include >>> #include >>> #include >>> @@ -272,6 +273,8 @@ struct mtd_info { >>> struct module *owner; >>> #ifndef __UBOOT__ >>> struct device dev; >>> +#else > > > #elif CONFIG_IS_ENABLED(MTD) > >>> + struct udevice *dev; >>> #endif >>> int usecount; >>> }; > > > Thanks a lot for your review. > > Best regards, > Thomas Regards, Simon