Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220980
b: refs/heads/master
c: 8ef4f4e
h: refs/heads/master
v: v3
  • Loading branch information
Linus Walleij authored and Ben Dooks committed Oct 25, 2010
1 parent 42587cc commit 76f53d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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: 1804edd15c66a7af11f9e6194b4c783b37c5fe98
refs/heads/master: 8ef4f4e4afd55b6015d5b283172d240e22c91854
13 changes: 9 additions & 4 deletions trunk/drivers/i2c/busses/i2c-nomadik.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ static int init_hw(struct nmk_i2c_dev *dev)
{
int stat;

clk_enable(dev->clk);

stat = flush_i2c_fifo(dev);
if (stat)
return stat;
Expand All @@ -263,6 +265,8 @@ static int init_hw(struct nmk_i2c_dev *dev)

dev->cli.operation = I2C_NO_OPERATION;

clk_disable(dev->clk);

return 0;
}

Expand Down Expand Up @@ -558,6 +562,8 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
if (status)
return status;

clk_enable(dev->clk);

/* setup the i2c controller */
setup_i2c_controller(dev);

Expand Down Expand Up @@ -590,10 +596,13 @@ static int nmk_i2c_xfer(struct i2c_adapter *i2c_adap,
dev_err(&dev->pdev->dev, "%s\n",
cause >= ARRAY_SIZE(abort_causes)
? "unknown reason" : abort_causes[cause]);
clk_disable(dev->clk);
return status;
}
mdelay(1);
}
clk_disable(dev->clk);

/* return the no. messages processed */
if (status)
return status;
Expand Down Expand Up @@ -857,8 +866,6 @@ static int __devinit nmk_i2c_probe(struct platform_device *pdev)
goto err_no_clk;
}

clk_enable(dev->clk);

adap = &dev->adap;
adap->dev.parent = &pdev->dev;
adap->owner = THIS_MODULE;
Expand Down Expand Up @@ -895,7 +902,6 @@ static int __devinit nmk_i2c_probe(struct platform_device *pdev)
return 0;

err_init_hw:
clk_disable(dev->clk);
err_add_adap:
clk_put(dev->clk);
err_no_clk:
Expand Down Expand Up @@ -928,7 +934,6 @@ static int __devexit nmk_i2c_remove(struct platform_device *pdev)
iounmap(dev->virtbase);
if (res)
release_mem_region(res->start, resource_size(res));
clk_disable(dev->clk);
clk_put(dev->clk);
platform_set_drvdata(pdev, NULL);
kfree(dev);
Expand Down

0 comments on commit 76f53d9

Please sign in to comment.