ti-local-power-manager: fix build with recent kernels
authorKoen Kooi <koen@openembedded.org>
Sun, 5 Dec 2010 17:32:59 +0000 (18:32 +0100)
committerKoen Kooi <koen@openembedded.org>
Mon, 6 Dec 2010 12:50:57 +0000 (13:50 +0100)
Signed-off-by: Koen Kooi <k-kooi@ti.com>
recipes/ti/ti-local-power-manager/lpm-BKL-fix.patch [new file with mode: 0644]
recipes/ti/ti-local-power-manager_1.24.02.09.bb

diff --git a/recipes/ti/ti-local-power-manager/lpm-BKL-fix.patch b/recipes/ti/ti-local-power-manager/lpm-BKL-fix.patch
new file mode 100644 (file)
index 0000000..43bb5a9
--- /dev/null
@@ -0,0 +1,39 @@
+From: Koen Kooi <k-kooi@ti.com>
+Subject: Fix build with 2.6.37rcX
+
+---
+
+--- /tmp/lpm_driver.c  2010-12-05 18:25:17.000000000 +0100
++++ local_power_manager_linux_1_24_02_09/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c      2010-12-05 18:30:13.000000000 +0100
+@@ -40,6 +40,7 @@
+ #include <asm/semaphore.h>
+ #endif
+ #include <linux/io.h>
++#include <linux/slab.h>
+ #include "lpm_driver.h"
+ #include "lpm_dev.h"
+@@ -111,7 +112,11 @@
+ static struct file_operations lpm_fops = {
+     .owner =    THIS_MODULE,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+     .ioctl =    lpm_ioctl,
++#else
++    .unlocked_ioctl = lpm_ioctl,
++#endif
+     .open =     lpm_open,
+     .release =  lpm_release,
+ };
+@@ -244,7 +249,11 @@
+         lpm->inst[i].major = MAJOR(lpm->first);
+         lpm->inst[i].minor = MINOR(lpm->first) + i;
+         INIT_LIST_HEAD(&lpm->inst[i].clients);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+         init_MUTEX(&lpm->inst[i].sem);
++#else
++        sema_init(&lpm->inst[i].sem,1);
++#endif
+         init_completion(&lpm->inst[i].event);
+         lpm_devAttrs.os_instance = (void *)&lpm->inst[i];
+         LPM_init(i, &lpm->inst[i].lpm, &lpm_devAttrs);
index 9c8b4df..759561f 100644 (file)
@@ -3,6 +3,8 @@ require ti-local-power-manager.inc
 PV = "1_24_02_09"
 PE = "1"
 
+SRC_URI += "file://lpm-BKL-fix.patch"
+
 SRC_URI[lpmtarball.md5sum] = "3d05453df26dfc811de04839d74c2f2b" 
 SRC_URI[lpmtarball.sha256sum] = "7335959a6217df17289f81839e6c6948f31cc0797ebc5389edef7190ed3ea589"