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: Use of_match_table for bus matching if specified

Since we have two scom drivers, use the standard of matching if
the driver specifies a table so that the right devices go to the
right driver.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20230612195657.245125-4-eajames@linux.ibm.com
Signed-off-by: Joel Stanley <joel@jms.id.au>

authored by

Eddie James and committed by
Joel Stanley
c21d322e 21930d80

+17 -2
+9 -2
drivers/fsi/fsi-core.c
··· 17 17 #include <linux/module.h> 18 18 #include <linux/of.h> 19 19 #include <linux/of_address.h> 20 + #include <linux/of_device.h> 20 21 #include <linux/slab.h> 21 22 #include <linux/bitops.h> 22 23 #include <linux/cdev.h> ··· 1355 1354 if (id->engine_type != fsi_dev->engine_type) 1356 1355 continue; 1357 1356 if (id->version == FSI_VERSION_ANY || 1358 - id->version == fsi_dev->version) 1359 - return 1; 1357 + id->version == fsi_dev->version) { 1358 + if (drv->of_match_table) { 1359 + if (of_driver_match_device(dev, drv)) 1360 + return 1; 1361 + } else { 1362 + return 1; 1363 + } 1364 + } 1360 1365 } 1361 1366 1362 1367 return 0;
+8
drivers/fsi/fsi-scom.c
··· 10 10 #include <linux/cdev.h> 11 11 #include <linux/delay.h> 12 12 #include <linux/fs.h> 13 + #include <linux/mod_devicetable.h> 13 14 #include <linux/uaccess.h> 14 15 #include <linux/slab.h> 15 16 #include <linux/list.h> ··· 588 587 return 0; 589 588 } 590 589 590 + static const struct of_device_id scom_of_ids[] = { 591 + { .compatible = "ibm,fsi2pib" }, 592 + { } 593 + }; 594 + MODULE_DEVICE_TABLE(of, scom_of_ids); 595 + 591 596 static const struct fsi_device_id scom_ids[] = { 592 597 { 593 598 .engine_type = FSI_ENGID_SCOM, ··· 607 600 .drv = { 608 601 .name = "scom", 609 602 .bus = &fsi_bus_type, 603 + .of_match_table = scom_of_ids, 610 604 .probe = scom_probe, 611 605 .remove = scom_remove, 612 606 }