mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@ozlabs.org>
To: linux-kernel@vger.kernel.org
Cc: Joel Stanley <joel@jms.id.au>,
	Christopher Bostic <cbostic@linux.vnet.ibm.com>,
	Jeremy Kerr <jk@ozlabs.org>
Subject: [PATCH v2 1/3] fsi: Add fsi_master_rescan()
Date: Tue, 20 Jun 2017 10:59:09 +0800	[thread overview]
Message-ID: <1497927549-7140-1-git-send-email-jk@ozlabs.org> (raw)
In-Reply-To: <1497864405-26990-2-git-send-email-jk@ozlabs.org>

We'll want non-core fsi code to trigger a rescan, so introduce a
non-static fsi_master_rescan() function. Use this for the existing
unscan/scan behaviour too.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Christopher Bostic <clbostic@linux.vnet.ibm.com>

---
v2:
  - Add EXPORT_SYMBOL_GPL(fsi_master_rescan) for =m builds. Thanks
    kbuild test robot, I'll shout you your choice of coolant.
---
 drivers/fsi/fsi-core.c   | 10 ++++++++--
 drivers/fsi/fsi-master.h |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index a485864..c3d59d9 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -762,14 +762,20 @@ static void fsi_master_unscan(struct fsi_master *master)
 	device_for_each_child(&master->dev, NULL, fsi_master_remove_slave);
 }
 
+int fsi_master_rescan(struct fsi_master *master)
+{
+	fsi_master_unscan(master);
+	return fsi_master_scan(master);
+}
+EXPORT_SYMBOL_GPL(fsi_master_rescan);
+
 static ssize_t master_rescan_store(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t count)
 {
 	struct fsi_master *master = to_fsi_master(dev);
 	int rc;
 
-	fsi_master_unscan(master);
-	rc = fsi_master_scan(master);
+	rc = fsi_master_rescan(master);
 	if (rc < 0)
 		return rc;
 
diff --git a/drivers/fsi/fsi-master.h b/drivers/fsi/fsi-master.h
index 12f7b11..18bd4ad 100644
--- a/drivers/fsi/fsi-master.h
+++ b/drivers/fsi/fsi-master.h
@@ -40,4 +40,6 @@ struct fsi_master {
 extern int fsi_master_register(struct fsi_master *master);
 extern void fsi_master_unregister(struct fsi_master *master);
 
+extern int fsi_master_rescan(struct fsi_master *master);
+
 #endif /* DRIVERS_FSI_MASTER_H */
-- 
2.7.4

  reply	other threads:[~2017-06-20  3:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19  9:26 [PATCH 0/3] Add 'external mode' for GPIO-based FSI master Jeremy Kerr
2017-06-19  9:26 ` [PATCH 1/3] fsi: Add fsi_master_rescan() Jeremy Kerr
2017-06-20  2:59   ` Jeremy Kerr [this message]
2017-06-19  9:26 ` [PATCH 2/3] fsi/master-gpio: Add locking around gpio operations during break & link enable Jeremy Kerr
2017-06-19  9:26 ` [PATCH 3/3] fsi/master-gpio: Add external mode Jeremy Kerr
2017-06-19 17:17   ` kbuild test robot
2017-06-21  6:01   ` Joel Stanley
2017-06-21 22:07     ` Jeremy Kerr
2017-06-21 22:10   ` [PATCH v2 " Jeremy Kerr
2018-01-30  4:45     ` Joel Stanley
2017-09-04  6:55 ` [PATCH 0/3] Add 'external mode' for GPIO-based FSI master Joel Stanley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497927549-7140-1-git-send-email-jk@ozlabs.org \
    --to=jk@ozlabs.org \
    --cc=cbostic@linux.vnet.ibm.com \
    --cc=joel@jms.id.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®