recipes-kernel: Add GLSDK specific kernel tree for omap-a15
[glsdk/meta-ti-glsdk.git] / ti-local-power-manager / lpm-BKL-fix.patch
1 From b7e83000f316f5f109b9237fde4d1c576534aa1a Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Tue, 4 Jan 2011 14:21:02 +0100
4 Subject: [PATCH] Fix build with 2.6.37rcX
6 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7 ---
8  .../bios/power/modules/omap3530/lpm/lpm_driver.c   |   12 +++++++++---
9  1 files changed, 9 insertions(+), 3 deletions(-)
11 diff --git a/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c b/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
12 index fa22ea3..4663fc9 100644
13 --- a/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
14 +++ b/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c
15 @@ -40,6 +40,7 @@
16  #include <asm/semaphore.h>
17  #endif
18  #include <linux/io.h>
19 +#include <linux/slab.h>
20  
21  #include "lpm_driver.h"
22  #include "lpm_dev.h"
23 @@ -95,7 +96,7 @@ static int enablevicp = -1;
24  module_param(enablevicp, int, S_IRUGO);
25  
26  /* forward declaration of system calls (used by Linux driver) */
27 -static int lpm_ioctl    (struct inode *inode, struct file *filp,
28 +static long lpm_ioctl    (struct file *filp,
29                           unsigned int cmd, unsigned long args);
30  static int lpm_open     (struct inode *inode, struct file *filp);
31  static int lpm_release  (struct inode *inode, struct file *filp);
32 @@ -111,7 +112,7 @@ static void       lpm_os_trace  (char *fmt, ...);
33  
34  static struct file_operations lpm_fops = {
35      .owner =    THIS_MODULE,
36 -    .ioctl =    lpm_ioctl,
37 +    .unlocked_ioctl = lpm_ioctl,
38      .open =     lpm_open,
39      .release =  lpm_release,
40  };
41 @@ -244,7 +245,11 @@ static int __init lpm_init(void)
42          lpm->inst[i].major = MAJOR(lpm->first);
43          lpm->inst[i].minor = MINOR(lpm->first) + i;
44          INIT_LIST_HEAD(&lpm->inst[i].clients);
45 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
46          init_MUTEX(&lpm->inst[i].sem);
47 +#else
48 +        sema_init(&lpm->inst[i].sem,1);
49 +#endif
50          init_completion(&lpm->inst[i].event);
51          lpm_devAttrs.os_instance = (void *)&lpm->inst[i];
52          LPM_init(i, &lpm->inst[i].lpm, &lpm_devAttrs);
53 @@ -320,7 +325,7 @@ fail_02:
54  /*
55   *  ======== lpm_ioctl ========
56   */
57 -static int lpm_ioctl(struct inode *inode, struct file *filp,
58 +static long lpm_ioctl(struct file *filp,
59                       unsigned int cmd, unsigned long args)
60  {
61      struct LPM_Dev     *dev;
62 @@ -328,6 +333,7 @@ static int lpm_ioctl(struct inode *inode, struct file *filp,
63      LPM_Client         *client;
64      LPM_Status          lpmStat = LPM_SOK;
65      int                 stat = 0;
66 +    struct inode *inode = filp->f_dentry->d_inode;
67  
68      TRACE(KERN_ALERT "--> lpm_ioctl, cmd: 0x%X\n", cmd);
69  
70 -- 
71 1.6.6.1