summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-09-18 08:22:32 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2007-09-18 08:22:32 +0200
commit67da967ca82fae5cdaba3d5b646bc505ba423813 (patch)
tree4c6c68bbd7b7999c4d8db1b9b3324369caaeb006
parentdfcd6af68fc687d7efab92de9b9c183ab59867cb (diff)
downloadmediapointer-dvb-s2-67da967ca82fae5cdaba3d5b646bc505ba423813.tar.gz
mediapointer-dvb-s2-67da967ca82fae5cdaba3d5b646bc505ba423813.tar.bz2
v4l2-common: minor cleanups.
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/v4l2-common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
-rw-r--r--linux/drivers/media/video/v4l2-common.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c
index f97d14486..a1d751c8a 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -1640,10 +1640,10 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver
client->addr = address;
client->adapter = adapter;
client->driver = driver;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
client->flags = I2C_CLIENT_ALLOW_USE;
#endif
- snprintf(client->name, sizeof(client->name) - 1, name);
+ strlcpy(client->name, name, sizeof(client->name));
err = probe(client);
if (err == 0) {
@@ -1651,8 +1651,7 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_INC_USE_COUNT;
#endif
- }
- else {
+ } else {
kfree(client);
}
return err != -ENOMEM ? 0 : err;