linux-stable/drivers/input/misc
Arnd Bergmann 613655fa39 drivers: autoconvert trivial BKL users to private mutex
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

These drivers do not seem to be under active
maintainance from my brief investigation. Apologies
to those maintainers that I have missed.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2010-10-05 15:01:04 +02:00
..
88pm860x_onkey.c Input: 88pm860x_onkey - remove invalid irq number assignment 2010-05-19 10:14:10 -07:00
ad714x-i2c.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
ad714x-spi.c Input: add Analog Devices AD714x captouch input driver 2010-04-13 23:27:16 -07:00
ad714x.c fix typos concerning "initiali[zs]e" 2010-06-16 18:05:05 +02:00
ad714x.h Input: add Analog Devices AD714x captouch input driver 2010-04-13 23:27:16 -07:00
adxl34x-i2c.c Input: adxl34 - make enable/disable separate from suspend/resume 2010-07-03 13:13:21 -07:00
adxl34x-spi.c Input: adxl34 - make enable/disable separate from suspend/resume 2010-07-03 13:13:21 -07:00
adxl34x.c Input: adxl34x - do not mark device as disabled on startup 2010-08-05 10:07:31 -07:00
adxl34x.h Input: adxl34 - make enable/disable separate from suspend/resume 2010-07-03 13:13:21 -07:00
apanel.c Input: make i2c device ids constant 2010-01-09 23:28:33 -08:00
ati_remote.c USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
ati_remote2.c param: use ops in struct kernel_param, rather than get and set fns directly 2010-08-11 23:04:13 +09:30
atlas_btns.c Input: atlas_btns - switch to using pr_err() and friends 2010-07-13 09:43:24 -07:00
bfin_rotary.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
cm109.c USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
cobalt_btns.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
dm355evm_keys.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
hp_sdc_rtc.c drivers: autoconvert trivial BKL users to private mutex 2010-10-05 15:01:04 +02:00
ixp4xx-beeper.c ixp4xx-beeper: Use IRQF_NO_SUSPEND not IRQF_TIMER for non-timer interrupt 2010-07-29 13:24:57 +02:00
Kconfig Input: Add pwm beeper driver 2010-07-14 01:23:11 -07:00
keyspan_remote.c USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
m68kspkr.c
Makefile Input: Add pwm beeper driver 2010-07-14 01:23:11 -07:00
max8925_onkey.c Input: enable onkey driver of max8925 2010-05-22 00:57:59 -07:00
pcap_keys.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pcf8574_keypad.c Merge commit 'v2.6.35-rc3' into for-linus 2010-06-22 11:32:04 -07:00
pcf50633-input.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
pcspkr.c i8253: Convert i8253_lock to raw_spinlock 2010-03-02 10:28:38 +01:00
powermate.c USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
pwm-beeper.c Input: Add pwm beeper driver 2010-07-14 01:23:11 -07:00
rb532_button.c Input: add driver for S1 button of rb532 2009-03-09 20:10:12 -07:00
rotary_encoder.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sgi_btns.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sparcspkr.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
twl4030-pwrbutton.c Input: twl4030-pwrbutton - replace __devinit with __init 2010-07-08 21:02:55 -07:00
twl4030-vibra.c Input: twl4030-vibra - correct the power down sequence 2010-05-22 00:58:06 -07:00
uinput.c Input: uinput - add devname alias to allow module on-demand load 2010-08-21 00:37:40 -07:00
winbond-cir.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
wistron_btns.c Input: wistron_btns - fix a memory leak in wb_module_init error path 2010-06-28 01:12:22 -07:00
wm831x-on.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
yealink.c USB: rename usb_buffer_alloc() and usb_buffer_free() users 2010-05-20 13:21:38 -07:00
yealink.h tree-wide: Assorted spelling fixes 2010-02-09 11:13:56 +01:00