> @@ -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