summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* kexec: remove KMSG_DUMP_KEXECWANG Cong2012-01-121-2/+1
| | | | | | | | | | | | | | | | KMSG_DUMP_KEXEC is useless because we already save kernel messages inside /proc/vmcore, and it is unsafe to allow modules to do other stuffs in a crash dump scenario. [akpm@linux-foundation.org: fix powerpc build] Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Reported-by: Vivek Goyal <vgoyal@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Acked-by: Jarod Wilson <jarod@redhat.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6Linus Torvalds2012-01-103-6/+14
|\ | | | | | | | | | | | | * 'linux-next' of git://git.infradead.org/ubifs-2.6: UBI: fix use-after-free on error path UBI: fix missing scrub when there is a bit-flip UBIFS: Use kmemdup rather than duplicating its implementation
| * UBI: fix use-after-free on error pathArtem Bityutskiy2012-01-051-3/+4
| | | | | | | | | | | | | | | | | | | | When we fail to erase a PEB, we free the corresponding erase entry object, but then re-schedule this object if the error code was something like -EAGAIN. Obviously, it is a bug to use the object after we have freed it. Reported-by: Emese Revfy <re.emese@gmail.com> Cc: stable@kernel.org [v2.6.23+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
| * UBI: fix missing scrub when there is a bit-flipBhavesh Parekh2011-11-303-3/+10
| | | | | | | | | | | | | | | | | | | | | | Under some cases, when scrubbing the PEB if we did not get the lock on the PEB it fails to scrub. Add that PEB again to the scrub list Artem: minor amendments. Cc: stable@kernel.org [2.6.31+] Signed-off-by: Bhavesh Parekh <bparekh@nvidia.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* | Merge tag 'for-linus-3.3' of git://git.infradead.org/mtd-2.6Linus Torvalds2012-01-1092-1499/+2263
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MTD pull for 3.3 * tag 'for-linus-3.3' of git://git.infradead.org/mtd-2.6: (113 commits) mtd: Fix dependency for MTD_DOC200x mtd: do not use mtd->block_markbad directly logfs: do not use 'mtd->block_isbad' directly mtd: introduce mtd_can_have_bb helper mtd: do not use mtd->suspend and mtd->resume directly mtd: do not use mtd->lock, unlock and is_locked directly mtd: do not use mtd->sync directly mtd: harmonize mtd_writev usage mtd: do not use mtd->lock_user_prot_reg directly mtd: mtd->write_user_prot_reg directly mtd: do not use mtd->read_*_prot_reg directly mtd: do not use mtd->get_*_prot_info directly mtd: do not use mtd->read_oob directly mtd: mtdoops: do not use mtd->panic_write directly romfs: do not use mtd->get_unmapped_area directly mtd: do not use mtd->get_unmapped_area directly mtd: do use mtd->point directly mtd: introduce mtd_has_oob helper mtd: mtdcore: export symbols cleanup mtd: clean-up the default_mtd_writev function ... Fix up trivial edit/remove conflict in drivers/staging/spectra/lld_mtd.c
| * | mtd: Fix dependency for MTD_DOC200xFabio Estevam2012-01-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following build warning: warning: (MTD_DOC2000 && MTD_DOC2001 && MTD_DOC2001PLUS) selects MTD_NAND_IDS which has unmet direct dependencies (MTD && MTD_NAND) Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->block_markbad directlyArtem Bityutskiy2012-01-094-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | Instead, use the new 'mtd_can_have_bb()', or just rely on 'mtd_block_markbad()' return code, which will be -EOPNOTSUPP if bad blocks are not supported. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_can_have_bb helperArtem Bityutskiy2012-01-0911-20/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces new 'mtd_can_have_bb()' helper function which checks whether the flash can have bad eraseblocks. Then it changes all the direct 'mtd->block_isbad' use cases with 'mtd_can_have_bb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->suspend and mtd->resume directlyArtem Bityutskiy2012-01-093-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | Just call the 'mtd_suspend()' and 'mtd_resume()' - they will do nothing if the operation is not defined. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->lock, unlock and is_locked directlyArtem Bityutskiy2012-01-094-29/+13
| | | | | | | | | | | | | | | | | | | | | | | | Instead, call the corresponding MTD API function which will return '-EOPNOTSUPP' if the operation is not supported. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->sync directlyArtem Bityutskiy2012-01-096-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch teaches 'mtd_sync()' to do nothing when the MTD driver does not have the '->sync()' method, which allows us to remove all direct 'mtd->sync' accesses. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: harmonize mtd_writev usageArtem Bityutskiy2012-01-092-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the 'mtd_writev()' function more usable and logical. We first teach it to fall-back to the 'default_mtd_writev()' function if the MTD driver does not define its own '->writev()' method. Then we make block2mtd and JFFS2 just 'mtd_writev()' instead of 'default_mtd_writev()' function. This means we can now stop exporting 'default_mtd_writev()' and instead, export 'mtd_writev()'. This is much cleaner and more logical, as well as allows us to get read of another direct 'mtd->writev' access in JFFS2. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->lock_user_prot_reg directlyArtem Bityutskiy2012-01-091-2/+0
| | | | | | | | | | | | | | | | | | | | | Instead, check the -EOPNOTSUPP return code of 'mtd_lock_user_prot_reg()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: mtd->write_user_prot_reg directlyArtem Bityutskiy2012-01-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | Instead, just call 'mtd_write_user_prot_reg()' and check the '-EOPNOTSUPP' return code. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->read_*_prot_reg directlyArtem Bityutskiy2012-01-091-8/+10
| | | | | | | | | | | | | | | | | | | | | Instead, call 'mtd_read_*_prot_info()' and check for -EOPNOTSUPP. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->get_*_prot_info directlyArtem Bityutskiy2012-01-091-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, call 'mtd_get_*_prot_info()' and check for '-EOPNOTSUPP'. While on it, fix the return code from '-EOPNOTSUPP' to '-EINVAL' for the case when the mode parameter is invalid. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->read_oob directlyArtem Bityutskiy2012-01-091-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of checking whether 'mtd->read_oob' is defined, just call 'mtd_read_oob()' and handle the '-EOPNOTSUPP' error which will be returned if the function is undefined. Additionally, make 'mtd_write_oob()' return '-EOPNOTSUPP' if the function is undefined. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: mtdoops: do not use mtd->panic_write directlyArtem Bityutskiy2012-01-091-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of checking if 'mtd->panic_write' is defined, call 'mtd_panic_write()' and check the error code - '-EOPNOTSUPP' will be returned if the function is not defined. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: do not use mtd->get_unmapped_area directlyArtem Bityutskiy2012-01-092-20/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove direct usage of mtd->get_unmapped_area. Instead, just call 'mtd_get_unmapped_area()' which will return -EOPNOTSUPP if the function is not implemented and test for this error code. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_has_oob helperArtem Bityutskiy2012-01-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are working in the direction of making sure that MTD clients to not use 'mtd->func' pointers directly. In some places we want to know if OOB operations are supported by an MTD device. Introduce 'mtd_has_oob()' helper for these purposes. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: mtdcore: export symbols cleanupArtem Bityutskiy2012-01-091-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The mtdcore.c file is a bit inconsistent - some EXPORT_SYMBOL_GPL declarations follow the corresponding functions, some are placed at the end. This patch harmonizes the file so that EXPORT_SYMBOL_GPL declarations follow the corresponding function. It also removes few extra newlines and trailing white-spaces. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: clean-up the default_mtd_writev functionArtem Bityutskiy2012-01-091-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Teach 'mtd_write()' function to return '-EROFS' if the write method is undefined, and remove the corresponding check from 'default_mtd_writev()'. 2. Do not test 'retlen' for NULL - it cannot be NULL. 3. Few minor coding stile clean-ups. 4. Add a kerneldoc comment Additionally, minor fixes to the kerneldoc comments of the neighbor function. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: sst25l: kill unused variableArtem Bityutskiy2012-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following gcc warning: drivers/mtd/devices/sst25l.c: In function ‘sst25l_probe’: drivers/mtd/devices/sst25l.c:381:11: warning: unused variable ‘i’ [-Wunused-variable] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: onenand: kill unused variableArtem Bityutskiy2012-01-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix this gcc warning: drivers/mtd/onenand/onenand_base.c: In function ‘onenand_block_markbad’: drivers/mtd/onenand/onenand_base.c:2636:23: warning: unused variable ‘this’ [-Wunused-variable] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: kill dev_to_mtd helperArtem Bityutskiy2012-01-091-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... since it is not needed because the generic 'dev_get_drvdata()' can be used instead. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: remove extra retlen assignmentArtem Bityutskiy2012-01-097-33/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MTD functions always assign the 'retlen' argument to 0 at the very beginning - the callers do not have to do this. I used the following semantic patch to find these places: @@ identifier retlen; expression a, b, c, d, e; constant C; type T; @@ ( - retlen = C; | T -retlen = C + retlen ; ) ... when != retlen when exists ( mtd_read(a, b, c, &retlen, d) | mtd_write(a, b, c, &retlen, d) | mtd_panic_write(a, b, c, &retlen, d) | mtd_point(a, b, c, &retlen, d, e) | mtd_read_fact_prot_reg(a, b, c, &retlen, d) | mtd_write_user_prot_reg(a, b, c, &retlen, d) | mtd_read_user_prot_reg(a, b, c, &retlen, d) | mtd_writev(a, b, c, d, &retlen) ) I ran it twice, because there were cases of double zero assigments in mtd tests. Then I went through the patch to verify that spatch did not find any false positives. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: doc: do not initialize mtd_info fields to 0 or NULLArtem Bityutskiy2012-01-094-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 'struct mtd_info' object is allocated with 'kzalloc()', so it contains only zeroes - no need to initialize various fields to 0 or NULL. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: docprobe: use kzalloc insteadArtem Bityutskiy2012-01-091-6/+1
| | | | | | | | | | | | | | | | | | | | | Instead of calling 'kmalloc()' and them 'memeset(0)', use 'kzalloc()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_block_markbad interfaceArtem Bityutskiy2012-01-0910-10/+10
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_block_isbad interfaceArtem Bityutskiy2012-01-0917-24/+24
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_resume interfaceArtem Bityutskiy2012-01-099-9/+9
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_suspend interfaceArtem Bityutskiy2012-01-099-9/+9
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_is_locked interfaceArtem Bityutskiy2012-01-092-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_unlock interfaceArtem Bityutskiy2012-01-094-4/+4
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_lock interfaceArtem Bityutskiy2012-01-094-4/+4
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_sync interfaceArtem Bityutskiy2012-01-098-9/+9
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_writev interfaceArtem Bityutskiy2012-01-092-4/+5
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_lock_user_prot_reg interfaceArtem Bityutskiy2012-01-092-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_write_user_prot_reg interfaceArtem Bityutskiy2012-01-092-3/+3
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_read_user_prot_reg interfaceArtem Bityutskiy2012-01-092-3/+3
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_get_user_prot_info interfaceArtem Bityutskiy2012-01-092-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_read_fact_prot_reg interfaceArtem Bityutskiy2012-01-092-3/+3
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_get_fact_prot_info interfaceArtem Bityutskiy2012-01-092-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_write_oob interfaceArtem Bityutskiy2012-01-0910-19/+19
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_read_oob interfaceArtem Bityutskiy2012-01-0911-21/+21
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_panic_write interfaceArtem Bityutskiy2012-01-092-4/+4
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_write interfaceArtem Bityutskiy2012-01-0917-57/+58
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_read interfaceArtem Bityutskiy2012-01-0928-122/+129
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_get_unmapped_area interfaceArtem Bityutskiy2012-01-093-5/+4
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * | mtd: introduce mtd_unpoint interfaceArtem Bityutskiy2012-01-091-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
OpenPOWER on IntegriCloud