[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230306161057.44017-3-eajames@linux.ibm.com>
Date: Mon, 6 Mar 2023 10:10:50 -0600
From: Eddie James <eajames@...ux.ibm.com>
To: linux-fsi@...ts.ozlabs.org
Cc: rostedt@...dmis.org, linux-trace-kernel@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
mhiramat@...nel.org, alistair@...ple.id.au, joel@....id.au,
jk@...abs.org, andrew@...id.au, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, eajames@...ux.ibm.com
Subject: [PATCH v8 2/8] fsi: Make master device indexing and naming optional
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@...ux.ibm.com>
---
drivers/fsi/fsi-core.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index d591e68afd11..3271e40702ec 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -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);
--
2.31.1
Powered by blists - more mailing lists