From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Olaf Hering <olaf@aepfle.de>
Cc: sparclinux@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH v3] create modalias file in sysfs for bus of_platform
Date: Wed, 23 Jan 2008 10:03:41 +1100 [thread overview]
Message-ID: <20080123100341.1494e9e7.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20080122190939.GA14124@aepfle.de>
[-- Attachment #1: Type: text/plain, Size: 2201 bytes --]
[Adding sparclinux cc]
I withdraw the comment about drivers/macintosh/macio_sysfs.c, I didn't
realise that it was a whole other bus.
On Tue, 22 Jan 2008 20:09:39 +0100 Olaf Hering <olaf@aepfle.de> wrote:
>
> Create /sys/bus/of_platform/devices/*/modalias file to allow autoloading
> of modules. modalias files are already present for many other bus types.
>
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
>
> ---
> drivers/of/device.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> --- a/drivers/of/device.c
> +++ b/drivers/of/device.c
> @@ -86,7 +86,20 @@ static ssize_t dev_show_devspec(struct d
> return sprintf(buf, "%s", ofdev->node->full_name);
> }
>
> +static ssize_t dev_show_modalias(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct of_device *ofdev = to_of_device(dev);
> + ssize_t len = 0;
> +
> + len = of_device_get_modalias(ofdev, buf, PAGE_SIZE - 2);
> + buf[len] = '\n';
> + buf[len+1] = 0;
> + return len+1;
> +}
> +
> static DEVICE_ATTR(devspec, S_IRUGO, dev_show_devspec, NULL);
> +static DEVICE_ATTR(modalias, S_IRUGO, dev_show_modalias, NULL);
>
> /**
> * of_release_dev - free an of device structure when all users of it are finished.
> @@ -116,6 +129,11 @@ int of_device_register(struct of_device
> return rc;
>
> rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
> + if (rc) {
> + device_unregister(&ofdev->dev);
> + return rc;
> + }
> + rc = device_create_file(&ofdev->dev, &dev_attr_modalias);
> if (rc)
> device_unregister(&ofdev->dev);
>
> @@ -126,6 +144,7 @@ EXPORT_SYMBOL(of_device_register);
> void of_device_unregister(struct of_device *ofdev)
> {
> device_remove_file(&ofdev->dev, &dev_attr_devspec);
> + device_remove_file(&ofdev->dev, &dev_attr_modalias);
> device_unregister(&ofdev->dev);
> }
> EXPORT_SYMBOL(of_device_unregister);
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-01-22 23:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-22 14:21 [PATCH] create modalias file in sysfs for bus of_platform Olaf Hering
2008-01-22 14:40 ` [PATCH v2] " Olaf Hering
2008-01-22 14:58 ` Stephen Rothwell
2008-01-22 19:09 ` [PATCH v3] " Olaf Hering
2008-01-22 23:03 ` Stephen Rothwell [this message]
2008-01-26 0:23 ` Paul Mackerras
2008-01-26 10:04 ` [PATCH v4] " Olaf Hering
2008-04-24 13:16 ` [PATCH v5] " Olaf Hering
2008-05-08 21:31 ` Olaf Hering
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=20080123100341.1494e9e7.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=olaf@aepfle.de \
--cc=sparclinux@vger.kernel.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).