Re: [PATCH RFC v3 2/3] i2c: pxa: convert to devm_* API

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

 



On Thu, May 23, 2013 at 08:00:08PM +0800, Libo Chen wrote:
> when i2c malloc faild, we should not try to call release_mem_region.
> aovid this, convert them to devm_* API.
> 
> Signed-off-by: Libo Chen <libo.chen@xxxxxxxxxx>

First, you did it right. This patch should not be combined with 1/3. It
is not a trivial cleanup, so I prefer to keep them seperated.

BTW did you test these patches on real hardware?

> @@ -1198,19 +1187,6 @@ static int i2c_pxa_probe(struct platform_device *dev)
>  #endif
>  	return 0;
>  
> -eadapt:
> -	if (!i2c->use_pio)
> -		free_irq(irq, i2c);
> -ereqirq:
> -	clk_disable(i2c->clk);
> -	iounmap(i2c->reg_base);
> -eremap:
> -	clk_put(i2c->clk);
> -eclk:
> -	kfree(i2c);
> -emalloc:
> -	release_mem_region(res->start, resource_size(res));
> -	return ret;
>  }
>  
>  static int i2c_pxa_remove(struct platform_device *dev)
> @@ -1218,15 +1194,6 @@ static int i2c_pxa_remove(struct platform_device *dev)
>  	struct pxa_i2c *i2c = platform_get_drvdata(dev);
>  
>  	i2c_del_adapter(&i2c->adap);
> -	if (!i2c->use_pio)
> -		free_irq(i2c->irq, i2c);
> -
> -	clk_disable(i2c->clk);
> -	clk_put(i2c->clk);
> -
> -	iounmap(i2c->reg_base);
> -	release_mem_region(i2c->iobase, i2c->iosize);
> -	kfree(i2c);

You remove too much. Who disables the clock now?

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux