[alsa-devel] Need help with failed driver initialization

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Sep 11 05:55:25 CEST 2012

On Mon, Sep 10, 2012 at 03:47:54PM -0500, Timur Tabi wrote:

> So it appears that platform_device_alloc("soc-audio", -1) no longer works
> for me.  When I replace that code with a call to snd_soc_register_card(),
> my driver works again.

> I noticed that a lot of drivers still use platform_device_alloc(), so I
> don't know if this problem specific to my drivers, or everyone else is
> broken but they don't know it yet.  Either way, I'll post a patch soon.

It's nothing to do with that - it'd break with any driver.  The problem
is that you're passing data into your driver using dev_set_drvdata()
instead of using platform data.  This has never been supported by the
driver core (driver data is exclusively for use by the bound driver) and
recently the driver core was changed to clear the driver data every time
a driver was unbound (like happens during a deferred probe).  Which
unfortunately soc-core relies on, but it should always have been using
platform data.

In any case, all drivers are supposed to be being converted to use
snd_soc_register_card() so converting is a good thing.

More information about the Alsa-devel mailing list