Commit 6772e076 authored by Michael Still's avatar Michael Still Committed by Linus Torvalds

[PATCH] cli_sti_removal-002

  This patch has been available fro review on the janitor's mailing list
  for some days without any negative comments (or comments for that
  matter).  This patch recitifies the use of the obsolete cli() and
  sti() calls.
parent 1cb11c4f
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#define DEV_AWC_INFO 1 #define DEV_AWC_INFO 1
#define DEV_AWC 1 #define DEV_AWC 1
spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
struct awc_proc_private{ struct awc_proc_private{
struct ctl_table_header * sysctl_header; struct ctl_table_header * sysctl_header;
struct ctl_table * proc_table; struct ctl_table * proc_table;
...@@ -293,10 +295,9 @@ int awc_proc_fun(ctl_table *ctl, int write, struct file * filp, ...@@ -293,10 +295,9 @@ int awc_proc_fun(ctl_table *ctl, int write, struct file * filp,
}; };
if (!write && rid->selector->may_change) { if (!write && rid->selector->may_change) {
save_flags(flags); spin_lock_irqsave(&driver_lock, flags);
cli();
awc_readrid(dev,rid,rid_dir->buff + rid->offset); awc_readrid(dev,rid,rid_dir->buff + rid->offset);
restore_flags(flags); spin_unlock_irqrestore(&driver_lock, flags);
}; };
if (rid->array > 1 || rid->bits > 32){ if (rid->array > 1 || rid->bits > 32){
...@@ -325,8 +326,7 @@ int awc_proc_fun(ctl_table *ctl, int write, struct file * filp, ...@@ -325,8 +326,7 @@ int awc_proc_fun(ctl_table *ctl, int write, struct file * filp,
} }
} }
if (write) { if (write) {
save_flags(flags); spin_lock_irqsave(&driver_lock, flags);
cli();
if (rid->selector->MAC_Disable_at_write){ if (rid->selector->MAC_Disable_at_write){
awc_disable_MAC(dev); awc_disable_MAC(dev);
...@@ -335,8 +335,7 @@ int awc_proc_fun(ctl_table *ctl, int write, struct file * filp, ...@@ -335,8 +335,7 @@ int awc_proc_fun(ctl_table *ctl, int write, struct file * filp,
if (rid->selector->MAC_Disable_at_write){ if (rid->selector->MAC_Disable_at_write){
awc_enable_MAC(dev); awc_enable_MAC(dev);
}; };
restore_flags(flags); spin_lock_irqsave(&driver_lock, flags);
}; };
DEBUG(0x20000,"awc proc ret %x \n",retv); DEBUG(0x20000,"awc proc ret %x \n",retv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment