Re: [ALSA STABLE 3/3] a few more -- unregister platform device again if probe was unsuccessful

Ingo Oeser
2006-04-13T09:28:38Z

Hi Rene,

On Thursday, 13. April 2006 03:46, you wrote:
> And finally, unregister on probe failure for sound/drivers,
> sound/arm/sa11xx-uda1341.c and sound/ppc/powermac.c.
>
> sound/arm/sa11xx-uda1341.c | 14 +++++++++-----
> sound/drivers/dummy.c | 4 ++++
> sound/drivers/mpu401/mpu401.c | 4 ++++
> sound/drivers/mtpav.c | 14 +++++++++-----
> sound/drivers/serial-u16550.c | 4 ++++
> sound/drivers/virmidi.c | 4 ++++
> sound/ppc/powermac.c | 14 +++++++++-----
> 7 files changed, 43 insertions(+), 15 deletions(-)

This is inserting lots of duplicate and control heavy code.
It looks like the same pattern and is using just platform_xxx funxtions.

Any counter-examples with a different pattern, which you converted in
a different manner?

Wouldn't it be more useful to do these checks in
platform_register_simple() and return the proper error value there?

Or just create a small helper, if this have to be done seperate.

Greg, what do you think here?

Regards

Ingo Oeser