[PATCH linux dev-4.7] drivers: fsi: Fix incremeting dev nums

Eddie James eajames at linux.vnet.ibm.com
Fri Feb 17 06:20:56 AEDT 2017


From: "Edward A. James" <eajames at us.ibm.com>

both for FSI master and scom client

Signed-off-by: Edward A. James <eajames at us.ibm.com>
---
 drivers/fsi/fsi-core.c | 4 +++-
 drivers/fsi/fsi-scom.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index e8a3618..7816482 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -46,7 +46,7 @@ static const int engine_page_size = 0x400;
 static struct task_struct *master_ipoll;
 static unsigned int fsi_ipoll_period_ms = 100;
 
-static atomic_t master_idx = ATOMIC_INIT(-1);
+static atomic_t master_idx = ATOMIC_INIT(0);
 
 struct fsi_slave {
 	struct list_head	list_link;	/* Master's list of slaves */
@@ -617,6 +617,8 @@ void fsi_master_unregister(struct fsi_master *master)
 		kthread_stop(master_ipoll);
 		master_ipoll = NULL;
 	}
+
+	atomic_dec(&master_idx);
 }
 EXPORT_SYMBOL_GPL(fsi_master_unregister);
 
diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c
index a439a5e..62d3482 100644
--- a/drivers/fsi/fsi-scom.c
+++ b/drivers/fsi/fsi-scom.c
@@ -211,6 +211,8 @@ static int scom_remove(struct device *dev)
 		}
 	}
 
+	atomic_dec(&scom_idx);
+
 	return 0;
 }
 
-- 
1.8.3.1



More information about the openbmc mailing list