Michael Walle e0489f6e22 mtd: core: fix error path for nvmem provider
If mtd_otp_nvmem_add() fails, the partitions won't be removed
because there is simply no call to del_mtd_partitions().
Unfortunately, add_mtd_partitions() will print all partitions to
the kernel console. If mtd_otp_nvmem_add() returns -EPROBE_DEFER
this would print the partitions multiple times to the kernel
console. Instead move mtd_otp_nvmem_add() to the beginning of the
function.

Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230308082021.870459-3-michael@walle.cc
2023-03-08 14:31:42 +01:00
..
2023-02-25 15:05:08 -08:00
2023-02-23 10:27:32 +01:00
2022-06-28 06:33:15 -06:00
2022-04-25 10:43:12 +02:00
2022-09-21 10:38:11 +02:00
2022-09-20 10:40:30 +02:00
2022-09-19 18:14:53 +02:00