Re: [PATCH 02/31] ARM: amba: of: convert to use amba_device_alloc

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

 



On 01/20/2012 03:23 AM, Russell King - ARM Linux wrote:
> Convert DT code to use the new amba_device_alloc APIs.
> 
> Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>

Acked-by: Rob Herring <rob.herring@xxxxxxxxxxx>

> ---
>  drivers/of/platform.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 63b3ec4..cae9477 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
>  	if (!of_device_is_available(node))
>  		return NULL;
>  
> -	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
> +	dev = amba_device_alloc(NULL, 0, 0);
>  	if (!dev)
>  		return NULL;
>  
> @@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
>  	if (ret)
>  		goto err_free;
>  
> -	ret = amba_device_register(dev, &iomem_resource);
> +	ret = amba_device_add(dev, &iomem_resource);
>  	if (ret)
>  		goto err_free;
>  
>  	return dev;
>  
>  err_free:
> -	kfree(dev);
> +	amba_device_put(dev);
>  	return NULL;
>  }
>  #else /* CONFIG_ARM_AMBA */

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


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux