diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-02-24 14:03:41 -0500 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-02-24 14:03:41 -0500 |
commit | c9a2c46d7f32a884510b20f0cfa79a2c6a2f1413 (patch) | |
tree | 9379ceb746c5643083fc52e9fb26115b15b5a004 /arch | |
parent | 4fa2b1cde0e3797549f711ce9e51c395b3d6d2a7 (diff) |
ARM: OMAP: Release i2c_adapter after use (Siemens SX1)
Each call to i2c_get_adapter() must be followed by a call to
i2c_put_adapter() to release the grabbed reference. Otherwise the
reference count grows forever and the adapter can never be
unregistered.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Vladimir Ananiev <vovan888@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap1/board-sx1.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 1c7f09aedf07..e473fa6d4a5f 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c | |||
@@ -61,6 +61,7 @@ int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) | |||
61 | data[0] = regoffset; /* register num */ | 61 | data[0] = regoffset; /* register num */ |
62 | data[1] = value; /* register data */ | 62 | data[1] = value; /* register data */ |
63 | err = i2c_transfer(adap, msg, 1); | 63 | err = i2c_transfer(adap, msg, 1); |
64 | i2c_put_adapter(adap); | ||
64 | if (err >= 0) | 65 | if (err >= 0) |
65 | return 0; | 66 | return 0; |
66 | return err; | 67 | return err; |
@@ -91,6 +92,7 @@ int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value) | |||
91 | msg->buf = data; | 92 | msg->buf = data; |
92 | err = i2c_transfer(adap, msg, 1); | 93 | err = i2c_transfer(adap, msg, 1); |
93 | *value = data[0]; | 94 | *value = data[0]; |
95 | i2c_put_adapter(adap); | ||
94 | 96 | ||
95 | if (err >= 0) | 97 | if (err >= 0) |
96 | return 0; | 98 | return 0; |