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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux