[PATCH 2/3]NAND: OMAP: Fixing omap nand driver, compiled as module
Vimal Singh
vimal.newwork at gmail.com
Tue Nov 3 03:48:43 EST 2009
On Tue, Nov 3, 2009 at 2:09 PM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> On Tue, 2009-11-03 at 14:05 +0530, Vimal Singh wrote:
>> On Tue, Nov 3, 2009 at 1:58 PM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
>> > On Fri, 2009-10-30 at 14:57 +0530, Vimal Singh wrote:
>> >> Last time I forgot to 'git add' for 'arch/arm/mach-omap2/gpmc.c'... My bad.
>> >> Correct patch is below.
>> >>
>> >> -vimal
>> >>
>> >>
>> >> From: Vimal Singh <vimalsingh at ti.com>
>> >> Date: Fri, 30 Oct 2009 14:54:29 +0530
>> >> Subject: [PATCH] NAND: OMAP: Fixing omap nand driver, compiled as module
>> >>
>> >> Removing OMAP NAND driver, when loaded as a module, gives error and
>> >> does not get success. This fixes this and makes driver loadable and
>> >> removable run time.
>> >>
>> >> Signed-off-by: Vimal Singh <vimalsingh at ti.com>
>> >> ---
>> >> arch/arm/mach-omap2/gpmc.c | 2 ++
>> >> drivers/mtd/nand/omap2.c | 5 ++++-
>> >> 2 files changed, 6 insertions(+), 1 deletions(-)
>> >>
>> >> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
>> >> index 1587682..1d10b7b 100644
>> >> --- a/arch/arm/mach-omap2/gpmc.c
>> >> +++ b/arch/arm/mach-omap2/gpmc.c
>> >> @@ -88,6 +88,7 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val)
>> >> reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>> >> __raw_writel(val, reg_addr);
>> >> }
>> >> +EXPORT_SYMBOL(gpmc_cs_write_reg);
>> >>
>> >> u32 gpmc_cs_read_reg(int cs, int idx)
>> >> {
>> >> @@ -96,6 +97,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
>> >> reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
>> >> return __raw_readl(reg_addr);
>> >> }
>> >> +EXPORT_SYMBOL(gpmc_cs_read_reg);
>> >
>> > Why do you export these?
>>
>> These functions are called during prob. So, if not exported and driver
>> is compiled as a module compilation will break with error saying these
>> are not defined or not found.
>
> Could you show the place where they are called from please. I tried to
> compile the omap NAND driver as module and it compiled fine. Probably
> I'm missing something?
Code snippet from omap2.c, in prob call: line 919
-----------------------------------------------------------
/* Enable RD PIN Monitoring Reg */
if (pdata->dev_ready) {
val = gpmc_cs_read_reg(info->gpmc_cs, GPMC_CS_CONFIG1);
val |= WR_RD_PIN_MONITORING;
gpmc_cs_write_reg(info->gpmc_cs, GPMC_CS_CONFIG1, val);
}
val = gpmc_cs_read_reg(info->gpmc_cs, GPMC_CS_CONFIG7);
val &= ~(0xf << 8);
val |= (0xc & 0xf) << 8;
gpmc_cs_write_reg(info->gpmc_cs, GPMC_CS_CONFIG7, val);
-----------------------------------------------------------
--
Regards,
Vimal Singh
More information about the linux-mtd
mailing list