diff options
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 285002603..22c9db395 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -699,11 +699,19 @@ static void pvr2_sysfs_class_release(struct class *class) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +static void pvr2_sysfs_release(struct class_device *class_dev) +{ + pvr2_sysfs_trace("Releasing class_dev id=%p",class_dev); + kfree(class_dev); +} +#else static void pvr2_sysfs_release(struct device *class_dev) { pvr2_sysfs_trace("Releasing class_dev id=%p",class_dev); kfree(class_dev); } +#endif static void class_dev_destroy(struct pvr2_sysfs *sfp) @@ -906,6 +914,15 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp, } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +static int pvr2_sysfs_hotplug(struct class_device *cd,char **envp, + int numenvp,char *buf,int size) +{ + /* Even though we don't do anything here, we still need this function + because sysfs will still try to call it. */ + return 0; +} +#else static int pvr2_sysfs_hotplug(struct device *cd,char **envp, int numenvp,char *buf,int size) { @@ -913,6 +930,7 @@ static int pvr2_sysfs_hotplug(struct device *cd,char **envp, because sysfs will still try to call it. */ return 0; } +#endif struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) { @@ -922,13 +940,15 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void) pvr2_sysfs_trace("Creating pvr2_sysfs_class id=%p",clp); clp->class.name = "pvrusb2"; clp->class.class_release = pvr2_sysfs_class_release; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) clp->class.release = pvr2_sysfs_release; #else clp->class.dev_release = pvr2_sysfs_release; #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) clp->class.hotplug = pvr2_sysfs_hotplug; +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) + clp->class.uevent = pvr2_sysfs_hotplug; #else clp->class.dev_uevent = pvr2_sysfs_hotplug; #endif |