1 From cf1b789e1a6873d9680156fac9f675a0f1cdd17b Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Thu, 5 Feb 2015 16:01:44 +0000
4 Subject: [PATCH 107/114] i2c_bcm2708: Fix clock reference counting
7 drivers/i2c/busses/i2c-bcm2708.c | 12 ++++++++++--
8 1 file changed, 10 insertions(+), 2 deletions(-)
10 --- a/drivers/i2c/busses/i2c-bcm2708.c
11 +++ b/drivers/i2c/busses/i2c-bcm2708.c
12 @@ -337,11 +337,17 @@ static int bcm2708_i2c_probe(struct plat
16 + err = clk_prepare_enable(clk);
18 + dev_err(&pdev->dev, "could not enable clk: %d\n", err);
22 bcm2708_i2c_init_pinmode(pdev->id);
24 bi = kzalloc(sizeof(*bi), GFP_KERNEL);
27 + goto out_clk_disable;
29 platform_set_drvdata(pdev, bi);
31 @@ -412,6 +418,8 @@ out_iounmap:
36 + clk_disable_unprepare(clk);
40 @@ -426,7 +434,7 @@ static int bcm2708_i2c_remove(struct pla
41 i2c_del_adapter(&bi->adapter);
42 free_irq(bi->irq, bi);
44 - clk_disable(bi->clk);
45 + clk_disable_unprepare(bi->clk);