Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179748
b: refs/heads/master
c: 4927fbf
h: refs/heads/master
v: v3
  • Loading branch information
Uwe Kleine-König authored and Ben Dooks committed Jan 24, 2010
1 parent 7f64dd0 commit 37bdcc5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1ee06b72968d80ab9362ec61143c4f090cc2d1b
refs/heads/master: 4927fbf11dc1057cd9c94dd40358e5f98c999311
21 changes: 11 additions & 10 deletions trunk/drivers/i2c/busses/i2c-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,22 +497,23 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
}

res_size = resource_size(res);

if (!request_mem_region(res->start, res_size, DRIVER_NAME)) {
ret = -EBUSY;
goto fail0;
}

base = ioremap(res->start, res_size);
if (!base) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -EIO;
goto fail0;
goto fail1;
}

i2c_imx = kzalloc(sizeof(struct imx_i2c_struct), GFP_KERNEL);
if (!i2c_imx) {
dev_err(&pdev->dev, "can't allocate interface\n");
ret = -ENOMEM;
goto fail1;
}

if (!request_mem_region(res->start, res_size, DRIVER_NAME)) {
ret = -EBUSY;
goto fail2;
}

Expand Down Expand Up @@ -583,11 +584,11 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
fail4:
clk_put(i2c_imx->clk);
fail3:
release_mem_region(i2c_imx->res->start, resource_size(res));
fail2:
kfree(i2c_imx);
fail1:
fail2:
iounmap(base);
fail1:
release_mem_region(res->start, resource_size(res));
fail0:
if (pdata && pdata->exit)
pdata->exit(&pdev->dev);
Expand Down Expand Up @@ -619,8 +620,8 @@ static int __exit i2c_imx_remove(struct platform_device *pdev)

clk_put(i2c_imx->clk);

release_mem_region(i2c_imx->res->start, resource_size(i2c_imx->res));
iounmap(i2c_imx->base);
release_mem_region(i2c_imx->res->start, resource_size(i2c_imx->res));
kfree(i2c_imx);
return 0;
}
Expand Down

0 comments on commit 37bdcc5

Please sign in to comment.