* [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate
@ 2025-09-02 8:25 Miquel Raynal
2025-09-02 8:25 ` [PATCH 2/2] mtd: concat: Fix Kconfig typos Miquel Raynal
2025-09-05 14:55 ` [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate Miquel Raynal
0 siblings, 2 replies; 3+ messages in thread
From: Miquel Raynal @ 2025-09-02 8:25 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd
Cc: Stephen Rothwell, Mahapatra, Amit Kumar, linux-next,
Thomas Petazzoni, Miquel Raynal
There is a circular dependency where the MTD core calls a function from
this driver and this driver calls a function from the MTD
core (add/del_mtd_device()).
One solution could have been to extend mtd-y with this Kconfig symbol,
but at the same time there is not reason to force =y on this driver, so
just turn it into a tristate which solves the situation.
As a consequence, we also need to export to modules the two helpers
mentioned above.
Fixes: fa47dc829519 ("mtd: Add driver for concatenating devices")
Reported-by: Stephen Rothwell <sfr@canb•auug.org.au>
Closes: https://lore.kernel.org/linux-next/IA0PR12MB76998C672B82567715227485DC06A@IA0PR12MB7699.namprd12.prod.outlook.com/
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin•com>
---
drivers/mtd/Kconfig | 2 +-
drivers/mtd/mtdcore.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index b91c3026ac7c..bf63197ec38b 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -207,7 +207,7 @@ config MTD_PARTITIONED_MASTER
what lies behind the master.
config MTD_VIRT_CONCAT
- bool "Virtual concatenated MTD devices"
+ tristate "Virtual concatenated MTD devices"
default n
depends on MTD_PARTITIONED_MASTER
help
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index e98aaa15eac2..a786353d5367 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -849,6 +849,7 @@ int add_mtd_device(struct mtd_info *mtd)
mutex_unlock(&mtd_table_mutex);
return error;
}
+EXPORT_SYMBOL_GPL(add_mtd_device);
/**
* del_mtd_device - unregister an MTD device
@@ -884,6 +885,7 @@ int del_mtd_device(struct mtd_info *mtd)
mutex_unlock(&mtd_table_mutex);
return ret;
}
+EXPORT_SYMBOL_GPL(del_mtd_device);
/*
* Set a few defaults based on the parent devices, if not provided by the
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] mtd: concat: Fix Kconfig typos
2025-09-02 8:25 [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate Miquel Raynal
@ 2025-09-02 8:25 ` Miquel Raynal
2025-09-05 14:55 ` [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2025-09-02 8:25 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd
Cc: Stephen Rothwell, Mahapatra, Amit Kumar, linux-next,
Thomas Petazzoni, Miquel Raynal
Enhance the prompt a bit and fix two little typos in the Kconfig
description.
Fixes: fa47dc829519 ("mtd: Add driver for concatenating devices")
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin•com>
---
drivers/mtd/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index bf63197ec38b..c095421c86a5 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -207,11 +207,11 @@ config MTD_PARTITIONED_MASTER
what lies behind the master.
config MTD_VIRT_CONCAT
- tristate "Virtual concatenated MTD devices"
+ tristate "Virtually concatenate MTD devices"
default n
depends on MTD_PARTITIONED_MASTER
help
- The driver enables the creation of virtual MTD device by
+ This driver enables the creation of virtual MTD devices by
concatenating multiple physical MTD devices into a single
entity. This allows for the creation of partitions larger than
the individual physical chips, extending across chip boundaries.
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate
2025-09-02 8:25 [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate Miquel Raynal
2025-09-02 8:25 ` [PATCH 2/2] mtd: concat: Fix Kconfig typos Miquel Raynal
@ 2025-09-05 14:55 ` Miquel Raynal
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2025-09-05 14:55 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
Pratyush Yadav, Michael Walle, linux-mtd, Miquel Raynal
Cc: Stephen Rothwell, Amit Kumar, linux-next, Thomas Petazzoni
On Tue, 02 Sep 2025 10:25:38 +0200, Miquel Raynal wrote:
> There is a circular dependency where the MTD core calls a function from
> this driver and this driver calls a function from the MTD
> core (add/del_mtd_device()).
>
> One solution could have been to extend mtd-y with this Kconfig symbol,
> but at the same time there is not reason to force =y on this driver, so
> just turn it into a tristate which solves the situation.
>
> [...]
Applied to mtd/next, thanks!
[1/2] mtd: concat: Set virtual concatenation to tristate
commit: c64295ea28808590b15341f4f8065c886a2bb372
[2/2] mtd: concat: Fix Kconfig typos
commit: e7f970e5740eb21b67421d981bac5dff88e8ad14
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-05 14:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 8:25 [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate Miquel Raynal
2025-09-02 8:25 ` [PATCH 2/2] mtd: concat: Fix Kconfig typos Miquel Raynal
2025-09-05 14:55 ` [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate Miquel Raynal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox