diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-05 10:06:53 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-06-05 10:06:53 -0300 |
commit | 9da10a20ba6b92d9756eeaaad204e108b2b214af (patch) | |
tree | cc6367dcee752a561862d059a82e5b8af3a8cf86 /linux/drivers/media/video/ivtv | |
parent | 0f339fedba49b4571e77a6e9eada52f4101750a2 (diff) | |
download | mediapointer-dvb-s2-9da10a20ba6b92d9756eeaaad204e108b2b214af.tar.gz mediapointer-dvb-s2-9da10a20ba6b92d9756eeaaad204e108b2b214af.tar.bz2 |
backport I2C changes on several files
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Some I2C API change patches were committed at kernel. Backport those changes to
V4L/DVB tree.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/ivtv')
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtv-i2c.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-i2c.c b/linux/drivers/media/video/ivtv/ivtv-i2c.c index db9243b08..17afb3659 100644 --- a/linux/drivers/media/video/ivtv/ivtv-i2c.c +++ b/linux/drivers/media/video/ivtv/ivtv-i2c.c @@ -136,7 +136,7 @@ static const u8 hw_addrs[] = { }; /* This array should match the IVTV_HW_ defines */ -static const char * const hw_drivernames[] = { +static const char * const hw_devicenames[] = { "cx25840", "saa7115", "saa7127", @@ -168,8 +168,12 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) return -1; id = hw_driverids[idx]; memset(&info, 0, sizeof(info)); - strlcpy(info.driver_name, hw_drivernames[idx], +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) + strlcpy(info.driver_name, hw_devicenames[idx], sizeof(info.driver_name)); +#else + strlcpy(info.type, hw_devicenames[idx], sizeof(info.type)); +#endif info.addr = hw_addrs[idx]; for (i = 0; itv->i2c_clients[i] && i < I2C_CLIENTS_MAX; i++) {} @@ -686,7 +690,7 @@ static const char *ivtv_i2c_id_name(u32 id) for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) if (hw_driverids[i] == id) - return hw_drivernames[i]; + return hw_devicenames[i]; return "unknown device"; } @@ -697,7 +701,7 @@ static const char *ivtv_i2c_hw_name(u32 hw) for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) if (1 << i == hw) - return hw_drivernames[i]; + return hw_devicenames[i]; return "unknown device"; } @@ -799,7 +803,7 @@ int init_ivtv_i2c(struct ivtv *itv) * same size and GPIO must be the last entry. */ if (ARRAY_SIZE(hw_driverids) != ARRAY_SIZE(hw_addrs) || - ARRAY_SIZE(hw_drivernames) != ARRAY_SIZE(hw_addrs) || + ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs) || IVTV_HW_GPIO != (1 << (ARRAY_SIZE(hw_addrs) - 1)) || hw_driverids[ARRAY_SIZE(hw_addrs) - 1]) { IVTV_ERR("Mismatched I2C hardware arrays\n"); |