[alsa-devel] [PATCH 07/17] ASoC: Tegra DAS: Use devm_ APIs and module_platform_driver

Stephen Warren swarren at nvidia.com
Thu Nov 24 04:29:24 EST 2011


Thierry Reding wrote at Tuesday, November 22, 2011 11:58 PM:
> * Stephen Warren wrote:
> > module_platform_drive saves some boiler-plate code.
> >
> > The devm_ APIs remove the need to manually clean up allocations,
> > thus removing some code.
...
> >  static int __devexit tegra_das_remove(struct platform_device *pdev)
> >  {
> > -	struct resource *res;
> > -
> >  	if (!das)
> >  		return -ENODEV;
> >
> > -	platform_set_drvdata(pdev, NULL);
> > -
> [...]
> 
> Setting the driver data to NULL may still be a good idea.

When Mark Brown reviewed the TrimSlice machine driver, he mentioned that
clearing the drvdata was pointless; nothing should be using it when the
device is not created.

As background, soon after that, I modified the tegra_wm8903.c machine
driver along the same lines, but evidently didn't update tegra_das.c
in a similar way, but would have if I'd been paying attention...

-- 
nvpublic



More information about the devicetree-discuss mailing list