mtd: unable to unregister device
Fabio Estevam
festevam at gmail.com
Fri Dec 5 12:36:48 PST 2014
On Fri, Dec 5, 2014 at 1:55 PM, Fabio Estevam <festevam at gmail.com> wrote:
> Hi,
>
> Running top of head linus tree or linux-next I observe the following issue:
>
> fsl-quadspi is autloaded as a kernel module:
>
> [ 9.670508] fsl-quadspi 21e4000.qspi: s25fl128s (16384 Kbytes)
> [ 9.763432] fsl-quadspi 21e4000.qspi: s25fl128s (16384 Kbytes)
> [ 9.847063] fsl-quadspi 21e4000.qspi: QuadSPI SPI NOR flash driver
>
> root at freescale /$ cat /proc/mtd
> dev: size erasesize name
> mtd0: 01000000 00010000 "21e4000.qspi"
> mtd1: 01000000 00010000 "21e4000.qspi"
>
> root at freescale /$ rmmod fsl-quadspi
> root at freescale /$ cat /proc/mtd
> dev: size erasesize name
> mtd0: 00000000 00000000 "(null)"
> mtd0: 00000000 00000000 "(null)"
> mtd0: 00000000 00000000 "(null)"
If I change it like this:
--- a/drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/drivers/mtd/spi-nor/fsl-quadspi.c
@@ -960,7 +960,7 @@ static int fsl_qspi_remove(struct platform_device *pdev)
struct fsl_qspi *q = platform_get_drvdata(pdev);
int i;
- for (i = 0; i < q->nor_num; i++)
+ for (i = 0; i < FSL_QSPI_MAX_CHIP; i++)
mtd_device_unregister(&q->mtd[i]);
/* disable the hardware */
Then rmmod works as expected:
root at freescale /$ rmmod fsl-quadspi
root at freescale /$ cat /proc/mtd
dev: size erasesize name
More information about the linux-mtd
mailing list