Commit 15362d69 authored by Jeremy Kerr's avatar Jeremy Kerr Committed by Greg Kroah-Hartman

fsi: Add fsi_master_rescan()

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: default avatarJeremy Kerr <jk@ozlabs.org>
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Reviewed-by: default avatarChristopher Bostic <clbostic@linux.vnet.ibm.com>
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 57adbeea
...@@ -762,14 +762,20 @@ static void fsi_master_unscan(struct fsi_master *master) ...@@ -762,14 +762,20 @@ static void fsi_master_unscan(struct fsi_master *master)
device_for_each_child(&master->dev, NULL, fsi_master_remove_slave); 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, static ssize_t master_rescan_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct fsi_master *master = to_fsi_master(dev); struct fsi_master *master = to_fsi_master(dev);
int rc; int rc;
fsi_master_unscan(master); rc = fsi_master_rescan(master);
rc = fsi_master_scan(master);
if (rc < 0) if (rc < 0)
return rc; return rc;
......
...@@ -40,4 +40,6 @@ struct fsi_master { ...@@ -40,4 +40,6 @@ struct fsi_master {
extern int fsi_master_register(struct fsi_master *master); extern int fsi_master_register(struct fsi_master *master);
extern void fsi_master_unregister(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 */ #endif /* DRIVERS_FSI_MASTER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment