sconosciuto

main.c.patch

Dec 2nd, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.21 KB | None | 0 0
  1. --- a/drivers/phone_svn/svnet/main.c
  2. +++ b/drivers/phone_svn/svnet/main.c
  3. @@ -118,6 +118,7 @@
  4.     wake_lock_init(&sn->wlock, WAKE_LOCK_SUSPEND, "svnet");
  5.     sn->wake_time = DEFAULT_RAW_WAKE_TIME;
  6.     sn->wake_process_time = DEFAULT_FMT_WAKE_TIME;
  7. +   sn->wlock.expires = jiffies;                                                        
  8.  }
  9.  
  10.  static inline void _wake_lock_destroy(struct svnet *sn)
  11. @@ -127,7 +128,9 @@
  12.  
  13.  static inline void _wake_lock_timeout(struct svnet *sn)
  14.  {
  15. -   wake_lock_timeout(&sn->wlock, sn->wake_time);
  16. +   long exp_cnt = sn->wlock.expires - jiffies;                                        
  17. +   if (exp_cnt < sn->wake_time)                                                        
  18. +       wake_lock_timeout(&sn->wlock, sn->wake_time);
  19.  }
  20.  
  21.  void _non_fmt_wakelock_timeout( void ) {
  22. @@ -137,7 +140,9 @@
  23.  
  24.  static inline void _wake_process_lock_timeout(struct svnet *sn)
  25.  {
  26. -   wake_lock_timeout(&sn->wlock, sn->wake_process_time);
  27. +   long exp_cnt = sn->wlock.expires - jiffies;                                        
  28. +   if (exp_cnt < sn->wake_process_time)                                                
  29. +       wake_lock_timeout(&sn->wlock, sn->wake_process_time);
  30.  }
  31.  
  32.  void _fmt_wakelock_timeout( void ) {
Advertisement
Add Comment
Please, Sign In to add comment