From: Rui Miguel Silva Date: Tue, 12 Jan 2016 14:35:48 +0000 (+0000) Subject: greybus: kernel_ver: add handle for lights in 4.5 X-Git-Tag: Ubuntu-4.9.0-1.2~749^2~378^2~21^2~838 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b827e1137ca9b495f10f3215ed6dd6ff738f0c81;p=mirror_ubuntu-zesty-kernel.git greybus: kernel_ver: add handle for lights in 4.5 In v4.5 the LED API is changed related to the set brightness operations, set_sync is removed and the workqueue handling is now done by leds core, so no need for individual drivers to have one. This will be done by removing the SET_SYNC macro and add a new SET_BLOCKING. Signed-off-by: Rui Miguel Silva Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/kernel_ver.h b/drivers/staging/greybus/kernel_ver.h index d9bf159329e5..1f8d6a1bb6da 100644 --- a/drivers/staging/greybus/kernel_ver.h +++ b/drivers/staging/greybus/kernel_ver.h @@ -267,6 +267,15 @@ static inline size_t sg_pcopy_from_buffer(struct scatterlist *sgl, #include #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) +/* + * New change in LED api, the set_sync operation was renamed to set_blocking and + * the workqueue is now handle by core. So, only one set operation is need. + */ +#undef LED_HAVE_SET_SYNC +#define LED_HAVE_SET_BLOCKING +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) /* * From this version upper it was introduced the possibility to disable led