From: Alistair Popple <alistair@popple.id.au>
To: Joel Stanley <joel@jms.id.au>
Cc: Rob Herring <robh+dt@kernel.org>,
Greg KH <gregkh@linuxfoundation.org>, Jeremy Kerr <jk@ozlabs.org>,
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: Re: [PATCH v2 01/11] fsi: Add fsi-master class
Date: Fri, 08 Nov 2019 20:17:49 +1100 [thread overview]
Message-ID: <2193954.caYg6ACHYT@townsend> (raw)
In-Reply-To: <20191108051945.7109-2-joel@jms.id.au>
Support for the new paths has been added to our user space tools as well so it
shouldn't change anything there.
Acked-by: Alistair Popple <alistair@popple.id.au>
On Friday, 8 November 2019 4:19:35 PM AEDT Joel Stanley wrote:
> From: Jeremy Kerr <jk@ozlabs.org>
>
> This change adds a device class for FSI masters, allowing access under
> /sys/class/fsi-master/, and easier udev rules.
>
> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> drivers/fsi/fsi-core.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
> index 1f76740f33b6..0861f6097b33 100644
> --- a/drivers/fsi/fsi-core.c
> +++ b/drivers/fsi/fsi-core.c
> @@ -1241,6 +1241,10 @@ static ssize_t master_break_store(struct device *dev,
>
> static DEVICE_ATTR(break, 0200, NULL, master_break_store);
>
> +struct class fsi_master_class = {
> + .name = "fsi-master",
> +};
> +
> int fsi_master_register(struct fsi_master *master)
> {
> int rc;
> @@ -1249,6 +1253,7 @@ int fsi_master_register(struct fsi_master *master)
> mutex_init(&master->scan_lock);
> master->idx = ida_simple_get(&master_ida, 0, INT_MAX, GFP_KERNEL);
> dev_set_name(&master->dev, "fsi%d", master->idx);
> + master->dev.class = &fsi_master_class;
>
> rc = device_register(&master->dev);
> if (rc) {
> @@ -1350,8 +1355,15 @@ static int __init fsi_init(void)
> rc = bus_register(&fsi_bus_type);
> if (rc)
> goto fail_bus;
> +
> + rc = class_register(&fsi_master_class);
> + if (rc)
> + goto fail_class;
> +
> return 0;
>
> + fail_class:
> + bus_unregister(&fsi_bus_type);
> fail_bus:
> unregister_chrdev_region(fsi_base_dev, FSI_CHAR_MAX_DEVICES);
> return rc;
> @@ -1360,6 +1372,7 @@ postcore_initcall(fsi_init);
>
> static void fsi_exit(void)
> {
> + class_unregister(&fsi_master_class);
> bus_unregister(&fsi_bus_type);
> unregister_chrdev_region(fsi_base_dev, FSI_CHAR_MAX_DEVICES);
> ida_destroy(&fsi_minor_ida);
>
next prev parent reply other threads:[~2019-11-08 9:36 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 [this message]
2019-11-08 5:19 ` [PATCH v2 02/11] fsi: Move master attributes to " Joel Stanley
2019-11-08 9:18 ` 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=2193954.caYg6ACHYT@townsend \
--to=alistair@popple.id.au \
--cc=devicetree@vger.kernel.org \
--cc=eajames@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=jk@ozlabs.org \
--cc=joel@jms.id.au \
--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;
as well as URLs for NNTP newsgroup(s).