lkml.org 
[lkml]   [2009]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] Export device_add_attributes() so drivers can use it.
From
On Wed, Feb 18, 2009 at 16:48, Grant Likely <grant.likely@secretlab.ca> wrote:
> On Wed, Feb 18, 2009 at 8:45 AM, Kay Sievers <kay.sievers@vrfy.org> wrote:
>> On Wed, Feb 18, 2009 at 16:29, Greg KH <gregkh@suse.de> wrote:
>>> On Wed, Feb 18, 2009 at 08:11:34AM -0700, Grant Likely wrote:
>>>> From: Grant Likely <grant.likely@secretlab.ca>
>>>>
>>>> I find myself using the pattern of device_add_attributes() and
>>>> device_remove_attributes() frequently in my drivers. Rather than
>>>> reinventing the wheel every time, I'm floating this patch to export
>>>> the symbols to see how it is received. If this looks okay then I'll
>>>> rework my drivers and post additional patches to use these functions.
>>>
>>> No objection from me, as long as the symbols are EXPORT_SYMBOL_GPL(),
>>> like the rest of the driver core. Is that ok with you?
>>
>> These functions used outside the core create attributes after the
>> uevent is sent, and userspace will not see these files at event time.
>> This is in most cases a pretty broken behavior. Is that the expected
>> behavior in your drivers?
>
> ??? I don't follow what you mean.
>
> I'm using these functions to allow the driver to add device attribs;
> primarily for debugging knobs and controls. Userspace will see the
> files after the driver is bound to the device. The uevent doesn't
> really come into play.

Sure, they do. Many things expect all files which are visible at the
device to be readable also at event time. That's the whole way udev
and device property matching works. There are only a few exceptions
where creating files at a device later, after it is registered with
the core, is not a bug.

Thanks,
Kay


\
 
 \ /
  Last update: 2009-02-18 16:59    [W:1.363 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site