summaryrefslogtreecommitdiff
path: root/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'v4l_experimental/pvrusb2/pvrusb2-i2c-core.c')
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-i2c-core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c b/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c
index 869e40519..d7e9ffabb 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-i2c-core.c
@@ -1,6 +1,6 @@
/*
*
- * $Id: pvrusb2-i2c-core.c,v 1.3 2006/01/14 22:09:52 mcisely Exp $
+ * $Id: pvrusb2-i2c-core.c,v 1.4 2006/01/22 03:51:19 mcisely Exp $
*
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
*
@@ -299,9 +299,17 @@ static int pvr2_i2c_core_singleton(struct i2c_client *cp,
if (!cp) return -EINVAL;
if (!(cp->driver)) return -EINVAL;
if (!(cp->driver->command)) return -EINVAL;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
if (!try_module_get(cp->driver->owner)) return -EAGAIN;
+#else
+ if (!try_module_get(cp->driver->driver.owner)) return -EAGAIN;
+#endif
stat = cp->driver->command(cp,cmd,arg);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
module_put(cp->driver->owner);
+#else
+ module_put(cp->driver->driver.owner);
+#endif
return stat;
}