On Tue, Apr 02, 2013 at 04:53:40PM -0700, Jacob Pan wrote: > On Tue, 2 Apr 2013 16:00:42 -0700 > Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: > > > And, one final complaint, never use "raw" kobjects, for loads of good > > reasons, not the least being you just prevented userspace from seeing > > what is happening with your devices. Use the driver model, that's > > what it is there for, if you need "sub children", or subdirectories. > I chose to use to kobjects for the reason that userspace can see the > device linking more clearly. Then use a 'struct device'. > Let me try to paraphrase, I have two options: > 1. if I use the platform device model instead of raw kobjects, I would > have one platform device for each rapl domain. Then link individual > platform device with the generic thermal layer sysfs. I don't understand. > 2. In the current patch, I have one platform driver, then expose per > domain kobject that can be linked to the generic thermal layer. Common > attributes of all domains are grouped under the kset. Then use a 'struct device' that is attached to that kset, no need to use a platform device, as that's not what is needed here, right? > I did consider both options. I thought using #2 option is better since > it allow user to discover the topologies easier by following the > sysfs link. If i use use #1, it would be hard to expose the common > attributes and more code too. Perhpas I misread > Documentation/kobjects.txt which i thought kobject/kset are perfect for > presenting situation like this. No, kobjects are for things not using the device tree, like filesystems or other stuff. You are in the device tree, so use a 'struct device'. If you use a "raw" kobject, you do not notify userspace what is going on, and you loose out on a bunch of other stuff that the driver model provides you. But do you even need to use anything at all? Let's step back and start over, what exactly are you trying to tell userspace? What data do you have that you need to express to it? How do you want userspace to see/use it? greg k-h -- To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html