From: Joel Stanley <joel@jms.id.au>
To: Rob Herring <robh+dt@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>, Jeremy Kerr <jk@ozlabs.org>
Cc: Alistar Popple <alistair@popple.id.au>,
Eddie James <eajames@linux.ibm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-fsi@lists.ozlabs.org
Subject: [PATCH v2 02/11] fsi: Move master attributes to fsi-master class
Date: Fri, 8 Nov 2019 15:49:36 +1030 [thread overview]
Message-ID: <20191108051945.7109-3-joel@jms.id.au> (raw)
In-Reply-To: <20191108051945.7109-1-joel@jms.id.au>
From: Jeremy Kerr <jk@ozlabs.org>
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>
---
drivers/fsi/fsi-core.c | 23 +++++++++--------------
1 file 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);
--
2.24.0.rc1
next prev parent reply other threads:[~2019-11-08 5:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 5:19 [PATCH v2 00/11] fsi: Patches for 5.5 Joel Stanley
2019-11-08 5:19 ` [PATCH v2 01/11] fsi: Add fsi-master class Joel Stanley
2019-11-08 9:17 ` Alistair Popple
2019-11-08 5:19 ` Joel Stanley [this message]
2019-11-08 9:18 ` [PATCH v2 02/11] fsi: Move master attributes to " Alistair Popple
2019-11-08 5:19 ` [PATCH v2 03/11] ABI: Update FSI path documentation Joel Stanley
2019-11-08 9:27 ` Alistair Popple
2019-11-08 5:19 ` [PATCH v2 04/11] trace: fsi: Print transfer size unsigned Joel Stanley
2019-11-08 9:21 ` Alistair Popple
2019-11-08 5:19 ` [PATCH v2 05/11] fsi: core: Fix small accesses and unaligned offsets via sysfs Joel Stanley
2019-11-08 5:19 ` [PATCH v2 06/11] fsi: fsi_master_class can be static Joel Stanley
2019-11-08 5:19 ` [PATCH v2 07/11] fsi: Move defines to common header Joel Stanley
2019-11-08 5:19 ` [PATCH v2 08/11] dt-bindings: fsi: Add description of FSI master Joel Stanley
2019-11-08 9:23 ` Alistair Popple
2019-11-08 10:28 ` Greg KH
2019-11-08 5:19 ` [PATCH v2 09/11] fsi: Add ast2600 master driver Joel Stanley
2019-11-08 9:29 ` Alistair Popple
2019-11-08 5:19 ` [PATCH v2 10/11] fsi: aspeed: Add trace points Joel Stanley
2019-11-08 5:19 ` [PATCH v2 11/11] fsi: aspeed: Fix OPB0 byte order register values Joel Stanley
2019-11-08 9:31 ` Alistair Popple
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=20191108051945.7109-3-joel@jms.id.au \
--to=joel@jms.id.au \
--cc=alistair@popple.id.au \
--cc=devicetree@vger.kernel.org \
--cc=eajames@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jk@ozlabs.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsi@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=robh+dt@kernel.org \
--cc=rostedt@goodmis.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®