@@ -1297,11 +1297,16 @@ int fsi_master_register(struct fsi_master *master)
struct device_node *np;
mutex_init(&master->scan_lock);
- master->idx = ida_simple_get(&master_ida, 0, INT_MAX, GFP_KERNEL);
- if (master->idx < 0)
- return master->idx;
- dev_set_name(&master->dev, "fsi%d", master->idx);
+ if (!master->idx) {
+ master->idx = ida_simple_get(&master_ida, 0, INT_MAX,
+ GFP_KERNEL);
+ if (master->idx < 0)
+ return master->idx;
+
+ dev_set_name(&master->dev, "fsi%d", master->idx);
+ }
+
master->dev.class = &fsi_master_class;
rc = device_register(&master->dev);
Some FSI masters need different device naming, so make the indexing and naming an optional part of FSI master registration. Signed-off-by: Eddie James <eajames@linux.ibm.com> --- drivers/fsi/fsi-core.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)