Re: [Alsa-devel] Re: [ALSA 1/2] continue on IS_ERR from platform device registration

From: Takashi Iwai
Date: Mon Apr 10 2006 - 13:28:35 EST


At Fri, 07 Apr 2006 18:26:26 +0200,
Rene Herman wrote:
>
> I must say I wasn't aware that ALSA PCI devices at the moment load
> without devices. Wasn't there even an oft used ALSA configuration script
> out there that worked by loading all drivers and checking which ones stuck?

Not for PCI. alsaconf checks the return status of modprobe for ISA
non-PnP devices, though, so we would fix it once if the probe model
were changed.

(snip)
> In the analogy, given that the PCI driver loads even without any of its
> IDs present means a platform_driver loading without anything present as
> well isn't, from the view of the driver model, much of a difference
> after all. PnP doesn't have a "new_id" field, but could have, and I
> therefore in fact agree by now that it's best to follow PCI's lead here.

Exactly, that's the reason I suggested. To keep the behavior of
driver consistent.

OTOH, I'm not 100% for that change, because I know that it will break
the old behavior as mentioned in the above. Such a breakage isn't
always a good buy against just-for-cleanness or consistency...

> > At least it would make the code more simpler, I guess.
>
> Not significantly.

Well, you can remove the whole

if (!cards)
... unregister...

in the probe callback if we follow the pci driver model, i.e. modprobe
doesn't return an error if no device is found at the moment.

> We'd need to seperate the probe() method a bit, so
> that the things we need before a bind _could_ ever succeed were in the
> main loop and would make the driver skip device registration if not
> fullfilled. For example, if with the snd-adlib driver no port= is given,
> then attempted binds would simply tell you "please specify port" over
> and over again, something which can only be solved by unloading and
> reloading the driver, this time specifying the port. This is still a
> difference due to non-discoverability, and I feel this should still make
> the driver fail to load.

Hm, surely it's not so intuitive in the case of ISA devices. Maybe
it'd be better to keep the current behavior: probe() returns an error
if no device is found at loading...


Takashi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/