diff options
Diffstat (limited to 'linux/drivers/media/video/usbvision/usbvision-core.c')
-rw-r--r-- | linux/drivers/media/video/usbvision/usbvision-core.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c index 071b11e75..2d20c809d 100644 --- a/linux/drivers/media/video/usbvision/usbvision-core.c +++ b/linux/drivers/media/video/usbvision/usbvision-core.c @@ -2286,14 +2286,23 @@ int usbvision_power_on(struct usb_usbvision *usbvision) */ // to call usbvision_power_off from task queue +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void call_usbvision_power_off(void *_usbvision) +#else +static void call_usbvision_power_off(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct usb_usbvision *usbvision = _usbvision; +#else + struct usb_usbvision *usbvision = container_of(work, struct usb_usbvision, powerOffWork); +#endif PDEBUG(DBG_FUNC, ""); down_interruptible(&usbvision->lock); if(usbvision->user == 0) { usbvision_i2c_usb_del_bus(&usbvision->i2c_adap); + usbvision_power_off(usbvision); usbvision->initialized = 0; } @@ -2310,7 +2319,11 @@ static void usbvision_powerOffTimer(unsigned long data) INIT_TQUEUE(&usbvision->powerOffTask, call_usbvision_power_off, usbvision); (void) schedule_task(&usbvision->powerOffTask); #else +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off, usbvision); +#else + INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off); +#endif (void) schedule_work(&usbvision->powerOffWork); #endif |