[alsa-devel] [PATCH] ASoC: Make register_card API available to drivers
Koul, Vinod
vinod.koul at intel.com
Thu Jan 13 12:36:19 CET 2011
> > This patch makes register_card and unregister_card API available to machine
> > drivers. This also maintains compatibility with older method of registration
> > which can be marked depreciated and removed eventually.
>
> This is probably mostly OK but it'd be good if you could break it down
> into a small patch series. At present it does a bunch of refactoring
> and also adds the API - it'd be better if there were a sequence of
> patches, each doing a single refactor, followed by a final patch which
> exports the API.
Sure will do that...
> > @@ -1870,16 +1868,12 @@ static int soc_probe(struct platform_device *pdev)
> > struct snd_soc_card *card = platform_get_drvdata(pdev);
> > int ret = 0;
> >
> > + /* no card, so machine driver will register explictly */
> > + if (!card)
> > + return 0;
> > +
>
> Hrm, this looks a bit surprising. When we're registering directly from
> the machine drivers I'd not expect us to end up going through soc-probe
> at all and...
>
> > /* Bodge while we unpick instantiation */
> > card->dev = &pdev->dev;
>
> ...that the card device would be something passed in from the machine
> driver (probably something that the architecture code registered in
> order to allow the machine driver to probe, but possibly something
> else).
Yes on both of these, but I didn't want to break current method.
So I kept these to ensure both methods work fine.
One we have converted all driver to use register then we can remove these.
Would have made sense to put a comment for that
~Vinod
More information about the Alsa-devel
mailing list