]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fsi: Make fsi_bus_type a private variable to the core
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Tue, 9 Dec 2025 11:40:30 +0000 (12:40 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Jan 2026 15:35:35 +0000 (16:35 +0100)
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>
Acked-by: Eddie James <eajames@linux.ibm.com>
Link: https://patch.msgid.link/bfd83034dec04d5a6b01a234988377fc6224614d.1765279318.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fsi/fsi-core.c
include/linux/fsi.h

index e1ea1124282e4862afb067b131c686b3dc7b068e..4e60d4b17c11643046c2ba792b13dba22825ea27 100644 (file)
@@ -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;
index 05be75869a69f9ab9b67a722aa5f88a788bc9fc5..3e3a8f3adac38f1ee09710f89acd0b138d271f01 100644 (file)
@@ -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 {