Commit graph

916391 commits

Author SHA1 Message Date
Miquel Raynal
86f2b225ad mtd: rawnand: Add an invalid ECC mode to discriminate with valid ones
NAND ECC modes (or providers) have their own enumeration but, unlike
their algorithms counterpart, there is no invalid or uninitialized
value to discriminate between an error and having chosen a no-ECC
situation. Add an "invalid" entry for this purpose.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-7-miquel.raynal@bootlin.com
2020-05-31 10:53:41 +02:00
Miquel Raynal
dbc2f2e6d5 mtd: rawnand: Return an enum from of_get_nand_ecc_algo()
There is an enumeration to list ECC algorithm, let's use it instead of
returning an int.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-6-miquel.raynal@bootlin.com
2020-05-31 10:53:41 +02:00
Miquel Raynal
74e24cd237 mtd: rawnand: Drop OOB_FIRST placement scheme
This scheme has been introduced for the Davinci controller and means
that the OOB area must be read *before* the rest of the data. This has
nothing to do with the ECC in OOB placement as it could be understood
and most importantly, there is no point in having this function out of
the Davinci NAND controller driver. A DT property for this scheme has
been added but never used, even by the Davinci driver which only uses
this scheme to change the default nand_read_page().

Move the main read_page() helper into the Davinci driver and remove
the remaining boilerplate.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-4-miquel.raynal@bootlin.com
2020-05-31 10:53:41 +02:00
Miquel Raynal
f66a6fd0dc mtd: rawnand: Avoid a typedef
In new code, the use of typedef is discouraged. Turn this one in the
raw NAND core into a regular enumeration.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-3-miquel.raynal@bootlin.com
2020-05-31 10:53:41 +02:00
Miquel Raynal
519494a9af mtd: Fix typo in mtd_ooblayout_set_databytes() description
Fix a probable copy/paste error: the function works like
mtd_ooblayout_set_bytes(), not *_get_bytes().

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200526195633.11543-2-miquel.raynal@bootlin.com
2020-05-31 10:53:41 +02:00
Miquel Raynal
9630a05525 mtd: rawnand: Stop using nand_release()
This helper is not very useful and very often people get confused:
they use nand_release() instead of nand_cleanup().

Now that all drivers have been converted to do not use nand_release()
anymore, let's remove this helper.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-63-miquel.raynal@bootlin.com
2020-05-31 10:53:40 +02:00
Miquel Raynal
5724fa7f2e mtd: rawnand: nandsim: Reorganize ns_cleanup_module()
Reorganize ns_cleanup_module() to fit the reworked exit path of
ns_init_module().

There is no need for a ns_free_lists() function anymore, so drop it.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-18-miquel.raynal@bootlin.com
2020-05-31 10:53:40 +02:00
Miquel Raynal
f82d82e202 mtd: rawnand: nandsim: Rename a label in ns_init_module()
Rename the "error" label to gave it a meaning.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-17-miquel.raynal@bootlin.com
2020-05-31 10:53:40 +02:00
Miquel Raynal
73f2b68c51 mtd: rawnand: nandsim: Manage lists on error in ns_init_module()
Lists are filled with calls to ns_parse_weakblocks(),
ns_parse_weakpages() and ns_parse_gravepages(). Handle them in the
error path, all at the same time.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-16-miquel.raynal@bootlin.com
2020-05-31 10:53:40 +02:00
Miquel Raynal
dc2733dea2 mtd: rawnand: nandsim: Fix the label pointing on nand_cleanup()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-15-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
5dcb5164b2 mtd: rawnand: nandsim: Free erase_block_wear on error
Free erase_block_wear on error, which is allocated by
ns_setup_wear_reporting().

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-14-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
82503f8412 mtd: rawnand: nandsim: Use an additional label when freeing the nandsim object
Cosmetic change to give a meaning to all labels in this complicated
error path.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-13-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
d6e4fd5224 mtd: rawnand: nandsim: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-12-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
72e840a15c mtd: rawnand: nandsim: Free the partition names in ns_free()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-11-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
161246ec06 mtd: rawnand: nandsim: Free the allocated device on error in ns_init()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-10-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
52bc51c54e mtd: rawnand: nandsim: Free partition names on error in ns_init()
The ns_init() function shall free the partition names allocated by
ns_get_partition_name() on error.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-9-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
058018eb02 mtd: rawnand: nandsim: Fix the two ns_alloc_device() error paths
The ns_alloc_device() helper has actually two distinct path. Handle
errors in both of them.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-8-miquel.raynal@bootlin.com
2020-05-31 10:53:38 +02:00
Miquel Raynal
cde495f839 mtd: rawnand: nandsim: Remove debugfs entries at unload time
Create a ns_debugfs_remove() helper for that and call it in
ns_cleanup_module().

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-7-miquel.raynal@bootlin.com
2020-05-31 10:53:37 +02:00
Miquel Raynal
7f2a17369f mtd: rawnand: nandsim: Keep track of the created debugfs entries
Debugfs entries should be removed in the error path, so first, keep
track of them.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-6-miquel.raynal@bootlin.com
2020-05-31 10:53:37 +02:00
Miquel Raynal
052a7a5374 mtd: rawnand: nandsim: Clean error handling
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-5-miquel.raynal@bootlin.com
2020-05-31 10:53:37 +02:00
Miquel Raynal
88f9f3e89a mtd: rawnand: nandsim: Use a consistent ns_ prefix for all functions
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-4-miquel.raynal@bootlin.com
2020-05-31 10:53:37 +02:00
Miquel Raynal
b81fa3c45e mtd: rawnand: nandsim: Use octal permissions
Symbolic permissions 'S_IRUSR' are not preferred. Checkpatch.pl
advises to use octal permissions '0400'.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-3-miquel.raynal@bootlin.com
2020-05-31 10:53:37 +02:00
Miquel Raynal
6be834c667 mtd: rawnand: nandsim: Consistent use of 'ns' instead of 'dev'
The nandsim object is called 'ns' almost everywhere, keep it that way
everywhere for consistency.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200525085851.17682-2-miquel.raynal@bootlin.com
2020-05-31 10:53:37 +02:00
Álvaro Fernández Rojas
7e7c7df5d5 mtd: rawnand: brcmnand: support v2.1-v2.2 controllers
v2.1: tested on Netgear DGND3700v1 (BCM6368)
v2.2: tested on Netgear DGND3700v2 (BCM6362)

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-6-noltari@gmail.com
2020-05-31 10:53:37 +02:00
Álvaro Fernández Rojas
b1713b5b2c dt-bindings: mtd: brcmnand: add v2.1 and v2.2 support
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 <noltari@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-5-noltari@gmail.com
2020-05-31 10:53:37 +02:00
Álvaro Fernández Rojas
eeeac9cbc4 mtd: rawnand: brcmnand: rename page sizes
Current pages sizes apply to controllers after v3.4

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-4-noltari@gmail.com
2020-05-31 10:53:37 +02:00
Álvaro Fernández Rojas
3d3fb3c5be mtd: rawnand: brcmnand: fix CS0 layout
Only v3.3-v5.0 have a different CS0 layout.
Controllers before v3.3 use the same layout for every CS.

Fixes: 27c5b17cd1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-3-noltari@gmail.com
2020-05-31 10:53:37 +02:00
Álvaro Fernández Rojas
4fd639092b mtd: rawnand: brcmnand: rename v4 registers
These registers are also used on v3.3.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-2-noltari@gmail.com
2020-05-31 10:53:37 +02:00
Miquel Raynal
e5e5631cc8 mtd: rawnand: gpmi: Use nand_extract_bits()
Drop the use of gpmi_copy_bits() in favor of the NAND helper
nand_extract_bits().

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200508171805.8627-1-miquel.raynal@bootlin.com
2020-05-31 10:53:37 +02:00
Dinghao Liu
37f7212148 mtd: rawnand: omap_elm: Fix runtime PM imbalance on error
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 <dinghao.liu@zju.edu.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522104008.28340-1-dinghao.liu@zju.edu.cn
2020-05-31 10:53:37 +02:00
Dinghao Liu
8e935b92d2 mtd: rawnand: gpmi: Fix runtime PM imbalance in gpmi_nand_probe
There is no reason that the failure of __gpmi_enable_clk()
could lead to PM usage counter decrement.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522101713.24350-1-dinghao.liu@zju.edu.cn
2020-05-31 10:53:37 +02:00
Dinghao Liu
550e68ea36 mtd: rawnand: gpmi: Fix runtime PM imbalance on error
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 <dinghao.liu@zju.edu.cn>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522095139.19653-1-dinghao.liu@zju.edu.cn
2020-05-31 10:53:37 +02:00
Boris Brezillon
5d55714fa5 mtd: rawnand: ingenic: Convert the driver to exec_op()
Let's convert the driver to exec_op() to have one less driver relying
on the legacy interface.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519232454.374081-4-boris.brezillon@collabora.com
2020-05-31 10:53:37 +02:00
Boris Brezillon
2e26301101 mtd: rawnand: ingenic: Fix the RB gpio active-high property on qi, lb60
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 <paul@crapouillou.net>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519232454.374081-3-boris.brezillon@collabora.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
9fdd78f7bc mtd: rawnand: xway: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-62-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
34531be5e8 mtd: rawnand: xway: Fix the probe error path
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 d44154f969 ("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: d44154f969 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-61-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
d9f2a1af81 mtd: rawnand: vf610: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Cc: Stefan Agner <stefan@agner.ch>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-60-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
f6fc75978d mtd: rawnand: txx9ndfmc: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-59-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
f3e169f44b mtd: rawnand: tmio: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-58-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
75e9a330a9 mtd: rawnand: tmio: Fix the probe error path
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 d44154f969 ("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: d44154f969 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-57-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
ab135c51bb mtd: rawnand: tango: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-56-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
068d86ecd9 mtd: rawnand: sunxi: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-55-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
3d84515ffd mtd: rawnand: sunxi: Fix the probe error path
nand_release() is supposed be called after MTD device registration.
Here, only nand_scan() happened, so use nand_cleanup() instead.

Fixes: 1fef62c142 ("mtd: nand: add sunxi NAND flash controller support")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-54-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
24acc3fa8b mtd: rawnand: stm32_fmc2: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Cc: Christophe Kerello <christophe.kerello@st.com>
Reviewed-by: Christophe Kerello <christophe.kerello@st.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-53-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
c121cb980c mtd: rawnand: socrates: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-52-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
9c6c2e5cc7 mtd: rawnand: socrates: Fix the probe error path
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 d44154f969 ("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: d44154f969 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-51-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
35a37f9198 mtd: rawnand: sharpsl: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-50-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
0f44b3275b mtd: rawnand: sharpsl: Fix the probe error path
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 d44154f969 ("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: d44154f969 ("mtd: nand: Provide nand_cleanup() function to free NAND related resources")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-49-miquel.raynal@bootlin.com
2020-05-31 10:53:36 +02:00
Miquel Raynal
50abacbb62 mtd: rawnand: sh_flctl: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-48-miquel.raynal@bootlin.com
2020-05-31 10:53:35 +02:00
Miquel Raynal
9748110bd2 mtd: rawnand: s3c2410: Stop using nand_release()
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 <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-47-miquel.raynal@bootlin.com
2020-05-31 10:53:35 +02:00