Skip to content

Commit

Permalink
sh: ap325 camera without i2c driver fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed May 22, 2009
1 parent 5805977 commit 37869fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/sh/boards/board-ap325rxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ static int camera_probe(void)
struct i2c_msg msg;
int ret;

if (!a)
return -ENODEV;

camera_power(1);
msg.addr = 0x6e;
msg.buf = camera_ncm03j_magic;
Expand Down

0 comments on commit 37869fa

Please sign in to comment.