Re: [PATCH] libudev: device - add devtype support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 2, 2009 at 17:17, David Zeuthen <david@xxxxxxxx> wrote:
> On Fri, 2009-01-02 at 09:22 +0100, Marcel Holtmann wrote:
>> > > I was playing a little bit with libudev and I actually need the DEVTYPE
>> > > from uevent for various tasks. Especially with USB and Bluetooth, the
>> > > subsystem value is too generic.
>> > >
>> > > Attached is a patch that implements udev_device_get_devtype() and also
>> > > udev_device_get_parent_with_devtype(). Please double check that I did it
>> > > the right way.
>> >
>> > Looks good. Applied.
>>
>> one minor thing that came to my mind is that DEVTYPE and subsystem are
>> actually kinda coupled. So a DEVTYPE="host" has a different semantic for
>> USB than for Bluetooth subsystem for example. Not sure if we actually
>> care or just add a udev_device_get_parent_with_subsystem_devtype()
>> function to give applications a choice if they wanna care.
>
> Isn't DEVTYPE in the environment already?

Yeah, it's a property, just like SUBSYSTEM is. But It's a "core
property", like a "subsystem subtype" which sounds fine to support in
the API.

> If so, just use the new API added here
>
> http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=f089350234e39b868a5e3df71a8f8c036aaae4fd
>
> instead of Marcel's patch?

In many cases you just walk along the parent devices, and lookup a
specific device, without introducing dependencies on the specific
devpath position, like the "two directories up"-crap many tools do.
The enumeration API, which searches over all /sys devices does not
really fit here.

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux