Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fsi: Make fsi_bus_type a private variable to the core

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>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
68cc6588 605fdbae

+33 -35
+33 -34
drivers/fsi/fsi-core.c
··· 100 100 uint8_t slave_id, uint32_t addr, const void *val, size_t size); 101 101 static int fsi_master_break(struct fsi_master *master, int link); 102 102 103 + /* FSI core & Linux bus type definitions */ 104 + 105 + static int fsi_bus_match(struct device *dev, const struct device_driver *drv) 106 + { 107 + struct fsi_device *fsi_dev = to_fsi_dev(dev); 108 + const struct fsi_driver *fsi_drv = to_fsi_drv(drv); 109 + const struct fsi_device_id *id; 110 + 111 + if (!fsi_drv->id_table) 112 + return 0; 113 + 114 + for (id = fsi_drv->id_table; id->engine_type; id++) { 115 + if (id->engine_type != fsi_dev->engine_type) 116 + continue; 117 + if (id->version == FSI_VERSION_ANY || 118 + id->version == fsi_dev->version) { 119 + if (drv->of_match_table) { 120 + if (of_driver_match_device(dev, drv)) 121 + return 1; 122 + } else { 123 + return 1; 124 + } 125 + } 126 + } 127 + 128 + return 0; 129 + } 130 + 131 + static const struct bus_type fsi_bus_type = { 132 + .name = "fsi", 133 + .match = fsi_bus_match, 134 + }; 135 + 103 136 /* 104 137 * fsi_device_read() / fsi_device_write() / fsi_device_peek() 105 138 * ··· 1392 1359 } 1393 1360 EXPORT_SYMBOL_GPL(fsi_master_unregister); 1394 1361 1395 - /* FSI core & Linux bus type definitions */ 1396 - 1397 - static int fsi_bus_match(struct device *dev, const struct device_driver *drv) 1398 - { 1399 - struct fsi_device *fsi_dev = to_fsi_dev(dev); 1400 - const struct fsi_driver *fsi_drv = to_fsi_drv(drv); 1401 - const struct fsi_device_id *id; 1402 - 1403 - if (!fsi_drv->id_table) 1404 - return 0; 1405 - 1406 - for (id = fsi_drv->id_table; id->engine_type; id++) { 1407 - if (id->engine_type != fsi_dev->engine_type) 1408 - continue; 1409 - if (id->version == FSI_VERSION_ANY || 1410 - id->version == fsi_dev->version) { 1411 - if (drv->of_match_table) { 1412 - if (of_driver_match_device(dev, drv)) 1413 - return 1; 1414 - } else { 1415 - return 1; 1416 - } 1417 - } 1418 - } 1419 - 1420 - return 0; 1421 - } 1422 - 1423 1362 int fsi_driver_register(struct fsi_driver *fsi_drv) 1424 1363 { 1425 1364 if (!fsi_drv) ··· 1410 1405 driver_unregister(&fsi_drv->drv); 1411 1406 } 1412 1407 EXPORT_SYMBOL_GPL(fsi_driver_unregister); 1413 - 1414 - const struct bus_type fsi_bus_type = { 1415 - .name = "fsi", 1416 - .match = fsi_bus_match, 1417 - }; 1418 - EXPORT_SYMBOL_GPL(fsi_bus_type); 1419 1408 1420 1409 static int __init fsi_init(void) 1421 1410 {
-1
include/linux/fsi.h
··· 78 78 extern int fsi_slave_write(struct fsi_slave *slave, uint32_t addr, 79 79 const void *val, size_t size); 80 80 81 - extern const struct bus_type fsi_bus_type; 82 81 extern const struct device_type fsi_cdev_type; 83 82 84 83 enum fsi_dev_type {