Re: [Alsa-devel] [PATCH] alsa: correct nonsensical sysfs device symlinks

Takashi Iwai
2007-01-25T18:38:55Z

At Thu, 25 Jan 2007 13:34:19 -0500,
xiphmont@xiph.org wrote:
>
> On 1/25/07, Takashi Iwai <tiwai@suse.de> wrote:
>
> > The problem with your patch is that it breaks the structure newly
> > introduced. In the new tree, card* contains the whole belonging
> > devices, and each device points to the one in the card object.
> > Passing dev->parent there cuts the relation between the card object
> > and each device.
> >
> > That's why my patch rules out setting card->dev with ifdef
> > CONFIG_SYSFS_DEPRECATED. As fallback, it takes the parent device to
> > build the old style tree.
> >
> > > Having just checked a 2.6.18 machine, none of the device symlinks
> > > point to card* objects; thay all point to /sys/devices/....
> >
> > Yes, it's a new stuff.
>
> [This does beg the question: Does the benefit of this complete
> restructuring in a subminor release of an allegedly stable kernel
> outweigh the fact that it breaks all audio for any user running a
> gnome desktop?]

Well, that's not me who introduced that ;)

> OK, so my patch should be passing card->parent or dev->parent only in
> the case that CONFIG_SYSFS_DEPRECATED is set, and leaving the call the
> way it was previously in the case CONFIG_SYSFS_DEPRECATED is not set.
> Essentially, ifdef/else both cases?

Also, avoid creating card* instance. It makes no sense in that case.
(So... what's wrong with my patch?)

> Is this also going to have to be the case for every other class type
> that converts from class_device_create to device_create?

I don't think so. The case of sound class is more complicated, a
combination of API change and a new tree.

Takashi