| Submitter | Mohammed Afzal |
|---|---|
| Date | May 1, 2012, 12:20 p.m. |
| Message ID | <91c09cb6a6cb5e87acdcc3f6100a87b4c2a3dd41.1335874494.git.afzal@ti.com> |
| Download | mbox | patch |
| Permalink | /patch/156096/ |
| State | New |
| Headers | show |
Comments
Hello. On 01-05-2012 16:20, Afzal Mohammed wrote: > Modify board_onenand_init to return platform data. This > would be required for boards to be able to pass it to > gpmc driver so that it finally reaches onenand driver. > Also un-static the function so that boards can use it. > Signed-off-by: Afzal Mohammed<afzal@ti.com> [...] > diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h > index 052964c..75ba49f 100644 > --- a/arch/arm/mach-omap2/board-flash.h > +++ b/arch/arm/mach-omap2/board-flash.h > @@ -52,3 +52,15 @@ board_nand_init(struct mtd_partition *nand_parts, > return NULL; > } > #endif > + > +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ > + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) You can use IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2) instead these two. > +extern struct omap_onenand_platform_data * __init > +board_onenand_init(struct mtd_partition *onenand_parts, u8 nr_parts, u8 cs); > +#else > +static inline struct omap_onenand_platform_data * > +__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) > +{ > + return NULL; > +} > +#endif WBR, Sergei
Hi Sergei, On Tue, May 01, 2012 at 22:19:37, Sergei Shtylyov wrote: > > + > > +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ > > + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) > > You can use IS_ENABLED(CONFIG_MTD_ONENAND_OMAP2) instead these two. Thanks for educating me. Regards Afzal
Patch
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index 091aaf6..8727c05 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c @@ -87,22 +87,16 @@ static struct omap_onenand_platform_data board_onenand_data = { .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ }; -static void -__init board_onenand_init(struct mtd_partition *onenand_parts, - u8 nr_parts, u8 cs) +struct omap_onenand_platform_data * __init +board_onenand_init(struct mtd_partition *onenand_parts, u8 nr_parts, u8 cs) { board_onenand_data.cs = cs; board_onenand_data.parts = onenand_parts; board_onenand_data.nr_parts = nr_parts; - gpmc_onenand_init(&board_onenand_data); -} -#else -static void -__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) -{ + return &board_onenand_data; } -#endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ +#endif #if defined(CONFIG_MTD_NAND_OMAP2) || \ defined(CONFIG_MTD_NAND_OMAP2_MODULE) diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h index 052964c..75ba49f 100644 --- a/arch/arm/mach-omap2/board-flash.h +++ b/arch/arm/mach-omap2/board-flash.h @@ -52,3 +52,15 @@ board_nand_init(struct mtd_partition *nand_parts, return NULL; } #endif + +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) +extern struct omap_onenand_platform_data * __init +board_onenand_init(struct mtd_partition *onenand_parts, u8 nr_parts, u8 cs); +#else +static inline struct omap_onenand_platform_data * +__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) +{ + return NULL; +} +#endif
Modify board_onenand_init to return platform data. This would be required for boards to be able to pass it to gpmc driver so that it finally reaches onenand driver. Also un-static the function so that boards can use it. Signed-off-by: Afzal Mohammed <afzal@ti.com> --- arch/arm/mach-omap2/board-flash.c | 14 ++++---------- arch/arm/mach-omap2/board-flash.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-)