diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-05-20 10:30:06 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-22 00:19:11 -0400 |
commit | 37869fa2da1a952ed736858f8b9e45c0b9131ae9 (patch) | |
tree | eb7ae599e4fd98008651070cb2847a1a7c896a19 | |
parent | 5805977e63a36ad56594a623f3bd2bebcb7db233 (diff) |
sh: ap325 camera without i2c driver fix
This patch fixes the ap325rxa ncm03j camera code to handle
the case where no i2c driver is present. Without this fix
i2c_transfer() may be passed NULL as adapter which results
in a crash.
Triggered when i2c-sh_mobile.c failed to probe() due to
missing MSTP clocks.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boards/board-ap325rxa.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 39e46919df14..f2a29641b6a3 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -263,6 +263,9 @@ static int camera_probe(void) | |||
263 | struct i2c_msg msg; | 263 | struct i2c_msg msg; |
264 | int ret; | 264 | int ret; |
265 | 265 | ||
266 | if (!a) | ||
267 | return -ENODEV; | ||
268 | |||
266 | camera_power(1); | 269 | camera_power(1); |
267 | msg.addr = 0x6e; | 270 | msg.addr = 0x6e; |
268 | msg.buf = camera_ncm03j_magic; | 271 | msg.buf = camera_ncm03j_magic; |