* 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.
> 
> Signed-off-by: Stephen Warren <[email protected]>
> ---
>  sound/soc/tegra/tegra_das.c |   45 +++++++++---------------------------------
>  1 files changed, 10 insertions(+), 35 deletions(-)
> 
> diff --git a/sound/soc/tegra/tegra_das.c b/sound/soc/tegra/tegra_das.c
[...]
> @@ -208,32 +208,18 @@ static int __devinit tegra_das_probe(struct 
> platform_device *pdev)
>  
>       return 0;
>  
> -err_release:
> -     release_mem_region(res->start, resource_size(res));
> -err_free:
> -     kfree(das);
> +err:
>       das = NULL;
> -exit:
>       return ret;
>  }
>  
>  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.

Thierry

Attachment: pgp1pdrRZ7xvN.pgp
Description: PGP signature

Reply via email to