From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] Framework for exporting System-on-Chip information via sysfs
Date: Wed, 24 Aug 2011 15:08:42 +0100 [thread overview]
Message-ID: <4E5505EA.6050207@linaro.org> (raw)
In-Reply-To: <20110810132956.GG2680@pulham.picochip.com>
Hi Jamie,
Thanks for reviewing this for me.
Most of your comments I've adhered to, but I do have a question inline.
>> + return ret;
>> +}
>> +
>> +int __init soc_device_register(struct device *soc_parent,
>> + struct soc_device *soc_dev)
>> +{
>> + int ret;
>> +
>> + spin_lock_irq(®ister_lock);
>> +
>> + if (!soc_count) {
>> + /* Register top-level SoC device '/sys/devices/soc' */
>> + ret = device_register(&soc_grandparent);
>> + if (ret)
>> + {
>> + spin_unlock_irq(®ister_lock);
>> + return ret;
>> + }
>> + }
>> +
>> + soc_count++;
>> + soc_parent->parent = &soc_grandparent;
>> + dev_set_name(soc_parent, "%i", soc_count);
>> + soc_parent->platform_data = soc_dev;
>
> I don't think platform_data is the right place for this.
I agree with you, but I was unsure how else to get the data back.
> It's not clear
> what soc_parent and soc_dev do here as soc_dev never gets registered.
>
> Should this be:
>
> soc_dev->parent = &soc_grandparent;
> dev_set_name(soc_dev, "%i", soc_count);
> device_register(soc_dev);
AFAIK soc_dev can't be registered. It's just a container which holds
each SoW's information to be exported in the way of const char *'s.
struct soc_device {
struct device dev;
const char *machine;
const char *family;
const char *soc_id;
const char *revision;
};
I don't believe that the "struct device dev;" is required either, but
this is something I was advised to put in.
Can you think of a better way to store these values other than in
platform_data then?
> and drop soc_parent and add the files to soc_device? In soc_info_get(),
> you could then do:
>
> struct soc_device *soc = container_of(dev, struct soc_device, dev);
>
>> + spin_unlock_irq(®ister_lock);
>> +
>> + ret = device_register(soc_parent);
>> + if (ret)
>> + return ret;
>> +
>> + soc_device_create_files(soc_parent);
>> +
>> + return ret;
>> +}
Kind regards,
Lee
next prev parent reply other threads:[~2011-08-24 14:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-10 13:03 [PATCH 1/4] Framework for exporting System-on-Chip information via sysfs Lee Jones
2011-08-10 13:03 ` [PATCH 2/4] Add documenation for new sysfs devices/soc functionallity Lee Jones
2011-08-10 15:02 ` Greg KH
2011-08-10 13:03 ` [PATCH 3/4] mach-ux500: export System-on-Chip information ux500 via sysfs Lee Jones
2011-08-10 13:34 ` Jamie Iles
2011-08-10 15:03 ` Greg KH
2011-09-01 6:58 ` Lee Jones
2011-09-01 14:24 ` Greg KH
2011-08-24 16:10 ` Arnd Bergmann
2011-08-25 9:20 ` Lee Jones
2011-08-25 14:56 ` Arnd Bergmann
2011-08-25 15:16 ` Lee Jones
2011-08-10 13:03 ` [PATCH 4/4] Move top level platform devices in sysfs to /sys/devices/soc/X Lee Jones
2011-08-10 15:02 ` Greg KH
2011-08-11 11:57 ` Linus Walleij
2011-08-11 15:22 ` Greg KH
2011-08-11 18:24 ` Linus Walleij
2011-08-24 15:21 ` Arnd Bergmann
2011-08-24 15:25 ` Arnd Bergmann
2011-08-10 13:29 ` [PATCH 1/4] Framework for exporting System-on-Chip information via sysfs Jamie Iles
2011-08-24 14:08 ` Lee Jones [this message]
2011-08-24 14:19 ` Jamie Iles
2011-08-24 14:22 ` Jamie Iles
2011-08-10 15:02 ` Greg KH
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=4E5505EA.6050207@linaro.org \
--to=lee.jones@linaro.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 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).