* [PATCH v2 00/13] fsi: Convert to bus probe mechanism
@ 2025-12-09 11:39 Uwe Kleine-König
2025-12-09 11:40 ` [PATCH v2 01/13] fsi: Make use of module_fsi_driver() Uwe Kleine-König
` (13 more replies)
0 siblings, 14 replies; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:39 UTC (permalink / raw)
To: Eddie James
Cc: Ninad Palsule, linux-fsi, linux-kernel, Andi Shyti, linux-i2c,
openbmc, Mark Brown, linux-spi
Hello,
this is the 2nd installment of the series converting the fsi bus to use
bus methods for .probe and .remove. The changes since the first
iteration---that can be found at
https://lore.kernel.org/lkml/cover.1764434226.git.ukleinek@kernel.org/
--- are:
- (trivially) rebase to v6.18
- add tags by Andi (for the i2c parts) and Mark Brown (for the spi
parts)
- Add a patch converting drivers/fsi/i2cr-scom.c (#8)
In the earlier thread I thought I made a mistake for (implicit) v1, but
I confused fsi with fsl and the problem doesn't apply here as it doesn't
touch the shutdown callback.
This series is not urgent, but it would be great to get this into
v6.19-rc1. With Mark's Acks and Andi's tags (though they are not an
Ack) this should be fine to be picked up in one go by Eddie.
As before there are two commit refs that should refer to the commit for
patch #2 ("fsi: Assign driver's bus in fsi_driver_register()"). As I
cannot know the commit hash yet, I wrote "FIXME" and these need updating
when the series is picked up.
Thanks
Uwe
Uwe Kleine-König (13):
fsi: Make use of module_fsi_driver()
fsi: Assign driver's bus in fsi_driver_register()
fsi: Provide thin wrappers around dev_[gs]et_data() for fsi devices
i2c: fsi: Drop assigning fsi bus
spi: fsi: Drop assigning fsi bus
fsi: Make fsi_bus_type a private variable to the core
fsi: Create bus specific probe and remove functions
fsi: i2cr-scom: Convert to fsi bus probe mechanism
fsi: master: Convert to fsi bus probe mechanism
fsi: sbefifo: Convert to fsi bus probe mechanism
fsi: scom: Convert to fsi bus probe mechanism
i2c: fsi: Convert to fsi bus probe mechanism
spi: fsi: Convert to fsi bus probe mechanism
drivers/fsi/fsi-core.c | 107 ++++++++++++++++++++++++++---------
drivers/fsi/fsi-master-hub.c | 17 +++---
drivers/fsi/fsi-sbefifo.c | 31 +++-------
drivers/fsi/fsi-scom.c | 30 +++-------
drivers/fsi/i2cr-scom.c | 15 ++---
drivers/i2c/busses/i2c-fsi.c | 16 +++---
drivers/spi/spi-fsi.c | 7 +--
include/linux/fsi.h | 13 ++++-
8 files changed, 131 insertions(+), 105 deletions(-)
base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449
--
2.47.3
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v2 01/13] fsi: Make use of module_fsi_driver()
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:25 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 02/13] fsi: Assign driver's bus in fsi_driver_register() Uwe Kleine-König
` (12 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
All other fsi drivers already use this helper to reduce boilerplate.
Catch up for the last two remaining ones.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/fsi-sbefifo.c | 13 +------------
drivers/fsi/fsi-scom.c | 13 +------------
2 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
index 0a98517f3959..5a08423d0c7e 100644
--- a/drivers/fsi/fsi-sbefifo.c
+++ b/drivers/fsi/fsi-sbefifo.c
@@ -1139,18 +1139,7 @@ static struct fsi_driver sbefifo_drv = {
}
};
-static int sbefifo_init(void)
-{
- return fsi_driver_register(&sbefifo_drv);
-}
-
-static void sbefifo_exit(void)
-{
- fsi_driver_unregister(&sbefifo_drv);
-}
-
-module_init(sbefifo_init);
-module_exit(sbefifo_exit);
+module_fsi_driver(sbefifo_drv);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Brad Bishop <bradleyb@fuzziesquirrel.com>");
MODULE_AUTHOR("Eddie James <eajames@linux.vnet.ibm.com>");
diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index 411ddc018cd8..f533106085ac 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -613,17 +613,6 @@ static struct fsi_driver scom_drv = {
}
};
-static int scom_init(void)
-{
- return fsi_driver_register(&scom_drv);
-}
-
-static void scom_exit(void)
-{
- fsi_driver_unregister(&scom_drv);
-}
-
-module_init(scom_init);
-module_exit(scom_exit);
+module_fsi_driver(scom_drv);
MODULE_DESCRIPTION("SCOM FSI Client device driver");
MODULE_LICENSE("GPL");
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 02/13] fsi: Assign driver's bus in fsi_driver_register()
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
2025-12-09 11:40 ` [PATCH v2 01/13] fsi: Make use of module_fsi_driver() Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:25 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 03/13] fsi: Provide thin wrappers around dev_[gs]et_data() for fsi devices Uwe Kleine-König
` (11 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
Instead of letting each driver assign the bus, do it once in the fsi
driver register function.
Simplify the fsi drivers that are living in drivers/fsi accordingly.
Once all fsi drivers dropped assigning the bus, fsi_bus_type can be made
a static variable.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/fsi-core.c | 2 ++
drivers/fsi/fsi-master-hub.c | 1 -
drivers/fsi/fsi-sbefifo.c | 1 -
drivers/fsi/fsi-scom.c | 1 -
drivers/fsi/i2cr-scom.c | 1 -
5 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index c6c115993ebc..e1ea1124282e 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -1394,6 +1394,8 @@ int fsi_driver_register(struct fsi_driver *fsi_drv)
if (!fsi_drv->id_table)
return -EINVAL;
+ fsi_drv->drv.bus = &fsi_bus_type;
+
return driver_register(&fsi_drv->drv);
}
EXPORT_SYMBOL_GPL(fsi_driver_register);
diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
index 6568fed7db3c..d389856d18ac 100644
--- a/drivers/fsi/fsi-master-hub.c
+++ b/drivers/fsi/fsi-master-hub.c
@@ -288,7 +288,6 @@ static struct fsi_driver hub_master_driver = {
.id_table = hub_master_ids,
.drv = {
.name = "fsi-master-hub",
- .bus = &fsi_bus_type,
.probe = hub_master_probe,
.remove = hub_master_remove,
}
diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
index 5a08423d0c7e..fde1c34743a0 100644
--- a/drivers/fsi/fsi-sbefifo.c
+++ b/drivers/fsi/fsi-sbefifo.c
@@ -1133,7 +1133,6 @@ static struct fsi_driver sbefifo_drv = {
.id_table = sbefifo_ids,
.drv = {
.name = DEVICE_NAME,
- .bus = &fsi_bus_type,
.probe = sbefifo_probe,
.remove = sbefifo_remove,
}
diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index f533106085ac..2eda44451cc1 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -606,7 +606,6 @@ static struct fsi_driver scom_drv = {
.id_table = scom_ids,
.drv = {
.name = "scom",
- .bus = &fsi_bus_type,
.of_match_table = scom_of_ids,
.probe = scom_probe,
.remove = scom_remove,
diff --git a/drivers/fsi/i2cr-scom.c b/drivers/fsi/i2cr-scom.c
index cb7e02213032..dfdb16afd205 100644
--- a/drivers/fsi/i2cr-scom.c
+++ b/drivers/fsi/i2cr-scom.c
@@ -140,7 +140,6 @@ static struct fsi_driver i2cr_scom_driver = {
.id_table = i2cr_scom_ids,
.drv = {
.name = "i2cr_scom",
- .bus = &fsi_bus_type,
.of_match_table = i2cr_scom_of_ids,
.probe = i2cr_scom_probe,
.remove = i2cr_scom_remove,
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 03/13] fsi: Provide thin wrappers around dev_[gs]et_data() for fsi devices
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
2025-12-09 11:40 ` [PATCH v2 01/13] fsi: Make use of module_fsi_driver() Uwe Kleine-König
2025-12-09 11:40 ` [PATCH v2 02/13] fsi: Assign driver's bus in fsi_driver_register() Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:25 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 04/13] i2c: fsi: Drop assigning fsi bus Uwe Kleine-König
` (10 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
Similar to wrappers for other subsystems provide inline functions for
fsi devices to store driver data.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
include/linux/fsi.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/fsi.h b/include/linux/fsi.h
index adea1b432f2d..05be75869a69 100644
--- a/include/linux/fsi.h
+++ b/include/linux/fsi.h
@@ -19,6 +19,16 @@ struct fsi_device {
uint32_t size;
};
+static inline void *fsi_get_drvdata(struct fsi_device *fsi_dev)
+{
+ return dev_get_drvdata(&fsi_dev->dev);
+}
+
+static inline void fsi_set_drvdata(struct fsi_device *fsi_dev, void *data)
+{
+ dev_set_drvdata(&fsi_dev->dev, data);
+}
+
extern int fsi_device_read(struct fsi_device *dev, uint32_t addr,
void *val, size_t size);
extern int fsi_device_write(struct fsi_device *dev, uint32_t addr,
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 04/13] i2c: fsi: Drop assigning fsi bus
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (2 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 03/13] fsi: Provide thin wrappers around dev_[gs]et_data() for fsi devices Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:26 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 05/13] spi: " Uwe Kleine-König
` (9 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James
Cc: Ninad Palsule, linux-fsi, Andi Shyti, linux-i2c, openbmc,
linux-kernel
Since commit FIXME ("fsi: Assign driver's bus in fsi_driver_register()")
module_fsi_driver() cares about assigning the driver's bus member. Drop
the explicit driver specific assignment.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
---
drivers/i2c/busses/i2c-fsi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
index ae016a9431da..e98dd5dcac0f 100644
--- a/drivers/i2c/busses/i2c-fsi.c
+++ b/drivers/i2c/busses/i2c-fsi.c
@@ -763,7 +763,6 @@ static struct fsi_driver fsi_i2c_driver = {
.id_table = fsi_i2c_ids,
.drv = {
.name = "i2c-fsi",
- .bus = &fsi_bus_type,
.probe = fsi_i2c_probe,
.remove = fsi_i2c_remove,
},
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 05/13] spi: fsi: Drop assigning fsi bus
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (3 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 04/13] i2c: fsi: Drop assigning fsi bus Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:26 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 06/13] fsi: Make fsi_bus_type a private variable to the core Uwe Kleine-König
` (8 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, Mark Brown, linux-spi, linux-kernel
Since commit FIXME ("fsi: Assign driver's bus in fsi_driver_register()")
module_fsi_driver() cares about assigning the driver's bus member. Drop
the explicit driver specific assignment.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Acked-by: Mark Brown <broonie@kernel.org>
---
drivers/spi/spi-fsi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
index e01c63d23b64..f9c15b99dba5 100644
--- a/drivers/spi/spi-fsi.c
+++ b/drivers/spi/spi-fsi.c
@@ -595,7 +595,6 @@ static struct fsi_driver fsi_spi_driver = {
.id_table = fsi_spi_ids,
.drv = {
.name = "spi-fsi",
- .bus = &fsi_bus_type,
.probe = fsi_spi_probe,
},
};
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 06/13] fsi: Make fsi_bus_type a private variable to the core
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (4 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 05/13] spi: " Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:26 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 07/13] fsi: Create bus specific probe and remove functions Uwe Kleine-König
` (7 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
There are no users of fsi_bus_type outside of fsi-core.c, so make that
variable static, don't export it and drop the declaration from the
public header file.
As there is a usage of fsi_bus_type in fsi_create_device() the
definition of that variable must happen further up in the file to not
have to add a local declaration.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/fsi-core.c | 67 +++++++++++++++++++++---------------------
include/linux/fsi.h | 1 -
2 files changed, 33 insertions(+), 35 deletions(-)
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index e1ea1124282e..4e60d4b17c11 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -100,6 +100,39 @@ static int fsi_master_write(struct fsi_master *master, int link,
uint8_t slave_id, uint32_t addr, const void *val, size_t size);
static int fsi_master_break(struct fsi_master *master, int link);
+/* FSI core & Linux bus type definitions */
+
+static int fsi_bus_match(struct device *dev, const struct device_driver *drv)
+{
+ struct fsi_device *fsi_dev = to_fsi_dev(dev);
+ const struct fsi_driver *fsi_drv = to_fsi_drv(drv);
+ const struct fsi_device_id *id;
+
+ if (!fsi_drv->id_table)
+ return 0;
+
+ for (id = fsi_drv->id_table; id->engine_type; id++) {
+ if (id->engine_type != fsi_dev->engine_type)
+ continue;
+ if (id->version == FSI_VERSION_ANY ||
+ id->version == fsi_dev->version) {
+ if (drv->of_match_table) {
+ if (of_driver_match_device(dev, drv))
+ return 1;
+ } else {
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
+
+static const struct bus_type fsi_bus_type = {
+ .name = "fsi",
+ .match = fsi_bus_match,
+};
+
/*
* fsi_device_read() / fsi_device_write() / fsi_device_peek()
*
@@ -1359,34 +1392,6 @@ void fsi_master_unregister(struct fsi_master *master)
}
EXPORT_SYMBOL_GPL(fsi_master_unregister);
-/* FSI core & Linux bus type definitions */
-
-static int fsi_bus_match(struct device *dev, const struct device_driver *drv)
-{
- struct fsi_device *fsi_dev = to_fsi_dev(dev);
- const struct fsi_driver *fsi_drv = to_fsi_drv(drv);
- const struct fsi_device_id *id;
-
- if (!fsi_drv->id_table)
- return 0;
-
- for (id = fsi_drv->id_table; id->engine_type; id++) {
- if (id->engine_type != fsi_dev->engine_type)
- continue;
- if (id->version == FSI_VERSION_ANY ||
- id->version == fsi_dev->version) {
- if (drv->of_match_table) {
- if (of_driver_match_device(dev, drv))
- return 1;
- } else {
- return 1;
- }
- }
- }
-
- return 0;
-}
-
int fsi_driver_register(struct fsi_driver *fsi_drv)
{
if (!fsi_drv)
@@ -1406,12 +1411,6 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv)
}
EXPORT_SYMBOL_GPL(fsi_driver_unregister);
-const struct bus_type fsi_bus_type = {
- .name = "fsi",
- .match = fsi_bus_match,
-};
-EXPORT_SYMBOL_GPL(fsi_bus_type);
-
static int __init fsi_init(void)
{
int rc;
diff --git a/include/linux/fsi.h b/include/linux/fsi.h
index 05be75869a69..3e3a8f3adac3 100644
--- a/include/linux/fsi.h
+++ b/include/linux/fsi.h
@@ -78,7 +78,6 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,
extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr,
const void *val, size_t size);
-extern const struct bus_type fsi_bus_type;
extern const struct device_type fsi_cdev_type;
enum fsi_dev_type {
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 07/13] fsi: Create bus specific probe and remove functions
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (5 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 06/13] fsi: Make fsi_bus_type a private variable to the core Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:27 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 08/13] fsi: i2cr-scom: Convert to fsi bus probe mechanism Uwe Kleine-König
` (6 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
Introduce a bus specific probe and remove function. For now this only
allows to get rid of a cast of the generic device to an fsi device in
the drivers and changes the remove prototype to return void---a non-zero
return value is ignored anyhow.
The objective is to get rid of users of struct device callbacks
.probe(), .remove() and .shutdown() to eventually remove these.
Until all fsi drivers are converted this results in a runtime warning
about the drivers needing an update because there is a bus probe
function and a driver probe function.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/fsi-core.c | 50 ++++++++++++++++++++++++++++++++++++++++++
include/linux/fsi.h | 2 ++
2 files changed, 52 insertions(+)
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 4e60d4b17c11..83599a1c548b 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -128,9 +128,31 @@ static int fsi_bus_match(struct device *dev, const struct device_driver *drv)
return 0;
}
+static int fsi_probe(struct device *dev)
+{
+ struct fsi_device *fsidev = to_fsi_dev(dev);
+ struct fsi_driver *fsidrv = to_fsi_drv(dev->driver);
+
+ if (fsidrv->probe)
+ return fsidrv->probe(fsidev);
+ else
+ return 0;
+}
+
+static void fsi_remove(struct device *dev)
+{
+ struct fsi_device *fsidev = to_fsi_dev(dev);
+ struct fsi_driver *fsidrv = to_fsi_drv(dev->driver);
+
+ if (fsidrv->remove)
+ fsidrv->remove(fsidev);
+}
+
static const struct bus_type fsi_bus_type = {
.name = "fsi",
.match = fsi_bus_match,
+ .probe = fsi_probe,
+ .remove = fsi_remove,
};
/*
@@ -1392,6 +1414,25 @@ void fsi_master_unregister(struct fsi_master *master)
}
EXPORT_SYMBOL_GPL(fsi_master_unregister);
+static int fsi_legacy_probe(struct fsi_device *fsidev)
+{
+ struct device *dev = &fsidev->dev;
+ struct device_driver *driver = dev->driver;
+
+ return driver->probe(dev);
+}
+
+static void fsi_legacy_remove(struct fsi_device *fsidev)
+{
+ struct device *dev = &fsidev->dev;
+ struct device_driver *driver = dev->driver;
+ int ret;
+
+ ret = driver->remove(dev);
+ if (unlikely(ret))
+ dev_warn(dev, "Ignoring return value of remove callback (%pe)\n", ERR_PTR(ret));
+}
+
int fsi_driver_register(struct fsi_driver *fsi_drv)
{
if (!fsi_drv)
@@ -1401,6 +1442,15 @@ int fsi_driver_register(struct fsi_driver *fsi_drv)
fsi_drv->drv.bus = &fsi_bus_type;
+ /*
+ * This driver needs updating. Note that driver_register() warns about
+ * this, so we're not adding another warning here.
+ */
+ if (!fsi_drv->probe && fsi_drv->drv.probe)
+ fsi_drv->probe = fsi_legacy_probe;
+ if (!fsi_drv->remove && fsi_drv->drv.remove)
+ fsi_drv->remove = fsi_legacy_remove;
+
return driver_register(&fsi_drv->drv);
}
EXPORT_SYMBOL_GPL(fsi_driver_register);
diff --git a/include/linux/fsi.h b/include/linux/fsi.h
index 3e3a8f3adac3..9c67c43f9e6c 100644
--- a/include/linux/fsi.h
+++ b/include/linux/fsi.h
@@ -49,6 +49,8 @@ struct fsi_device_id {
.engine_type = (t), .version = (v),
struct fsi_driver {
+ int (*probe)(struct fsi_device *fsidev);
+ void (*remove)(struct fsi_device *fsidev);
struct device_driver drv;
const struct fsi_device_id *id_table;
};
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 08/13] fsi: i2cr-scom: Convert to fsi bus probe mechanism
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (6 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 07/13] fsi: Create bus specific probe and remove functions Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:27 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 09/13] fsi: master: " Uwe Kleine-König
` (5 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
The fsi bus got a dedicated probe and remove callback. Make use of them.
This fixes a runtime warning about the driver needing to be converted to
the bus methods.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/i2cr-scom.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/fsi/i2cr-scom.c b/drivers/fsi/i2cr-scom.c
index dfdb16afd205..3efca2e944bb 100644
--- a/drivers/fsi/i2cr-scom.c
+++ b/drivers/fsi/i2cr-scom.c
@@ -81,9 +81,9 @@ static const struct file_operations i2cr_scom_fops = {
.write = i2cr_scom_write,
};
-static int i2cr_scom_probe(struct device *dev)
+static int i2cr_scom_probe(struct fsi_device *fsi_dev)
{
- struct fsi_device *fsi_dev = to_fsi_dev(dev);
+ struct device *dev = &fsi_dev->dev;
struct i2cr_scom *scom;
int didx;
int ret;
@@ -115,14 +115,12 @@ static int i2cr_scom_probe(struct device *dev)
return ret;
}
-static int i2cr_scom_remove(struct device *dev)
+static void i2cr_scom_remove(struct fsi_device *fsi_dev)
{
- struct i2cr_scom *scom = dev_get_drvdata(dev);
+ struct i2cr_scom *scom = dev_get_drvdata(&fsi_dev->dev);
cdev_device_del(&scom->cdev, &scom->dev);
fsi_free_minor(scom->dev.devt);
-
- return 0;
}
static const struct of_device_id i2cr_scom_of_ids[] = {
@@ -137,12 +135,12 @@ static const struct fsi_device_id i2cr_scom_ids[] = {
};
static struct fsi_driver i2cr_scom_driver = {
+ .probe = i2cr_scom_probe,
+ .remove = i2cr_scom_remove,
.id_table = i2cr_scom_ids,
.drv = {
.name = "i2cr_scom",
.of_match_table = i2cr_scom_of_ids,
- .probe = i2cr_scom_probe,
- .remove = i2cr_scom_remove,
}
};
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 09/13] fsi: master: Convert to fsi bus probe mechanism
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (7 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 08/13] fsi: i2cr-scom: Convert to fsi bus probe mechanism Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:27 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 10/13] fsi: sbefifo: " Uwe Kleine-König
` (4 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
The fsi bus got a dedicated probe function. Make use of that. This fixes
a runtime warning about the driver needing to be converted to the bus
probe method.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/fsi-master-hub.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
index d389856d18ac..a84955bb23b1 100644
--- a/drivers/fsi/fsi-master-hub.c
+++ b/drivers/fsi/fsi-master-hub.c
@@ -192,9 +192,9 @@ static int hub_master_init(struct fsi_master_hub *hub)
return fsi_device_write(dev, FSI_MRESB0, ®, sizeof(reg));
}
-static int hub_master_probe(struct device *dev)
+static int hub_master_probe(struct fsi_device *fsi_dev)
{
- struct fsi_device *fsi_dev = to_fsi_dev(dev);
+ struct device *dev = &fsi_dev->dev;
struct fsi_master_hub *hub;
uint32_t reg, links;
__be32 __reg;
@@ -235,7 +235,7 @@ static int hub_master_probe(struct device *dev)
hub->master.send_break = hub_master_break;
hub->master.link_enable = hub_master_link_enable;
- dev_set_drvdata(dev, hub);
+ fsi_set_drvdata(fsi_dev, hub);
hub_master_init(hub);
@@ -259,9 +259,9 @@ static int hub_master_probe(struct device *dev)
return rc;
}
-static int hub_master_remove(struct device *dev)
+static void hub_master_remove(struct fsi_device *fsi_dev)
{
- struct fsi_master_hub *hub = dev_get_drvdata(dev);
+ struct fsi_master_hub *hub = fsi_get_drvdata(fsi_dev);
fsi_master_unregister(&hub->master);
fsi_slave_release_range(hub->upstream->slave, hub->addr, hub->size);
@@ -272,8 +272,6 @@ static int hub_master_remove(struct device *dev)
* the hub
*/
put_device(&hub->master.dev);
-
- return 0;
}
static const struct fsi_device_id hub_master_ids[] = {
@@ -286,10 +284,10 @@ static const struct fsi_device_id hub_master_ids[] = {
static struct fsi_driver hub_master_driver = {
.id_table = hub_master_ids,
+ .probe = hub_master_probe,
+ .remove = hub_master_remove,
.drv = {
.name = "fsi-master-hub",
- .probe = hub_master_probe,
- .remove = hub_master_remove,
}
};
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 10/13] fsi: sbefifo: Convert to fsi bus probe mechanism
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (8 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 09/13] fsi: master: " Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:28 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 11/13] fsi: scom: " Uwe Kleine-König
` (3 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
The fsi bus got a dedicated probe function. Make use of that. This fixes
a runtime warning about the driver needing to be converted to the bus
probe method.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/fsi-sbefifo.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
index fde1c34743a0..6ca5817910cd 100644
--- a/drivers/fsi/fsi-sbefifo.c
+++ b/drivers/fsi/fsi-sbefifo.c
@@ -1022,9 +1022,9 @@ static void sbefifo_free(struct device *dev)
* Probe/remove
*/
-static int sbefifo_probe(struct device *dev)
+static int sbefifo_probe(struct fsi_device *fsi_dev)
{
- struct fsi_device *fsi_dev = to_fsi_dev(dev);
+ struct device *dev = &fsi_dev->dev;
struct sbefifo *sbefifo;
struct device_node *np;
struct platform_device *child;
@@ -1045,7 +1045,7 @@ static int sbefifo_probe(struct device *dev)
sbefifo->magic = SBEFIFO_MAGIC;
sbefifo->fsi_dev = fsi_dev;
- dev_set_drvdata(dev, sbefifo);
+ fsi_set_drvdata(fsi_dev, sbefifo);
mutex_init(&sbefifo->lock);
sbefifo->timeout_in_cmd_ms = SBEFIFO_TIMEOUT_IN_CMD;
sbefifo->timeout_start_rsp_ms = SBEFIFO_TIMEOUT_START_RSP;
@@ -1101,9 +1101,10 @@ static int sbefifo_unregister_child(struct device *dev, void *data)
return 0;
}
-static int sbefifo_remove(struct device *dev)
+static void sbefifo_remove(struct fsi_device *fsi_dev)
{
- struct sbefifo *sbefifo = dev_get_drvdata(dev);
+ struct device *dev = &fsi_dev->dev;
+ struct sbefifo *sbefifo = fsi_get_drvdata(fsi_dev);
dev_dbg(dev, "Removing sbefifo device...\n");
@@ -1117,8 +1118,6 @@ static int sbefifo_remove(struct device *dev)
fsi_free_minor(sbefifo->dev.devt);
device_for_each_child(dev, NULL, sbefifo_unregister_child);
put_device(&sbefifo->dev);
-
- return 0;
}
static const struct fsi_device_id sbefifo_ids[] = {
@@ -1131,10 +1130,10 @@ static const struct fsi_device_id sbefifo_ids[] = {
static struct fsi_driver sbefifo_drv = {
.id_table = sbefifo_ids,
+ .probe = sbefifo_probe,
+ .remove = sbefifo_remove,
.drv = {
.name = DEVICE_NAME,
- .probe = sbefifo_probe,
- .remove = sbefifo_remove,
}
};
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 11/13] fsi: scom: Convert to fsi bus probe mechanism
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (9 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 10/13] fsi: sbefifo: " Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:28 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 12/13] i2c: fsi: " Uwe Kleine-König
` (2 subsequent siblings)
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, linux-kernel
The fsi bus got a dedicated probe function. Make use of that. This fixes
a runtime warning about the driver needing to be converted to the bus
probe method.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/fsi/fsi-scom.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index 2eda44451cc1..67cd45605fe4 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -527,16 +527,16 @@ static void scom_free(struct device *dev)
kfree(scom);
}
-static int scom_probe(struct device *dev)
+static int scom_probe(struct fsi_device *fsi_dev)
{
- struct fsi_device *fsi_dev = to_fsi_dev(dev);
+ struct device *dev = &fsi_dev->dev;
struct scom_device *scom;
int rc, didx;
scom = kzalloc(sizeof(*scom), GFP_KERNEL);
if (!scom)
return -ENOMEM;
- dev_set_drvdata(dev, scom);
+ fsi_set_drvdata(fsi_dev, scom);
mutex_init(&scom->lock);
/* Grab a reference to the device (parent of our cdev), we'll drop it later */
@@ -574,9 +574,9 @@ static int scom_probe(struct device *dev)
return rc;
}
-static int scom_remove(struct device *dev)
+static void scom_remove(struct fsi_device *fsi_dev)
{
- struct scom_device *scom = dev_get_drvdata(dev);
+ struct scom_device *scom = fsi_get_drvdata(fsi_dev);
mutex_lock(&scom->lock);
scom->dead = true;
@@ -584,8 +584,6 @@ static int scom_remove(struct device *dev)
cdev_device_del(&scom->cdev, &scom->dev);
fsi_free_minor(scom->dev.devt);
put_device(&scom->dev);
-
- return 0;
}
static const struct of_device_id scom_of_ids[] = {
@@ -604,11 +602,11 @@ static const struct fsi_device_id scom_ids[] = {
static struct fsi_driver scom_drv = {
.id_table = scom_ids,
+ .probe = scom_probe,
+ .remove = scom_remove,
.drv = {
.name = "scom",
.of_match_table = scom_of_ids,
- .probe = scom_probe,
- .remove = scom_remove,
}
};
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 12/13] i2c: fsi: Convert to fsi bus probe mechanism
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (10 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 11/13] fsi: scom: " Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:29 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 13/13] spi: " Uwe Kleine-König
2026-01-12 9:47 ` [PATCH v2 00/13] fsi: Convert to " Uwe Kleine-König
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James
Cc: Ninad Palsule, linux-fsi, Andi Shyti, linux-i2c, openbmc,
linux-kernel
The fsi bus got a dedicated probe function. Make use of that. This fixes
a runtime warning about the driver needing to be converted to the bus
probe method.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
---
drivers/i2c/busses/i2c-fsi.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
index e98dd5dcac0f..3a7e577e6eac 100644
--- a/drivers/i2c/busses/i2c-fsi.c
+++ b/drivers/i2c/busses/i2c-fsi.c
@@ -674,8 +674,9 @@ static struct device_node *fsi_i2c_find_port_of_node(struct device_node *fsi,
return NULL;
}
-static int fsi_i2c_probe(struct device *dev)
+static int fsi_i2c_probe(struct fsi_device *fsi_dev)
{
+ struct device *dev = &fsi_dev->dev;
struct fsi_i2c_ctrl *i2c;
struct fsi_i2c_port *port;
struct device_node *np;
@@ -735,14 +736,14 @@ static int fsi_i2c_probe(struct device *dev)
list_add(&port->list, &i2c->ports);
}
- dev_set_drvdata(dev, i2c);
+ fsi_set_drvdata(fsi_dev, i2c);
return 0;
}
-static int fsi_i2c_remove(struct device *dev)
+static void fsi_i2c_remove(struct fsi_device *fsi_dev)
{
- struct fsi_i2c_ctrl *i2c = dev_get_drvdata(dev);
+ struct fsi_i2c_ctrl *i2c = fsi_get_drvdata(fsi_dev);
struct fsi_i2c_port *port, *tmp;
list_for_each_entry_safe(port, tmp, &i2c->ports, list) {
@@ -750,8 +751,6 @@ static int fsi_i2c_remove(struct device *dev)
i2c_del_adapter(&port->adapter);
kfree(port);
}
-
- return 0;
}
static const struct fsi_device_id fsi_i2c_ids[] = {
@@ -761,10 +760,10 @@ static const struct fsi_device_id fsi_i2c_ids[] = {
static struct fsi_driver fsi_i2c_driver = {
.id_table = fsi_i2c_ids,
+ .probe = fsi_i2c_probe,
+ .remove = fsi_i2c_remove,
.drv = {
.name = "i2c-fsi",
- .probe = fsi_i2c_probe,
- .remove = fsi_i2c_remove,
},
};
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 13/13] spi: fsi: Convert to fsi bus probe mechanism
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (11 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 12/13] i2c: fsi: " Uwe Kleine-König
@ 2025-12-09 11:40 ` Uwe Kleine-König
2026-01-27 15:29 ` Eddie James
2026-01-12 9:47 ` [PATCH v2 00/13] fsi: Convert to " Uwe Kleine-König
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2025-12-09 11:40 UTC (permalink / raw)
To: Eddie James; +Cc: Ninad Palsule, linux-fsi, Mark Brown, linux-spi, linux-kernel
The fsi bus got a dedicated probe function. Make use of that. This fixes
a runtime warning about the driver needing to be converted to the bus
probe method.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Acked-by: Mark Brown <broonie@kernel.org>
---
drivers/spi/spi-fsi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
index f9c15b99dba5..07dc3d24f2c9 100644
--- a/drivers/spi/spi-fsi.c
+++ b/drivers/spi/spi-fsi.c
@@ -528,13 +528,13 @@ static size_t fsi_spi_max_transfer_size(struct spi_device *spi)
return SPI_FSI_MAX_RX_SIZE;
}
-static int fsi_spi_probe(struct device *dev)
+static int fsi_spi_probe(struct fsi_device *fsi)
{
int rc;
struct device_node *np;
int num_controllers_registered = 0;
struct fsi2spi *bridge;
- struct fsi_device *fsi = to_fsi_dev(dev);
+ struct device *dev = &fsi->dev;
rc = fsi_spi_check_mux(fsi, dev);
if (rc)
@@ -593,9 +593,9 @@ MODULE_DEVICE_TABLE(fsi, fsi_spi_ids);
static struct fsi_driver fsi_spi_driver = {
.id_table = fsi_spi_ids,
+ .probe = fsi_spi_probe,
.drv = {
.name = "spi-fsi",
- .probe = fsi_spi_probe,
},
};
module_fsi_driver(fsi_spi_driver);
--
2.47.3
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH v2 00/13] fsi: Convert to bus probe mechanism
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
` (12 preceding siblings ...)
2025-12-09 11:40 ` [PATCH v2 13/13] spi: " Uwe Kleine-König
@ 2026-01-12 9:47 ` Uwe Kleine-König
2026-01-27 15:31 ` Eddie James
13 siblings, 1 reply; 29+ messages in thread
From: Uwe Kleine-König @ 2026-01-12 9:47 UTC (permalink / raw)
To: Eddie James
Cc: Ninad Palsule, linux-fsi, linux-kernel, Andi Shyti, linux-i2c,
openbmc, Mark Brown, linux-spi, Greg Kroah-Hartman
[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]
Hello Eddie,
On Tue, Dec 09, 2025 at 12:39:28PM +0100, Uwe Kleine-König wrote:
> Hello,
>
> this is the 2nd installment of the series converting the fsi bus to use
> bus methods for .probe and .remove. The changes since the first
> iteration---that can be found at
> https://lore.kernel.org/lkml/cover.1764434226.git.ukleinek@kernel.org/
> --- are:
>
> - (trivially) rebase to v6.18
> - add tags by Andi (for the i2c parts) and Mark Brown (for the spi
> parts)
> - Add a patch converting drivers/fsi/i2cr-scom.c (#8)
>
> In the earlier thread I thought I made a mistake for (implicit) v1, but
> I confused fsi with fsl and the problem doesn't apply here as it doesn't
> touch the shutdown callback.
>
> This series is not urgent, but it would be great to get this into
> v6.19-rc1. With Mark's Acks and Andi's tags (though they are not an
> Ack) this should be fine to be picked up in one go by Eddie.
>
> As before there are two commit refs that should refer to the commit for
> patch #2 ("fsi: Assign driver's bus in fsi_driver_register()"). As I
> cannot know the commit hash yet, I wrote "FIXME" and these need updating
> when the series is picked up.
gentle ping. While my quest to drop .probe() and .remove() is still in
early stages, I'd like to see this series go in before it bitrots. It
should have all the acks necessary to merge it.
Alternatively, should I ask Greg (added to Cc:) to merge?
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 01/13] fsi: Make use of module_fsi_driver()
2025-12-09 11:40 ` [PATCH v2 01/13] fsi: Make use of module_fsi_driver() Uwe Kleine-König
@ 2026-01-27 15:25 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:25 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> All other fsi drivers already use this helper to reduce boilerplate.
> Catch up for the last two remaining ones.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/fsi-sbefifo.c | 13 +------------
> drivers/fsi/fsi-scom.c | 13 +------------
> 2 files changed, 2 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
> index 0a98517f3959..5a08423d0c7e 100644
> --- a/drivers/fsi/fsi-sbefifo.c
> +++ b/drivers/fsi/fsi-sbefifo.c
> @@ -1139,18 +1139,7 @@ static struct fsi_driver sbefifo_drv = {
> }
> };
>
> -static int sbefifo_init(void)
> -{
> - return fsi_driver_register(&sbefifo_drv);
> -}
> -
> -static void sbefifo_exit(void)
> -{
> - fsi_driver_unregister(&sbefifo_drv);
> -}
> -
> -module_init(sbefifo_init);
> -module_exit(sbefifo_exit);
> +module_fsi_driver(sbefifo_drv);
> MODULE_LICENSE("GPL");
> MODULE_AUTHOR("Brad Bishop <bradleyb@fuzziesquirrel.com>");
> MODULE_AUTHOR("Eddie James <eajames@linux.vnet.ibm.com>");
> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
> index 411ddc018cd8..f533106085ac 100644
> --- a/drivers/fsi/fsi-scom.c
> +++ b/drivers/fsi/fsi-scom.c
> @@ -613,17 +613,6 @@ static struct fsi_driver scom_drv = {
> }
> };
>
> -static int scom_init(void)
> -{
> - return fsi_driver_register(&scom_drv);
> -}
> -
> -static void scom_exit(void)
> -{
> - fsi_driver_unregister(&scom_drv);
> -}
> -
> -module_init(scom_init);
> -module_exit(scom_exit);
> +module_fsi_driver(scom_drv);
> MODULE_DESCRIPTION("SCOM FSI Client device driver");
> MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 02/13] fsi: Assign driver's bus in fsi_driver_register()
2025-12-09 11:40 ` [PATCH v2 02/13] fsi: Assign driver's bus in fsi_driver_register() Uwe Kleine-König
@ 2026-01-27 15:25 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:25 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> Instead of letting each driver assign the bus, do it once in the fsi
> driver register function.
>
> Simplify the fsi drivers that are living in drivers/fsi accordingly.
>
> Once all fsi drivers dropped assigning the bus, fsi_bus_type can be made
> a static variable.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/fsi-core.c | 2 ++
> drivers/fsi/fsi-master-hub.c | 1 -
> drivers/fsi/fsi-sbefifo.c | 1 -
> drivers/fsi/fsi-scom.c | 1 -
> drivers/fsi/i2cr-scom.c | 1 -
> 5 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
> index c6c115993ebc..e1ea1124282e 100644
> --- a/drivers/fsi/fsi-core.c
> +++ b/drivers/fsi/fsi-core.c
> @@ -1394,6 +1394,8 @@ int fsi_driver_register(struct fsi_driver *fsi_drv)
> if (!fsi_drv->id_table)
> return -EINVAL;
>
> + fsi_drv->drv.bus = &fsi_bus_type;
> +
> return driver_register(&fsi_drv->drv);
> }
> EXPORT_SYMBOL_GPL(fsi_driver_register);
> diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
> index 6568fed7db3c..d389856d18ac 100644
> --- a/drivers/fsi/fsi-master-hub.c
> +++ b/drivers/fsi/fsi-master-hub.c
> @@ -288,7 +288,6 @@ static struct fsi_driver hub_master_driver = {
> .id_table = hub_master_ids,
> .drv = {
> .name = "fsi-master-hub",
> - .bus = &fsi_bus_type,
> .probe = hub_master_probe,
> .remove = hub_master_remove,
> }
> diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
> index 5a08423d0c7e..fde1c34743a0 100644
> --- a/drivers/fsi/fsi-sbefifo.c
> +++ b/drivers/fsi/fsi-sbefifo.c
> @@ -1133,7 +1133,6 @@ static struct fsi_driver sbefifo_drv = {
> .id_table = sbefifo_ids,
> .drv = {
> .name = DEVICE_NAME,
> - .bus = &fsi_bus_type,
> .probe = sbefifo_probe,
> .remove = sbefifo_remove,
> }
> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
> index f533106085ac..2eda44451cc1 100644
> --- a/drivers/fsi/fsi-scom.c
> +++ b/drivers/fsi/fsi-scom.c
> @@ -606,7 +606,6 @@ static struct fsi_driver scom_drv = {
> .id_table = scom_ids,
> .drv = {
> .name = "scom",
> - .bus = &fsi_bus_type,
> .of_match_table = scom_of_ids,
> .probe = scom_probe,
> .remove = scom_remove,
> diff --git a/drivers/fsi/i2cr-scom.c b/drivers/fsi/i2cr-scom.c
> index cb7e02213032..dfdb16afd205 100644
> --- a/drivers/fsi/i2cr-scom.c
> +++ b/drivers/fsi/i2cr-scom.c
> @@ -140,7 +140,6 @@ static struct fsi_driver i2cr_scom_driver = {
> .id_table = i2cr_scom_ids,
> .drv = {
> .name = "i2cr_scom",
> - .bus = &fsi_bus_type,
> .of_match_table = i2cr_scom_of_ids,
> .probe = i2cr_scom_probe,
> .remove = i2cr_scom_remove,
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 03/13] fsi: Provide thin wrappers around dev_[gs]et_data() for fsi devices
2025-12-09 11:40 ` [PATCH v2 03/13] fsi: Provide thin wrappers around dev_[gs]et_data() for fsi devices Uwe Kleine-König
@ 2026-01-27 15:25 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:25 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> Similar to wrappers for other subsystems provide inline functions for
> fsi devices to store driver data.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> include/linux/fsi.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/fsi.h b/include/linux/fsi.h
> index adea1b432f2d..05be75869a69 100644
> --- a/include/linux/fsi.h
> +++ b/include/linux/fsi.h
> @@ -19,6 +19,16 @@ struct fsi_device {
> uint32_t size;
> };
>
> +static inline void *fsi_get_drvdata(struct fsi_device *fsi_dev)
> +{
> + return dev_get_drvdata(&fsi_dev->dev);
> +}
> +
> +static inline void fsi_set_drvdata(struct fsi_device *fsi_dev, void *data)
> +{
> + dev_set_drvdata(&fsi_dev->dev, data);
> +}
> +
> extern int fsi_device_read(struct fsi_device *dev, uint32_t addr,
> void *val, size_t size);
> extern int fsi_device_write(struct fsi_device *dev, uint32_t addr,
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 04/13] i2c: fsi: Drop assigning fsi bus
2025-12-09 11:40 ` [PATCH v2 04/13] i2c: fsi: Drop assigning fsi bus Uwe Kleine-König
@ 2026-01-27 15:26 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:26 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Ninad Palsule, linux-fsi, Andi Shyti, linux-i2c, openbmc,
linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> Since commit FIXME ("fsi: Assign driver's bus in fsi_driver_register()")
> module_fsi_driver() cares about assigning the driver's bus member. Drop
> the explicit driver specific assignment.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> ---
> drivers/i2c/busses/i2c-fsi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
> index ae016a9431da..e98dd5dcac0f 100644
> --- a/drivers/i2c/busses/i2c-fsi.c
> +++ b/drivers/i2c/busses/i2c-fsi.c
> @@ -763,7 +763,6 @@ static struct fsi_driver fsi_i2c_driver = {
> .id_table = fsi_i2c_ids,
> .drv = {
> .name = "i2c-fsi",
> - .bus = &fsi_bus_type,
> .probe = fsi_i2c_probe,
> .remove = fsi_i2c_remove,
> },
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/13] spi: fsi: Drop assigning fsi bus
2025-12-09 11:40 ` [PATCH v2 05/13] spi: " Uwe Kleine-König
@ 2026-01-27 15:26 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:26 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Ninad Palsule, linux-fsi, Mark Brown, linux-spi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> Since commit FIXME ("fsi: Assign driver's bus in fsi_driver_register()")
> module_fsi_driver() cares about assigning the driver's bus member. Drop
> the explicit driver specific assignment.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> Acked-by: Mark Brown <broonie@kernel.org>
> ---
> drivers/spi/spi-fsi.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
> index e01c63d23b64..f9c15b99dba5 100644
> --- a/drivers/spi/spi-fsi.c
> +++ b/drivers/spi/spi-fsi.c
> @@ -595,7 +595,6 @@ static struct fsi_driver fsi_spi_driver = {
> .id_table = fsi_spi_ids,
> .drv = {
> .name = "spi-fsi",
> - .bus = &fsi_bus_type,
> .probe = fsi_spi_probe,
> },
> };
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 06/13] fsi: Make fsi_bus_type a private variable to the core
2025-12-09 11:40 ` [PATCH v2 06/13] fsi: Make fsi_bus_type a private variable to the core Uwe Kleine-König
@ 2026-01-27 15:26 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:26 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> There are no users of fsi_bus_type outside of fsi-core.c, so make that
> variable static, don't export it and drop the declaration from the
> public header file.
>
> As there is a usage of fsi_bus_type in fsi_create_device() the
> definition of that variable must happen further up in the file to not
> have to add a local declaration.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/fsi-core.c | 67 +++++++++++++++++++++---------------------
> include/linux/fsi.h | 1 -
> 2 files changed, 33 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
> index e1ea1124282e..4e60d4b17c11 100644
> --- a/drivers/fsi/fsi-core.c
> +++ b/drivers/fsi/fsi-core.c
> @@ -100,6 +100,39 @@ static int fsi_master_write(struct fsi_master *master, int link,
> uint8_t slave_id, uint32_t addr, const void *val, size_t size);
> static int fsi_master_break(struct fsi_master *master, int link);
>
> +/* FSI core & Linux bus type definitions */
> +
> +static int fsi_bus_match(struct device *dev, const struct device_driver *drv)
> +{
> + struct fsi_device *fsi_dev = to_fsi_dev(dev);
> + const struct fsi_driver *fsi_drv = to_fsi_drv(drv);
> + const struct fsi_device_id *id;
> +
> + if (!fsi_drv->id_table)
> + return 0;
> +
> + for (id = fsi_drv->id_table; id->engine_type; id++) {
> + if (id->engine_type != fsi_dev->engine_type)
> + continue;
> + if (id->version == FSI_VERSION_ANY ||
> + id->version == fsi_dev->version) {
> + if (drv->of_match_table) {
> + if (of_driver_match_device(dev, drv))
> + return 1;
> + } else {
> + return 1;
> + }
> + }
> + }
> +
> + return 0;
> +}
> +
> +static const struct bus_type fsi_bus_type = {
> + .name = "fsi",
> + .match = fsi_bus_match,
> +};
> +
> /*
> * fsi_device_read() / fsi_device_write() / fsi_device_peek()
> *
> @@ -1359,34 +1392,6 @@ void fsi_master_unregister(struct fsi_master *master)
> }
> EXPORT_SYMBOL_GPL(fsi_master_unregister);
>
> -/* FSI core & Linux bus type definitions */
> -
> -static int fsi_bus_match(struct device *dev, const struct device_driver *drv)
> -{
> - struct fsi_device *fsi_dev = to_fsi_dev(dev);
> - const struct fsi_driver *fsi_drv = to_fsi_drv(drv);
> - const struct fsi_device_id *id;
> -
> - if (!fsi_drv->id_table)
> - return 0;
> -
> - for (id = fsi_drv->id_table; id->engine_type; id++) {
> - if (id->engine_type != fsi_dev->engine_type)
> - continue;
> - if (id->version == FSI_VERSION_ANY ||
> - id->version == fsi_dev->version) {
> - if (drv->of_match_table) {
> - if (of_driver_match_device(dev, drv))
> - return 1;
> - } else {
> - return 1;
> - }
> - }
> - }
> -
> - return 0;
> -}
> -
> int fsi_driver_register(struct fsi_driver *fsi_drv)
> {
> if (!fsi_drv)
> @@ -1406,12 +1411,6 @@ void fsi_driver_unregister(struct fsi_driver *fsi_drv)
> }
> EXPORT_SYMBOL_GPL(fsi_driver_unregister);
>
> -const struct bus_type fsi_bus_type = {
> - .name = "fsi",
> - .match = fsi_bus_match,
> -};
> -EXPORT_SYMBOL_GPL(fsi_bus_type);
> -
> static int __init fsi_init(void)
> {
> int rc;
> diff --git a/include/linux/fsi.h b/include/linux/fsi.h
> index 05be75869a69..3e3a8f3adac3 100644
> --- a/include/linux/fsi.h
> +++ b/include/linux/fsi.h
> @@ -78,7 +78,6 @@ extern int fsi_slave_read(struct fsi_slave *slave, uint32_t addr,
> extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr,
> const void *val, size_t size);
>
> -extern const struct bus_type fsi_bus_type;
> extern const struct device_type fsi_cdev_type;
>
> enum fsi_dev_type {
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 07/13] fsi: Create bus specific probe and remove functions
2025-12-09 11:40 ` [PATCH v2 07/13] fsi: Create bus specific probe and remove functions Uwe Kleine-König
@ 2026-01-27 15:27 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:27 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> Introduce a bus specific probe and remove function. For now this only
> allows to get rid of a cast of the generic device to an fsi device in
> the drivers and changes the remove prototype to return void---a non-zero
> return value is ignored anyhow.
>
> The objective is to get rid of users of struct device callbacks
> .probe(), .remove() and .shutdown() to eventually remove these.
>
> Until all fsi drivers are converted this results in a runtime warning
> about the drivers needing an update because there is a bus probe
> function and a driver probe function.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/fsi-core.c | 50 ++++++++++++++++++++++++++++++++++++++++++
> include/linux/fsi.h | 2 ++
> 2 files changed, 52 insertions(+)
>
> diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
> index 4e60d4b17c11..83599a1c548b 100644
> --- a/drivers/fsi/fsi-core.c
> +++ b/drivers/fsi/fsi-core.c
> @@ -128,9 +128,31 @@ static int fsi_bus_match(struct device *dev, const struct device_driver *drv)
> return 0;
> }
>
> +static int fsi_probe(struct device *dev)
> +{
> + struct fsi_device *fsidev = to_fsi_dev(dev);
> + struct fsi_driver *fsidrv = to_fsi_drv(dev->driver);
> +
> + if (fsidrv->probe)
> + return fsidrv->probe(fsidev);
> + else
> + return 0;
> +}
> +
> +static void fsi_remove(struct device *dev)
> +{
> + struct fsi_device *fsidev = to_fsi_dev(dev);
> + struct fsi_driver *fsidrv = to_fsi_drv(dev->driver);
> +
> + if (fsidrv->remove)
> + fsidrv->remove(fsidev);
> +}
> +
> static const struct bus_type fsi_bus_type = {
> .name = "fsi",
> .match = fsi_bus_match,
> + .probe = fsi_probe,
> + .remove = fsi_remove,
> };
>
> /*
> @@ -1392,6 +1414,25 @@ void fsi_master_unregister(struct fsi_master *master)
> }
> EXPORT_SYMBOL_GPL(fsi_master_unregister);
>
> +static int fsi_legacy_probe(struct fsi_device *fsidev)
> +{
> + struct device *dev = &fsidev->dev;
> + struct device_driver *driver = dev->driver;
> +
> + return driver->probe(dev);
> +}
> +
> +static void fsi_legacy_remove(struct fsi_device *fsidev)
> +{
> + struct device *dev = &fsidev->dev;
> + struct device_driver *driver = dev->driver;
> + int ret;
> +
> + ret = driver->remove(dev);
> + if (unlikely(ret))
> + dev_warn(dev, "Ignoring return value of remove callback (%pe)\n", ERR_PTR(ret));
> +}
> +
> int fsi_driver_register(struct fsi_driver *fsi_drv)
> {
> if (!fsi_drv)
> @@ -1401,6 +1442,15 @@ int fsi_driver_register(struct fsi_driver *fsi_drv)
>
> fsi_drv->drv.bus = &fsi_bus_type;
>
> + /*
> + * This driver needs updating. Note that driver_register() warns about
> + * this, so we're not adding another warning here.
> + */
> + if (!fsi_drv->probe && fsi_drv->drv.probe)
> + fsi_drv->probe = fsi_legacy_probe;
> + if (!fsi_drv->remove && fsi_drv->drv.remove)
> + fsi_drv->remove = fsi_legacy_remove;
> +
> return driver_register(&fsi_drv->drv);
> }
> EXPORT_SYMBOL_GPL(fsi_driver_register);
> diff --git a/include/linux/fsi.h b/include/linux/fsi.h
> index 3e3a8f3adac3..9c67c43f9e6c 100644
> --- a/include/linux/fsi.h
> +++ b/include/linux/fsi.h
> @@ -49,6 +49,8 @@ struct fsi_device_id {
> .engine_type = (t), .version = (v),
>
> struct fsi_driver {
> + int (*probe)(struct fsi_device *fsidev);
> + void (*remove)(struct fsi_device *fsidev);
> struct device_driver drv;
> const struct fsi_device_id *id_table;
> };
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 08/13] fsi: i2cr-scom: Convert to fsi bus probe mechanism
2025-12-09 11:40 ` [PATCH v2 08/13] fsi: i2cr-scom: Convert to fsi bus probe mechanism Uwe Kleine-König
@ 2026-01-27 15:27 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:27 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> The fsi bus got a dedicated probe and remove callback. Make use of them.
> This fixes a runtime warning about the driver needing to be converted to
> the bus methods.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/i2cr-scom.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/fsi/i2cr-scom.c b/drivers/fsi/i2cr-scom.c
> index dfdb16afd205..3efca2e944bb 100644
> --- a/drivers/fsi/i2cr-scom.c
> +++ b/drivers/fsi/i2cr-scom.c
> @@ -81,9 +81,9 @@ static const struct file_operations i2cr_scom_fops = {
> .write = i2cr_scom_write,
> };
>
> -static int i2cr_scom_probe(struct device *dev)
> +static int i2cr_scom_probe(struct fsi_device *fsi_dev)
> {
> - struct fsi_device *fsi_dev = to_fsi_dev(dev);
> + struct device *dev = &fsi_dev->dev;
> struct i2cr_scom *scom;
> int didx;
> int ret;
> @@ -115,14 +115,12 @@ static int i2cr_scom_probe(struct device *dev)
> return ret;
> }
>
> -static int i2cr_scom_remove(struct device *dev)
> +static void i2cr_scom_remove(struct fsi_device *fsi_dev)
> {
> - struct i2cr_scom *scom = dev_get_drvdata(dev);
> + struct i2cr_scom *scom = dev_get_drvdata(&fsi_dev->dev);
>
> cdev_device_del(&scom->cdev, &scom->dev);
> fsi_free_minor(scom->dev.devt);
> -
> - return 0;
> }
>
> static const struct of_device_id i2cr_scom_of_ids[] = {
> @@ -137,12 +135,12 @@ static const struct fsi_device_id i2cr_scom_ids[] = {
> };
>
> static struct fsi_driver i2cr_scom_driver = {
> + .probe = i2cr_scom_probe,
> + .remove = i2cr_scom_remove,
> .id_table = i2cr_scom_ids,
> .drv = {
> .name = "i2cr_scom",
> .of_match_table = i2cr_scom_of_ids,
> - .probe = i2cr_scom_probe,
> - .remove = i2cr_scom_remove,
> }
> };
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 09/13] fsi: master: Convert to fsi bus probe mechanism
2025-12-09 11:40 ` [PATCH v2 09/13] fsi: master: " Uwe Kleine-König
@ 2026-01-27 15:27 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:27 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> The fsi bus got a dedicated probe function. Make use of that. This fixes
> a runtime warning about the driver needing to be converted to the bus
> probe method.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/fsi-master-hub.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
> index d389856d18ac..a84955bb23b1 100644
> --- a/drivers/fsi/fsi-master-hub.c
> +++ b/drivers/fsi/fsi-master-hub.c
> @@ -192,9 +192,9 @@ static int hub_master_init(struct fsi_master_hub *hub)
> return fsi_device_write(dev, FSI_MRESB0, ®, sizeof(reg));
> }
>
> -static int hub_master_probe(struct device *dev)
> +static int hub_master_probe(struct fsi_device *fsi_dev)
> {
> - struct fsi_device *fsi_dev = to_fsi_dev(dev);
> + struct device *dev = &fsi_dev->dev;
> struct fsi_master_hub *hub;
> uint32_t reg, links;
> __be32 __reg;
> @@ -235,7 +235,7 @@ static int hub_master_probe(struct device *dev)
> hub->master.send_break = hub_master_break;
> hub->master.link_enable = hub_master_link_enable;
>
> - dev_set_drvdata(dev, hub);
> + fsi_set_drvdata(fsi_dev, hub);
>
> hub_master_init(hub);
>
> @@ -259,9 +259,9 @@ static int hub_master_probe(struct device *dev)
> return rc;
> }
>
> -static int hub_master_remove(struct device *dev)
> +static void hub_master_remove(struct fsi_device *fsi_dev)
> {
> - struct fsi_master_hub *hub = dev_get_drvdata(dev);
> + struct fsi_master_hub *hub = fsi_get_drvdata(fsi_dev);
>
> fsi_master_unregister(&hub->master);
> fsi_slave_release_range(hub->upstream->slave, hub->addr, hub->size);
> @@ -272,8 +272,6 @@ static int hub_master_remove(struct device *dev)
> * the hub
> */
> put_device(&hub->master.dev);
> -
> - return 0;
> }
>
> static const struct fsi_device_id hub_master_ids[] = {
> @@ -286,10 +284,10 @@ static const struct fsi_device_id hub_master_ids[] = {
>
> static struct fsi_driver hub_master_driver = {
> .id_table = hub_master_ids,
> + .probe = hub_master_probe,
> + .remove = hub_master_remove,
> .drv = {
> .name = "fsi-master-hub",
> - .probe = hub_master_probe,
> - .remove = hub_master_remove,
> }
> };
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 10/13] fsi: sbefifo: Convert to fsi bus probe mechanism
2025-12-09 11:40 ` [PATCH v2 10/13] fsi: sbefifo: " Uwe Kleine-König
@ 2026-01-27 15:28 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:28 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> The fsi bus got a dedicated probe function. Make use of that. This fixes
> a runtime warning about the driver needing to be converted to the bus
> probe method.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/fsi-sbefifo.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c
> index fde1c34743a0..6ca5817910cd 100644
> --- a/drivers/fsi/fsi-sbefifo.c
> +++ b/drivers/fsi/fsi-sbefifo.c
> @@ -1022,9 +1022,9 @@ static void sbefifo_free(struct device *dev)
> * Probe/remove
> */
>
> -static int sbefifo_probe(struct device *dev)
> +static int sbefifo_probe(struct fsi_device *fsi_dev)
> {
> - struct fsi_device *fsi_dev = to_fsi_dev(dev);
> + struct device *dev = &fsi_dev->dev;
> struct sbefifo *sbefifo;
> struct device_node *np;
> struct platform_device *child;
> @@ -1045,7 +1045,7 @@ static int sbefifo_probe(struct device *dev)
>
> sbefifo->magic = SBEFIFO_MAGIC;
> sbefifo->fsi_dev = fsi_dev;
> - dev_set_drvdata(dev, sbefifo);
> + fsi_set_drvdata(fsi_dev, sbefifo);
> mutex_init(&sbefifo->lock);
> sbefifo->timeout_in_cmd_ms = SBEFIFO_TIMEOUT_IN_CMD;
> sbefifo->timeout_start_rsp_ms = SBEFIFO_TIMEOUT_START_RSP;
> @@ -1101,9 +1101,10 @@ static int sbefifo_unregister_child(struct device *dev, void *data)
> return 0;
> }
>
> -static int sbefifo_remove(struct device *dev)
> +static void sbefifo_remove(struct fsi_device *fsi_dev)
> {
> - struct sbefifo *sbefifo = dev_get_drvdata(dev);
> + struct device *dev = &fsi_dev->dev;
> + struct sbefifo *sbefifo = fsi_get_drvdata(fsi_dev);
>
> dev_dbg(dev, "Removing sbefifo device...\n");
>
> @@ -1117,8 +1118,6 @@ static int sbefifo_remove(struct device *dev)
> fsi_free_minor(sbefifo->dev.devt);
> device_for_each_child(dev, NULL, sbefifo_unregister_child);
> put_device(&sbefifo->dev);
> -
> - return 0;
> }
>
> static const struct fsi_device_id sbefifo_ids[] = {
> @@ -1131,10 +1130,10 @@ static const struct fsi_device_id sbefifo_ids[] = {
>
> static struct fsi_driver sbefifo_drv = {
> .id_table = sbefifo_ids,
> + .probe = sbefifo_probe,
> + .remove = sbefifo_remove,
> .drv = {
> .name = DEVICE_NAME,
> - .probe = sbefifo_probe,
> - .remove = sbefifo_remove,
> }
> };
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 11/13] fsi: scom: Convert to fsi bus probe mechanism
2025-12-09 11:40 ` [PATCH v2 11/13] fsi: scom: " Uwe Kleine-König
@ 2026-01-27 15:28 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:28 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Ninad Palsule, linux-fsi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> The fsi bus got a dedicated probe function. Make use of that. This fixes
> a runtime warning about the driver needing to be converted to the bus
> probe method.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
> drivers/fsi/fsi-scom.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
> index 2eda44451cc1..67cd45605fe4 100644
> --- a/drivers/fsi/fsi-scom.c
> +++ b/drivers/fsi/fsi-scom.c
> @@ -527,16 +527,16 @@ static void scom_free(struct device *dev)
> kfree(scom);
> }
>
> -static int scom_probe(struct device *dev)
> +static int scom_probe(struct fsi_device *fsi_dev)
> {
> - struct fsi_device *fsi_dev = to_fsi_dev(dev);
> + struct device *dev = &fsi_dev->dev;
> struct scom_device *scom;
> int rc, didx;
>
> scom = kzalloc(sizeof(*scom), GFP_KERNEL);
> if (!scom)
> return -ENOMEM;
> - dev_set_drvdata(dev, scom);
> + fsi_set_drvdata(fsi_dev, scom);
> mutex_init(&scom->lock);
>
> /* Grab a reference to the device (parent of our cdev), we'll drop it later */
> @@ -574,9 +574,9 @@ static int scom_probe(struct device *dev)
> return rc;
> }
>
> -static int scom_remove(struct device *dev)
> +static void scom_remove(struct fsi_device *fsi_dev)
> {
> - struct scom_device *scom = dev_get_drvdata(dev);
> + struct scom_device *scom = fsi_get_drvdata(fsi_dev);
>
> mutex_lock(&scom->lock);
> scom->dead = true;
> @@ -584,8 +584,6 @@ static int scom_remove(struct device *dev)
> cdev_device_del(&scom->cdev, &scom->dev);
> fsi_free_minor(scom->dev.devt);
> put_device(&scom->dev);
> -
> - return 0;
> }
>
> static const struct of_device_id scom_of_ids[] = {
> @@ -604,11 +602,11 @@ static const struct fsi_device_id scom_ids[] = {
>
> static struct fsi_driver scom_drv = {
> .id_table = scom_ids,
> + .probe = scom_probe,
> + .remove = scom_remove,
> .drv = {
> .name = "scom",
> .of_match_table = scom_of_ids,
> - .probe = scom_probe,
> - .remove = scom_remove,
> }
> };
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 12/13] i2c: fsi: Convert to fsi bus probe mechanism
2025-12-09 11:40 ` [PATCH v2 12/13] i2c: fsi: " Uwe Kleine-König
@ 2026-01-27 15:29 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:29 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Ninad Palsule, linux-fsi, Andi Shyti, linux-i2c, openbmc,
linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> The fsi bus got a dedicated probe function. Make use of that. This fixes
> a runtime warning about the driver needing to be converted to the bus
> probe method.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
> ---
> drivers/i2c/busses/i2c-fsi.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c
> index e98dd5dcac0f..3a7e577e6eac 100644
> --- a/drivers/i2c/busses/i2c-fsi.c
> +++ b/drivers/i2c/busses/i2c-fsi.c
> @@ -674,8 +674,9 @@ static struct device_node *fsi_i2c_find_port_of_node(struct device_node *fsi,
> return NULL;
> }
>
> -static int fsi_i2c_probe(struct device *dev)
> +static int fsi_i2c_probe(struct fsi_device *fsi_dev)
> {
> + struct device *dev = &fsi_dev->dev;
> struct fsi_i2c_ctrl *i2c;
> struct fsi_i2c_port *port;
> struct device_node *np;
> @@ -735,14 +736,14 @@ static int fsi_i2c_probe(struct device *dev)
> list_add(&port->list, &i2c->ports);
> }
>
> - dev_set_drvdata(dev, i2c);
> + fsi_set_drvdata(fsi_dev, i2c);
>
> return 0;
> }
>
> -static int fsi_i2c_remove(struct device *dev)
> +static void fsi_i2c_remove(struct fsi_device *fsi_dev)
> {
> - struct fsi_i2c_ctrl *i2c = dev_get_drvdata(dev);
> + struct fsi_i2c_ctrl *i2c = fsi_get_drvdata(fsi_dev);
> struct fsi_i2c_port *port, *tmp;
>
> list_for_each_entry_safe(port, tmp, &i2c->ports, list) {
> @@ -750,8 +751,6 @@ static int fsi_i2c_remove(struct device *dev)
> i2c_del_adapter(&port->adapter);
> kfree(port);
> }
> -
> - return 0;
> }
>
> static const struct fsi_device_id fsi_i2c_ids[] = {
> @@ -761,10 +760,10 @@ static const struct fsi_device_id fsi_i2c_ids[] = {
>
> static struct fsi_driver fsi_i2c_driver = {
> .id_table = fsi_i2c_ids,
> + .probe = fsi_i2c_probe,
> + .remove = fsi_i2c_remove,
> .drv = {
> .name = "i2c-fsi",
> - .probe = fsi_i2c_probe,
> - .remove = fsi_i2c_remove,
> },
> };
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 13/13] spi: fsi: Convert to fsi bus probe mechanism
2025-12-09 11:40 ` [PATCH v2 13/13] spi: " Uwe Kleine-König
@ 2026-01-27 15:29 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:29 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Ninad Palsule, linux-fsi, Mark Brown, linux-spi, linux-kernel
On 12/9/25 5:40 AM, Uwe Kleine-König wrote:
> The fsi bus got a dedicated probe function. Make use of that. This fixes
> a runtime warning about the driver needing to be converted to the bus
> probe method.
Acked-by: Eddie James <eajames@linux.ibm.com>
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> Acked-by: Mark Brown <broonie@kernel.org>
> ---
> drivers/spi/spi-fsi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
> index f9c15b99dba5..07dc3d24f2c9 100644
> --- a/drivers/spi/spi-fsi.c
> +++ b/drivers/spi/spi-fsi.c
> @@ -528,13 +528,13 @@ static size_t fsi_spi_max_transfer_size(struct spi_device *spi)
> return SPI_FSI_MAX_RX_SIZE;
> }
>
> -static int fsi_spi_probe(struct device *dev)
> +static int fsi_spi_probe(struct fsi_device *fsi)
> {
> int rc;
> struct device_node *np;
> int num_controllers_registered = 0;
> struct fsi2spi *bridge;
> - struct fsi_device *fsi = to_fsi_dev(dev);
> + struct device *dev = &fsi->dev;
>
> rc = fsi_spi_check_mux(fsi, dev);
> if (rc)
> @@ -593,9 +593,9 @@ MODULE_DEVICE_TABLE(fsi, fsi_spi_ids);
>
> static struct fsi_driver fsi_spi_driver = {
> .id_table = fsi_spi_ids,
> + .probe = fsi_spi_probe,
> .drv = {
> .name = "spi-fsi",
> - .probe = fsi_spi_probe,
> },
> };
> module_fsi_driver(fsi_spi_driver);
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 00/13] fsi: Convert to bus probe mechanism
2026-01-12 9:47 ` [PATCH v2 00/13] fsi: Convert to " Uwe Kleine-König
@ 2026-01-27 15:31 ` Eddie James
0 siblings, 0 replies; 29+ messages in thread
From: Eddie James @ 2026-01-27 15:31 UTC (permalink / raw)
To: Greg Kroah-Hartman, Uwe Kleine-König
Cc: Ninad Palsule, linux-fsi, linux-kernel, Andi Shyti, linux-i2c,
openbmc, Mark Brown, linux-spi
On 1/12/26 3:47 AM, Uwe Kleine-König wrote:
> Hello Eddie,
>
> On Tue, Dec 09, 2025 at 12:39:28PM +0100, Uwe Kleine-König wrote:
>> Hello,
>>
>> this is the 2nd installment of the series converting the fsi bus to use
>> bus methods for .probe and .remove. The changes since the first
>> iteration---that can be found at
>> https://lore.kernel.org/lkml/cover.1764434226.git.ukleinek@kernel.org/
>> --- are:
>>
>> - (trivially) rebase to v6.18
>> - add tags by Andi (for the i2c parts) and Mark Brown (for the spi
>> parts)
>> - Add a patch converting drivers/fsi/i2cr-scom.c (#8)
>>
>> In the earlier thread I thought I made a mistake for (implicit) v1, but
>> I confused fsi with fsl and the problem doesn't apply here as it doesn't
>> touch the shutdown callback.
>>
>> This series is not urgent, but it would be great to get this into
>> v6.19-rc1. With Mark's Acks and Andi's tags (though they are not an
>> Ack) this should be fine to be picked up in one go by Eddie.
>>
>> As before there are two commit refs that should refer to the commit for
>> patch #2 ("fsi: Assign driver's bus in fsi_driver_register()"). As I
>> cannot know the commit hash yet, I wrote "FIXME" and these need updating
>> when the series is picked up.
> gentle ping. While my quest to drop .probe() and .remove() is still in
> early stages, I'd like to see this series go in before it bitrots. It
> should have all the acks necessary to merge it.
So sorry for the delay. Thank you very much for the series! Greg, please
merge at your earliest convenience.
Thanks!
Eddie
>
> Alternatively, should I ask Greg (added to Cc:) to merge?
>
> Best regards
> Uwe
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2026-01-27 15:31 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 11:39 [PATCH v2 00/13] fsi: Convert to bus probe mechanism Uwe Kleine-König
2025-12-09 11:40 ` [PATCH v2 01/13] fsi: Make use of module_fsi_driver() Uwe Kleine-König
2026-01-27 15:25 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 02/13] fsi: Assign driver's bus in fsi_driver_register() Uwe Kleine-König
2026-01-27 15:25 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 03/13] fsi: Provide thin wrappers around dev_[gs]et_data() for fsi devices Uwe Kleine-König
2026-01-27 15:25 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 04/13] i2c: fsi: Drop assigning fsi bus Uwe Kleine-König
2026-01-27 15:26 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 05/13] spi: " Uwe Kleine-König
2026-01-27 15:26 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 06/13] fsi: Make fsi_bus_type a private variable to the core Uwe Kleine-König
2026-01-27 15:26 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 07/13] fsi: Create bus specific probe and remove functions Uwe Kleine-König
2026-01-27 15:27 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 08/13] fsi: i2cr-scom: Convert to fsi bus probe mechanism Uwe Kleine-König
2026-01-27 15:27 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 09/13] fsi: master: " Uwe Kleine-König
2026-01-27 15:27 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 10/13] fsi: sbefifo: " Uwe Kleine-König
2026-01-27 15:28 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 11/13] fsi: scom: " Uwe Kleine-König
2026-01-27 15:28 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 12/13] i2c: fsi: " Uwe Kleine-König
2026-01-27 15:29 ` Eddie James
2025-12-09 11:40 ` [PATCH v2 13/13] spi: " Uwe Kleine-König
2026-01-27 15:29 ` Eddie James
2026-01-12 9:47 ` [PATCH v2 00/13] fsi: Convert to " Uwe Kleine-König
2026-01-27 15:31 ` Eddie James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox