Re: [PATCH 07/13] i2c: pnx: Use devm_*() functions

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

 



> @@ -674,29 +670,27 @@ static int i2c_pnx_probe(struct platform_device *pdev)
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {
>  		dev_err(&pdev->dev, "Unable to get mem resource.\n");
> -		ret = -EBUSY;
> -		goto out_clkget;
> +		return -EBUSY;
>  	}
> -	if (!request_mem_region(res->start, I2C_PNX_REGION_SIZE,
> -				pdev->name)) {
> +	if (!devm_request_mem_region(&pdev->dev, res->start,
> +				     I2C_PNX_REGION_SIZE, pdev->name)) {
>  		dev_err(&pdev->dev,
>  		       "I/O region 0x%08x for I2C already in use.\n",
>  		       res->start);
> -		ret = -ENOMEM;
> -		goto out_clkget;
> +		return -ENOMEM;
>  	}
>  
>  	alg_data->base = res->start;
> -	alg_data->ioaddr = ioremap(res->start, I2C_PNX_REGION_SIZE);
> +	alg_data->ioaddr = devm_ioremap(&pdev->dev, res->start,
> +					I2C_PNX_REGION_SIZE);

Why not converting it to devm_ioremap_resource?

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