Skip to content

Commit

Permalink
fsi: Move master attributes to fsi-master class
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeremy Kerr authored and Greg Kroah-Hartman committed Nov 8, 2019
1 parent 2e32c2d commit cf700ba
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions drivers/fsi/fsi-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit cf700ba

Please sign in to comment.