diff options
author | Mike Isely <isely@pobox.com> | 2007-10-14 16:20:34 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2007-10-14 16:20:34 -0500 |
commit | 66439930c41982012b1fdf0913120a1317019df3 (patch) | |
tree | 1e4aeca0b482c9710cbe909eb3d12b1e11a3d254 /linux/drivers/media | |
parent | bb67e760e1e642830860904df5bcedac3d1195b3 (diff) | |
download | mediapointer-dvb-s2-66439930c41982012b1fdf0913120a1317019df3.tar.gz mediapointer-dvb-s2-66439930c41982012b1fdf0913120a1317019df3.tar.bz2 |
pvrusb2: Fix broken build for 2.6.18 kernel
From: Mike Isely <isely@pobox.com>
Earlier changes to move away from use of struct class_device
introduced breakage for kernels older than 2.6.19. This change at
least allows it to build again for 2.6.18. Still unclear about older
kernels, unfortunately :-(
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media')
-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 |