9
0
Fork 0
Commit Graph

15 Commits

Author SHA1 Message Date
Sascha Hauer 33d4f7cb3d mtd: refactor bb device creation
This refactors the code so that we get a mtd_add_bb which can
be used to create a bb dev on a mtd_info.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:43:09 +02:00
Sascha Hauer b32cd8df87 mtd: nand: bb: use mtd api directly
The devfs layer just adds an addition indirection between mtd
and the bb devices with no purpose. Drop it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-28 11:41:15 +02:00
Uwe Kleine-König 14d0355d7c mtd/nand: constify filename parameter
The string pointed to isn't modified, so declare it as const.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-02-28 08:20:26 +01:00
Juergen Kilb f4af6690e4 nand-bb: Fix remove of nand-bb device.
Fixed possible crashs if nand-bb device is removed
and the list entry was not deleted from the list.

Signed-off-by: Juergen Kilb <J.Kilb@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 08:24:59 +01:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Jan Luebbe c410817f19 mtd: fix 'write: Invalid argument' while writing to nand-bb devices
The 'off_t cur_ofs' variable was missed during the 64 bit conversion.
For the MEMGETBADBLOCK ioctl, a pointer to a loff_t is needed.

Also adjust the debug format strings.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-16 11:08:47 +02:00
Sascha Hauer 4987f61ee2 mtd: fix bad block ioctls
Since this commit we interpret the argument to the bad block ioctls
as a pointer to a 64bit number:

|commit e71c343668
|Author: Sascha Hauer <s.hauer@pengutronix.de>
|Date:   Fri Oct 14 11:57:55 2011 +0200
|
|    mtd: fix arguments to bad block ioctls
|
|    In the Kernel the mtd ioctls expect a pointer to the offset, whereas
|    barebox interprets the pointer itself as an offset. Since we want
|    to add 64bit support for file sizes a pointer may not be sufficient,
|    so align with the kernel and convert it to a pointer to the offset.
|
|    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

This missed some places, fix them aswell.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-10 19:07:33 +02:00
Sascha Hauer 3e503822c7 use loff_t for file offsets
This is a first step for 64bit file support: Make the file sizes/offsets
64bit.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:24 +02:00
Sascha Hauer e71c343668 mtd: fix arguments to bad block ioctls
In the Kernel the mtd ioctls expect a pointer to the offset, whereas
barebox interprets the pointer itself as an offset. Since we want
to add 64bit support for file sizes a pointer may not be sufficient,
so align with the kernel and convert it to a pointer to the offset.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 16:53:16 +02:00
Robert Jarzmik 88ce7ef769 drivers/mtd: transfer NAND notions to MTD core
Change NAND_WRITE into MTD_WRITE.
Change "page_shift" references in the core, which are purely
NAND, into mtd->writesize which is MTD generic.
Rename all "info" (struct mtd_info) into "mtd".

Also provide a parameter to add_mtd_device() so that legacy
nand devices still appear as nand<N>.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-22 10:11:11 +01:00
Sascha Hauer 597ce4cc1c nand-bb: implement lseek in readonly mode
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr>
2011-12-15 19:55:11 +01:00
Sascha Hauer 4ecd0003ac cdev: pass flags to open function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:46:50 +01:00
Sascha Hauer f880d7bc87 nand bb: add proper bb remove function
The old way happily removed cdev entries which were no bb dev
at all. Fix this by checking if the given device actually is
a bb device.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer e7c06800ee nand bb: switch to cdev operations
The cdev operations are available without the complete file API,
so they are more suitable for internal usage.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00
Sascha Hauer 027db60302 nand: move bb handling code to drivers/mtd/nand
It's good to seperate the code which others can use from commands.
This way other users do not depend on the command being compiled in.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-12 09:54:56 +02:00