summaryrefslogtreecommitdiffstats
path: root/drivers/fsi
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2019-11-08 15:49:36 +1030
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-08 11:23:16 +0100
commitcf700ba035dce78f17f6ce9405a485e490656666 (patch)
tree6d451b8d8bf1f7c419ddc53521faf0c6d64320e3 /drivers/fsi
parent2e32c2d675ac19730ec656322414649f04eddaa8 (diff)
downloadlinux-stable-cf700ba035dce78f17f6ce9405a485e490656666.tar.gz
linux-stable-cf700ba035dce78f17f6ce9405a485e490656666.tar.bz2
linux-stable-cf700ba035dce78f17f6ce9405a485e490656666.zip
fsi: Move master attributes to fsi-master class
Populate fsi_master_class->dev_attrs with the existing attribute definitions, so we don't need to explicitly register. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au> Acked-by: Alistair Popple <alistair@popple.id.au> Link: https://lore.kernel.org/r/20191108051945.7109-3-joel@jms.id.au Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fsi')
-rw-r--r--drivers/fsi/fsi-core.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 0861f6097b33..c773c65a5058 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -1241,8 +1241,17 @@ static ssize_t master_break_store(struct device *dev,
static DEVICE_ATTR(break, 0200, NULL, master_break_store);
+static struct attribute *master_attrs[] = {
+ &dev_attr_break.attr,
+ &dev_attr_rescan.attr,
+ NULL
+};
+
+ATTRIBUTE_GROUPS(master);
+
struct class fsi_master_class = {
.name = "fsi-master",
+ .dev_groups = master_groups,
};
int fsi_master_register(struct fsi_master *master)
@@ -1261,20 +1270,6 @@ int fsi_master_register(struct fsi_master *master)
return rc;
}
- rc = device_create_file(&master->dev, &dev_attr_rescan);
- if (rc) {
- device_del(&master->dev);
- ida_simple_remove(&master_ida, master->idx);
- return rc;
- }
-
- rc = device_create_file(&master->dev, &dev_attr_break);
- if (rc) {
- device_del(&master->dev);
- ida_simple_remove(&master_ida, master->idx);
- return rc;
- }
-
np = dev_of_node(&master->dev);
if (!of_property_read_bool(np, "no-scan-on-init")) {
mutex_lock(&master->scan_lock);