aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-05-31mtd: rawnand: nandsim: Fix the label pointing on nand_cleanup()Miquel Raynal1-3/+3
Drop the generic err_exit. The remaining operation to do from this goto statement is to cleanup the NAND allocations, so rename it. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Free erase_block_wear on errorMiquel Raynal1-1/+3
Free erase_block_wear on error, which is allocated by ns_setup_wear_reporting(). Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Use an additional label when freeing the nandsim objectMiquel Raynal1-3/+4
Cosmetic change to give a meaning to all labels in this complicated error path. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Stop using nand_release()Miquel Raynal1-2/+4
nand_release() basically calls mtd_device_unregister() and nand_cleanup(). Both helpers should be called after MTD device registration and NAND scan, respectively. Drop nand_release() and use the two helpers directly so that they fit the error path and the labels there. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Free the partition names in ns_free()Miquel Raynal1-6/+6
ns_free() is the helper that is called symmetrically to ns_init() and so should free the same objects, including the partition names. Now, callers of ns_free() do not need to free this partition names themselves. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Free the allocated device on error in ns_init()Miquel Raynal1-1/+3
The nandsim device is allocated and initialized inside ns_init() by a call to ns_alloc_device(), free it on error. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Free partition names on error in ns_init()Miquel Raynal1-4/+13
The ns_init() function shall free the partition names allocated by ns_get_partition_name() on error. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Fix the two ns_alloc_device() error pathsMiquel Raynal1-9/+17
The ns_alloc_device() helper has actually two distinct path. Handle errors in both of them. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Remove debugfs entries at unload timeMiquel Raynal1-0/+6
Create a ns_debugfs_remove() helper for that and call it in ns_cleanup_module(). Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Keep track of the created debugfs entriesMiquel Raynal1-4/+6
Debugfs entries should be removed in the error path, so first, keep track of them. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Clean error handlingMiquel Raynal1-19/+27
Many function calls are done this way: if ((retval = func()) != 0) return retval; while we expect in the kernel function calls like: retval = func(); if (retval) return retval; Apply this change where possible and also use "ret" instead of "retval" in ns_init_module for consistency, as it is only used in this function. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Use a consistent ns_ prefix for all functionsMiquel Raynal1-117/+131
Some functions are prefixed "nandsim_", others "ns_" and many are simply not prefixed at all. Make this file consistent by prefixing all functions by "ns_". This is a mechanical change. Sometimes the line is a bit reworked as well to fit the kernel coding style. For instance, there are several places where displayed strings are cut. When one of this line is changed because of the naming update, the two parts of the strings gets concatenated. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Use octal permissionsMiquel Raynal1-1/+1
Symbolic permissions 'S_IRUSR' are not preferred. Checkpatch.pl advises to use octal permissions '0400'. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: nandsim: Consistent use of 'ns' instead of 'dev'Miquel Raynal1-4/+4
The nandsim object is called 'ns' almost everywhere, keep it that way everywhere for consistency. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: brcmnand: support v2.1-v2.2 controllersÁlvaro Fernández Rojas1-9/+76
v2.1: tested on Netgear DGND3700v1 (BCM6368) v2.2: tested on Netgear DGND3700v2 (BCM6362) Signed-off-by: Álvaro Fernández Rojas <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31dt-bindings: mtd: brcmnand: add v2.1 and v2.2 supportÁlvaro Fernández Rojas1-0/+2
Add brcm,brcmnand-v2.1 and brcm,brcmnand-v2.2 as possible compatible strings to support brcmnand controllers v2.1 and v2.2. Signed-off-by: Álvaro Fernández Rojas <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: brcmnand: rename page sizesÁlvaro Fernández Rojas1-2/+2
Current pages sizes apply to controllers after v3.4 Signed-off-by: Álvaro Fernández Rojas <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: brcmnand: fix CS0 layoutÁlvaro Fernández Rojas1-2/+3
Only v3.3-v5.0 have a different CS0 layout. Controllers before v3.3 use the same layout for every CS. Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: Álvaro Fernández Rojas <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: brcmnand: rename v4 registersÁlvaro Fernández Rojas1-4/+4
These registers are also used on v3.3. Signed-off-by: Álvaro Fernández Rojas <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: gpmi: Use nand_extract_bits()Miquel Raynal1-164/+10
Drop the use of gpmi_copy_bits() in favor of the NAND helper nand_extract_bits(). Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: omap_elm: Fix runtime PM imbalance on errorDinghao Liu1-0/+1
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: gpmi: Fix runtime PM imbalance in gpmi_nand_probeDinghao Liu1-1/+1
There is no reason that the failure of __gpmi_enable_clk() could lead to PM usage counter decrement. Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: gpmi: Fix runtime PM imbalance on errorDinghao Liu1-1/+3
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: ingenic: Convert the driver to exec_op()Boris Brezillon1-56/+83
Let's convert the driver to exec_op() to have one less driver relying on the legacy interface. Signed-off-by: Boris Brezillon <[email protected]> Tested-by: Paul Cercueil <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: ingenic: Fix the RB gpio active-high property on qi, lb60Boris Brezillon1-1/+13
The rb-gpios semantics was undocumented and qi,lb60 (along with the ingenic driver) got it wrong. The active state encodes the NAND ready state, which is high level. Since there's no signal inverter on this board, it should be active-high. Let's fix that here for older DTs so we can re-use the generic nand_gpio_waitrdy() helper, and be consistent with what other drivers do. Suggested-by: Paul Cercueil <[email protected]> Signed-off-by: Boris Brezillon <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: xway: Stop using nand_release()Miquel Raynal1-1/+5
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: xway: Fix the probe error pathMiquel Raynal1-1/+1
nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: vf610: Stop using nand_release()Miquel Raynal1-1/+5
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Cc: Stefan Agner <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: txx9ndfmc: Stop using nand_release()Miquel Raynal1-2/+4
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: tmio: Stop using nand_release()Miquel Raynal1-1/+5
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: tmio: Fix the probe error pathMiquel Raynal1-1/+1
nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: tango: Stop using nand_release()Miquel Raynal1-3/+8
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: sunxi: Stop using nand_release()Miquel Raynal1-2/+7
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: sunxi: Fix the probe error pathMiquel Raynal1-1/+1
nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support") Signed-off-by: Miquel Raynal <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: stm32_fmc2: Stop using nand_release()Miquel Raynal1-1/+5
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Cc: Christophe Kerello <[email protected]> Reviewed-by: Christophe Kerello <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: socrates: Stop using nand_release()Miquel Raynal1-1/+5
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: socrates: Fix the probe error pathMiquel Raynal1-1/+1
nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: sharpsl: Stop using nand_release()Miquel Raynal1-3/+9
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: sharpsl: Fix the probe error pathMiquel Raynal1-1/+1
nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible. However, pointing this commit as the culprit for backporting purposes makes sense. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: sh_flctl: Stop using nand_release()Miquel Raynal1-1/+5
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: s3c2410: Stop using nand_release()Miquel Raynal1-1/+2
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: r852: Stop using nand_release()Miquel Raynal1-2/+4
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Cc: Maxim Levitsky <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: qcom: Stop using nand_release()Miquel Raynal1-3/+8
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: plat_nand: Stop using nand_release()Miquel Raynal1-1/+5
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: plat_nand: Fix the probe error pathMiquel Raynal1-1/+1
nand_release() is supposed be called after MTD device registration. Here, only nand_scan() happened, so use nand_cleanup() instead. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible, hence pointing it as the commit to fix for backporting purposes, even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: pasemi: Stop using nand_release()Miquel Raynal1-1/+4
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: pasemi: Fix the probe error pathMiquel Raynal1-1/+3
nand_cleanup() is supposed to be called on error after a successful call to nand_scan() to free all NAND resources. There is no real Fixes tag applying here as the use of nand_release() in this driver predates by far the introduction of nand_cleanup() in commit d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") which makes this change possible, hence pointing it as the commit to fix for backporting purposes, even if this commit is not introducing any bug. Fixes: d44154f969a4 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources") Signed-off-by: Miquel Raynal <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: oxnas: Stop using nand_release()Miquel Raynal1-1/+2
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: oxnas: Release all devices in the _remove() pathMiquel Raynal1-2/+6
oxnans_nand_remove() should release all MTD devices and clean all NAND devices, not only the first one registered. Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
2020-05-31mtd: rawnand: oxnas: Unregister all devices on errorMiquel Raynal1-0/+8
On error, the oxnas probe path just frees the device which failed and aborts the probe, leaving unreleased resources. Fix this situation by calling mtd_device_unregister()/nand_cleanup() on these. Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]