lkml.org 
[lkml]   [2013]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: driver model, duplicate names question
On Tue, Jul 16, 2013 at 09:34:57AM -0700, Srinivas Pandruvada wrote:
> Hi Greg,
>
> I would like to create tree like structure using device model (struct
> device, device_register/device_unregister) using parent/child
> relationship while creation. I want to be able to create duplicate
> names, when their parents are different, similar to a directory structure.
> I see that I can't create devices with duplicate names (device names),
> even when their parents are different.

We actually check that? Nice, I didn't realize that :)

> How can I allow duplicate names when their parents are different devices?
> I want to avoid flat model as I have parent child relationship and there
> will be too many devices using flat model.

Devices on the same bus shouldn't have the same name, but if they are in
a "tree", it should be ok. What check is erroring out?

> Why, I need?
> I am going to publish RFC for a new power cap class driver. We have a
> multiple controllers under power cap class (they are devices). Under
> which there are multiple power zones, with parent/child relationships.
> Currently I have to use kobject_init_and_add, which I want to avoid and
> just use device_register. Other places, wherever such relationships are
> required, kobjects are used like cpufreq.

Yes, you shouldn't use "raw" kobject calls at all, so we should fix
this.

thanks,

greg k-h


\
 
 \ /
  Last update: 2013-07-16 19:43    [W:0.077 / U:19.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site