From: skannan@codeaurora.org (Saravana Kannan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] mach-ux500: export System-on-Chip information via sysfs
Date: Tue, 12 Jul 2011 09:29:04 -0700 [thread overview]
Message-ID: <4E1C7650.6010700@codeaurora.org> (raw)
In-Reply-To: <1310476090-9807-2-git-send-email-lee.jones@linaro.org>
On 07/12/2011 06:08 AM, Lee Jones wrote:
> Signed-off-by: Lee Jones<lee.jones@linaro.org>
> ---
> arch/arm/mach-ux500/Kconfig | 1 +
> arch/arm/mach-ux500/id.c | 115 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 116 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
> index 4210cb4..4d2f2c2 100644
<snip>
> +
> +struct soc_callback_functions soc_callbacks = {
> + .get_machine_fn = ux500_get_machine,
> + .get_family_fn = ux500_get_family,
> + .get_soc_id_fn = ux500_get_soc_id,
> + .get_revision_fn = ux500_get_revision,
> +};
> +
> +struct device_attribute ux500_soc_attrs[] = {
> + __ATTR(process, S_IRUGO, ux500_get_process, NULL),
> + __ATTR_NULL,
> +};
> +
> +static int __init ux500_soc_sysfs_init(void)
> +{
> + int ret;
> + int i = 0;
> + ret = soc_device_register(&soc_parent,
> + &soc_callbacks);
> + if (ret>= 0) {
> + while (ux500_soc_attrs[i].attr.name != NULL) {
> + ret = device_create_file(&soc_parent,
> + &ux500_soc_attrs[i++]);
> + if (ret)
> + goto out;
> + }
> + }
Can you please make this code as part of soc_device_register? Otherwise,
every SoC that wants to add its own set of attributes will have to
repeat this code.
> + out:
> + return ret;
> +}
> +module_init(ux500_soc_sysfs_init);
> +
> +static void __exit ux500_soc_sysfs_exit(void)
> +{
> + int i = 0;
> +
> + while (ux500_soc_attrs[i].attr.name != NULL)
> + device_remove_file(&soc_parent,&ux500_soc_attrs[i++]);
That would also pull this in and make sure the ordering is always correct.
> +
> + soc_device_unregister(&soc_parent);
> +}
> +module_exit(ux500_soc_sysfs_exit);
> +
> +#endif
Thanks,
Saravana
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2011-07-12 16:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 13:08 [PATCH 1/3] Framework for exporting System-on-Chip information via sysfs Lee Jones
2011-07-12 13:08 ` [PATCH 2/3] mach-ux500: export " Lee Jones
2011-07-12 16:29 ` Saravana Kannan [this message]
2011-07-13 7:55 ` Lee Jones
2011-07-13 16:40 ` Saravana Kannan
2011-07-13 20:32 ` Greg KH
2011-07-13 20:51 ` Arnd Bergmann
2011-07-14 6:42 ` Lee Jones
2011-07-14 12:58 ` Arnd Bergmann
2011-07-14 13:04 ` Lee Jones
2011-07-14 17:25 ` Saravana Kannan
2011-07-15 6:27 ` Lee Jones
2011-07-12 16:47 ` Arnd Bergmann
2011-07-13 8:10 ` Lee Jones
2011-07-13 13:42 ` Arnd Bergmann
2011-07-13 14:31 ` Lee Jones
2011-07-13 16:20 ` Arnd Bergmann
2011-07-12 13:08 ` [PATCH 3/3] Add documenation for new sysfs devices/soc functionallity Lee Jones
2011-07-12 14:13 ` [PATCH 1/3] Framework for exporting System-on-Chip information via sysfs Baruch Siach
2011-07-12 16:08 ` Greg KH
2011-07-13 7:16 ` Lee Jones
2011-07-13 7:53 ` Greg KH
2011-07-13 8:27 ` Lee Jones
2011-07-15 14:02 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2011-04-14 14:49 [PATCH 0/3] Export valuable System-on-Chip information to user-space " Lee Jones
2011-04-14 14:49 ` [PATCH 2/3] mach-ux500: export System-on-Chip information " Lee Jones
2011-04-17 18:40 ` Arnd Bergmann
2011-04-11 18:01 Lee Jones
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=4E1C7650.6010700@codeaurora.org \
--to=skannan@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.