Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347065
b: refs/heads/master
c: a72ad45
h: refs/heads/master
i:
  347063: b4c45c8
v: v3
  • Loading branch information
Mark Brown authored and Wolfram Sang committed Nov 16, 2012
1 parent 53e75fc commit a92ce73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 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: 2935e0e05a3e348f046f1b485e933b85d1479aaa
refs/heads/master: a72ad456bb93a0114b4d6702421b35a9c548bd46
35 changes: 7 additions & 28 deletions trunk/drivers/i2c/busses/i2c-s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ struct s3c24xx_i2c {
void __iomem *regs;
struct clk *clk;
struct device *dev;
struct resource *ioarea;
struct i2c_adapter adap;

struct s3c2410_platform_i2c *pdata;
Expand Down Expand Up @@ -988,25 +987,16 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
goto err_clk;
}

i2c->ioarea = request_mem_region(res->start, resource_size(res),
pdev->name);

if (i2c->ioarea == NULL) {
dev_err(&pdev->dev, "cannot request IO\n");
ret = -ENXIO;
goto err_clk;
}

i2c->regs = ioremap(res->start, resource_size(res));
i2c->regs = devm_request_and_ioremap(&pdev->dev, res);

if (i2c->regs == NULL) {
dev_err(&pdev->dev, "cannot map IO\n");
ret = -ENXIO;
goto err_ioarea;
goto err_clk;
}

dev_dbg(&pdev->dev, "registers %p (%p, %p)\n",
i2c->regs, i2c->ioarea, res);
dev_dbg(&pdev->dev, "registers %p (%p)\n",
i2c->regs, res);

/* setup info block for the i2c core */

Expand All @@ -1017,7 +1007,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)

ret = s3c24xx_i2c_init(i2c);
if (ret != 0)
goto err_iomap;
goto err_clk;

/* find the IRQ for this unit (note, this relies on the init call to
* ensure no current IRQs pending
Expand All @@ -1026,15 +1016,15 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
i2c->irq = ret = platform_get_irq(pdev, 0);
if (ret <= 0) {
dev_err(&pdev->dev, "cannot find IRQ\n");
goto err_iomap;
goto err_clk;
}

ret = request_irq(i2c->irq, s3c24xx_i2c_irq, 0,
dev_name(&pdev->dev), i2c);

if (ret != 0) {
dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
goto err_iomap;
goto err_clk;
}

ret = s3c24xx_i2c_register_cpufreq(i2c);
Expand Down Expand Up @@ -1074,13 +1064,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
err_irq:
free_irq(i2c->irq, i2c);

err_iomap:
iounmap(i2c->regs);

err_ioarea:
release_resource(i2c->ioarea);
kfree(i2c->ioarea);

err_clk:
clk_disable_unprepare(i2c->clk);
clk_put(i2c->clk);
Expand Down Expand Up @@ -1109,11 +1092,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
clk_disable_unprepare(i2c->clk);
clk_put(i2c->clk);

iounmap(i2c->regs);

release_resource(i2c->ioarea);
s3c24xx_i2c_dt_gpio_free(i2c);
kfree(i2c->ioarea);

return 0;
}
Expand Down

0 comments on commit a92ce73

Please sign in to comment.