aboutsummaryrefslogtreecommitdiffstats
path: root/extras/recipes-ti/local-power-manager/ti-local-power-manager/lpm-BKL-fix.patch
blob: 4b5a537ab1b38013e191b5ffc8f6aa08699b184b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From b7e83000f316f5f109b9237fde4d1c576534aa1a Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 4 Jan 2011 14:21:02 +0100
Subject: [PATCH] Fix build with 2.6.37rcX

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 .../bios/power/modules/omap3530/lpm/lpm_driver.c   |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c b/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
index fa22ea3..4663fc9 100644
--- a/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
+++ b/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
@@ -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"
@@ -95,7 +96,7 @@ static int enablevicp = -1;
 module_param(enablevicp, int, S_IRUGO);
 
 /* forward declaration of system calls (used by Linux driver) */
-static int lpm_ioctl    (struct inode *inode, struct file *filp,
+static long lpm_ioctl    (struct file *filp,
                          unsigned int cmd, unsigned long args);
 static int lpm_open     (struct inode *inode, struct file *filp);
 static int lpm_release  (struct inode *inode, struct file *filp);
@@ -111,7 +112,7 @@ static void       lpm_os_trace  (char *fmt, ...);
 
 static struct file_operations lpm_fops = {
     .owner =    THIS_MODULE,
-    .ioctl =    lpm_ioctl,
+    .unlocked_ioctl = lpm_ioctl,
     .open =     lpm_open,
     .release =  lpm_release,
 };
@@ -244,7 +245,11 @@ static int __init lpm_init(void)
         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);
@@ -320,7 +325,7 @@ fail_02:
 /*
  *  ======== lpm_ioctl ========
  */
-static int lpm_ioctl(struct inode *inode, struct file *filp,
+static long lpm_ioctl(struct file *filp,
                      unsigned int cmd, unsigned long args)
 {
     struct LPM_Dev     *dev;
@@ -328,6 +333,7 @@ static int lpm_ioctl(struct inode *inode, struct file *filp,
     LPM_Client         *client;
     LPM_Status          lpmStat = LPM_SOK;
     int                 stat = 0;
+    struct inode *inode = filp->f_dentry->d_inode;
 
     TRACE(KERN_ALERT "--> lpm_ioctl, cmd: 0x%X\n", cmd);
 
-- 
1.6.6.1