From: Miquel Raynal <miquel.raynal@bootlin•com>
To: Richard Weinberger <richard@nod•at>,
Vignesh Raghavendra <vigneshr@ti•com>,
Tudor Ambarus <tudor.ambarus@linaro•org>,
Pratyush Yadav <pratyush@kernel•org>,
Michael Walle <michael@walle•cc>, <linux-mtd@lists•infradead.org>
Cc: Stephen Rothwell <sfr@canb•auug.org.au>,
Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd•com>,
linux-next@vger•kernel.org,
Thomas Petazzoni <thomas.petazzoni@bootlin•com>,
Miquel Raynal <miquel.raynal@bootlin•com>
Subject: [PATCH 1/2] mtd: concat: Set virtual concatenation to tristate
Date: Tue, 2 Sep 2025 10:25:38 +0200 [thread overview]
Message-ID: <20250902082539.126099-1-miquel.raynal@bootlin.com> (raw)
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
next reply other threads:[~2025-09-02 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 8:25 Miquel Raynal [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250902082539.126099-1-miquel.raynal@bootlin.com \
--to=miquel.raynal@bootlin$(echo .)com \
--cc=amit.kumar-mahapatra@amd$(echo .)com \
--cc=linux-mtd@lists$(echo .)infradead.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=michael@walle$(echo .)cc \
--cc=pratyush@kernel$(echo .)org \
--cc=richard@nod$(echo .)at \
--cc=sfr@canb$(echo .)auug.org.au \
--cc=thomas.petazzoni@bootlin$(echo .)com \
--cc=tudor.ambarus@linaro$(echo .)org \
--cc=vigneshr@ti$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox