Hi, This minor patch enables several processes to open the sonypi device at the same time. This is useful for example when one process polls for events while a second one is used to control the screen brightness... Marcelo, please apply. Thanks. Stelian. You can import this changeset into BK by piping this whole message to '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.459, 2002-04-29 12:43:03+02:00, stelian@popies.net Allow multiple processes to open the sonypi device sonypi.c | 13 +++++++------ sonypi.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff -Nru a/drivers/char/sonypi.c b/drivers/char/sonypi.c --- a/drivers/char/sonypi.c Mon Apr 29 12:44:53 2002 +++ b/drivers/char/sonypi.c Mon Apr 29 12:44:53 2002 @@ -485,12 +485,10 @@ static int sonypi_misc_open(struct inode * inode, struct file * file) { down(&sonypi_device.lock); - if (sonypi_device.open_count) - goto out; + /* Flush input queue on first open */ + if (!sonypi_device.open_count) + sonypi_initq(); sonypi_device.open_count++; - /* Flush input queue */ - sonypi_initq(); -out: up(&sonypi_device.lock); return 0; } @@ -718,9 +716,12 @@ SONYPI_DRIVER_MAJORVERSION, SONYPI_DRIVER_MINORVERSION); printk(KERN_INFO "sonypi: detected %s model, " - "camera = %s, compat = %s, nojogdial = %s\n", + "verbose = %s, fnkeyinit = %s, camera = %s, " + "compat = %s, nojogdial = %s\n", (sonypi_device.model == SONYPI_DEVICE_MODEL_TYPE1) ? "type1" : "type2", + verbose ? "on" : "off", + fnkeyinit ? "on" : "off", camera ? "on" : "off", compat ? "on" : "off", nojogdial ? "on" : "off"); diff -Nru a/drivers/char/sonypi.h b/drivers/char/sonypi.h --- a/drivers/char/sonypi.h Mon Apr 29 12:44:53 2002 +++ b/drivers/char/sonypi.h Mon Apr 29 12:44:53 2002 @@ -35,7 +35,7 @@ #ifdef __KERNEL__ #define SONYPI_DRIVER_MAJORVERSION 1 -#define SONYPI_DRIVER_MINORVERSION 12 +#define SONYPI_DRIVER_MINORVERSION 13 #include #include