Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 552d9205 authored by David Woodhouse's avatar David Woodhouse
Browse files

[MTD] Fix module refcounting in NAND board drivers.



The _board_ driver needs to be mtd->owner, and it in turn pins the
nand.ko module. Fix them all to actually do that, and fix nand.ko not to
overwrite it -- and also to check that the caller sets it, if the caller
is a module.

Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 4f678a58
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -345,6 +345,7 @@ int __init au1xxx_nand_init(void)

	/* Link the private data with the MTD structure */
	au1550_mtd->priv = this;
	au1550_mtd->owner = THIS_MODULE;

	/* disable interrupts */
	au_writel(au_readl(MEM_STNDCTL) & ~(1 << 8), MEM_STNDCTL);
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ int __init autcpu12_init(void)

	/* Link the private data with the MTD structure */
	autcpu12_mtd->priv = this;
	autcpu12_mtd->owner = THIS_MODULE;

	/* Set address of NAND IO lines */
	this->IO_ADDR_R = autcpu12_fio_base;
+1 −1
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)

	/* Link the private data with the MTD structure */
	new_mtd->priv = this;
	new_mtd->owner = THIS_MODULE;

	/* map physical address */
	this->IO_ADDR_R = this->IO_ADDR_W = ioremap(adr, 4096);
@@ -255,7 +256,6 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
		goto out_ior;
	}

	new_mtd->owner = THIS_MODULE;
	cs553x_mtd[cs] = new_mtd;
	goto out;

+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ static int __init ep7312_init(void)

	/* Link the private data with the MTD structure */
	ep7312_mtd->priv = this;
	ep7312_mtd->owner = THIS_MODULE;

	/*
	 * Set GPIO Port B control register so that the pins are configured
+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ static int __init h1910_init(void)

	/* Link the private data with the MTD structure */
	h1910_nand_mtd->priv = this;
	h1910_nand_mtd->owner = THIS_MODULE;

	/*
	 * Enable VPEN
Loading