diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2009-05-12 11:13:32 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-17 03:22:34 -0400 |
commit | 0a861e9eb76c68b23be1aa4758269c5b412089a9 (patch) | |
tree | 4ec2284a725039e95dedd11b3b1fba6ead012349 | |
parent | f73c8f53ccc13ae13c6dbfa002083448a5ad0c81 (diff) |
soc-camera: unify i2c camera device platform data
Unify i2c camera device platform data to point to struct soc_camera_link
for a smooth transition to soc-camera as a platform driver.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boards/board-ap325rxa.c | 2 | ||||
-rw-r--r-- | arch/sh/boards/mach-migor/setup.c | 4 | ||||
-rw-r--r-- | drivers/media/video/ov772x.c | 6 | ||||
-rw-r--r-- | drivers/media/video/tw9910.c | 6 |
4 files changed, 11 insertions, 7 deletions
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 1c4d83ef2a47..8cc46874ade3 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -417,7 +417,7 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | |||
417 | }, | 417 | }, |
418 | { | 418 | { |
419 | I2C_BOARD_INFO("ov772x", 0x21), | 419 | I2C_BOARD_INFO("ov772x", 0x21), |
420 | .platform_data = &ov7725_info, | 420 | .platform_data = &ov7725_info.link, |
421 | }, | 421 | }, |
422 | }; | 422 | }; |
423 | 423 | ||
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index 6ed401cd3156..95d90213be0c 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -430,11 +430,11 @@ static struct i2c_board_info migor_i2c_devices[] = { | |||
430 | }, | 430 | }, |
431 | { | 431 | { |
432 | I2C_BOARD_INFO("ov772x", 0x21), | 432 | I2C_BOARD_INFO("ov772x", 0x21), |
433 | .platform_data = &ov7725_info, | 433 | .platform_data = &ov7725_info.link, |
434 | }, | 434 | }, |
435 | { | 435 | { |
436 | I2C_BOARD_INFO("tw9910", 0x45), | 436 | I2C_BOARD_INFO("tw9910", 0x45), |
437 | .platform_data = &tw9910_info, | 437 | .platform_data = &tw9910_info.link, |
438 | }, | 438 | }, |
439 | }; | 439 | }; |
440 | 440 | ||
diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c index c0d911252862..0bce255168bd 100644 --- a/drivers/media/video/ov772x.c +++ b/drivers/media/video/ov772x.c | |||
@@ -1067,10 +1067,12 @@ static int ov772x_probe(struct i2c_client *client, | |||
1067 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); | 1067 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
1068 | int ret; | 1068 | int ret; |
1069 | 1069 | ||
1070 | info = client->dev.platform_data; | 1070 | if (!client->dev.platform_data) |
1071 | if (!info) | ||
1072 | return -EINVAL; | 1071 | return -EINVAL; |
1073 | 1072 | ||
1073 | info = container_of(client->dev.platform_data, | ||
1074 | struct ov772x_camera_info, link); | ||
1075 | |||
1074 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { | 1076 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { |
1075 | dev_err(&adapter->dev, | 1077 | dev_err(&adapter->dev, |
1076 | "I2C-Adapter doesn't support " | 1078 | "I2C-Adapter doesn't support " |
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c index a39947643992..aa5065ea09ed 100644 --- a/drivers/media/video/tw9910.c +++ b/drivers/media/video/tw9910.c | |||
@@ -875,10 +875,12 @@ static int tw9910_probe(struct i2c_client *client, | |||
875 | const struct tw9910_scale_ctrl *scale; | 875 | const struct tw9910_scale_ctrl *scale; |
876 | int i, ret; | 876 | int i, ret; |
877 | 877 | ||
878 | info = client->dev.platform_data; | 878 | if (!client->dev.platform_data) |
879 | if (!info) | ||
880 | return -EINVAL; | 879 | return -EINVAL; |
881 | 880 | ||
881 | info = container_of(client->dev.platform_data, | ||
882 | struct tw9910_video_info, link); | ||
883 | |||
882 | if (!i2c_check_functionality(to_i2c_adapter(client->dev.parent), | 884 | if (!i2c_check_functionality(to_i2c_adapter(client->dev.parent), |
883 | I2C_FUNC_SMBUS_BYTE_DATA)) { | 885 | I2C_FUNC_SMBUS_BYTE_DATA)) { |
884 | dev_err(&client->dev, | 886 | dev_err(&client->dev, |