diff options
Diffstat (limited to 'arch/cris')
-rw-r--r-- | arch/cris/arch-v10/drivers/ds1302.c | 8 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/gpio.c | 1 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/i2c.c | 1 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/pcf8563.c | 7 | ||||
-rw-r--r-- | arch/cris/arch-v10/drivers/sync_serial.c | 14 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/cryptocop.c | 7 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/i2c.c | 1 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-a3/gpio.c | 12 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/mach-fs/gpio.c | 12 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/pcf8563.c | 7 | ||||
-rw-r--r-- | arch/cris/arch-v32/drivers/sync_serial.c | 14 | ||||
-rw-r--r-- | arch/cris/include/arch-v10/arch/irqflags.h | 45 | ||||
-rw-r--r-- | arch/cris/include/arch-v10/arch/system.h | 16 | ||||
-rw-r--r-- | arch/cris/include/arch-v32/arch/irqflags.h | 46 | ||||
-rw-r--r-- | arch/cris/include/arch-v32/arch/system.h | 22 | ||||
-rw-r--r-- | arch/cris/include/asm/irqflags.h | 1 | ||||
-rw-r--r-- | arch/cris/include/asm/system.h | 1 | ||||
-rw-r--r-- | arch/cris/kernel/profile.c | 1 |
18 files changed, 144 insertions, 72 deletions
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c index 884275629ef7..3d655dcc65da 100644 --- a/arch/cris/arch-v10/drivers/ds1302.c +++ b/arch/cris/arch-v10/drivers/ds1302.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/miscdevice.h> | 20 | #include <linux/miscdevice.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/smp_lock.h> | 22 | #include <linux/mutex.h> |
23 | #include <linux/bcd.h> | 23 | #include <linux/bcd.h> |
24 | #include <linux/capability.h> | 24 | #include <linux/capability.h> |
25 | 25 | ||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #define RTC_MAJOR_NR 121 /* local major, change later */ | 35 | #define RTC_MAJOR_NR 121 /* local major, change later */ |
36 | 36 | ||
37 | static DEFINE_MUTEX(ds1302_mutex); | ||
37 | static const char ds1302_name[] = "ds1302"; | 38 | static const char ds1302_name[] = "ds1302"; |
38 | 39 | ||
39 | /* The DS1302 might be connected to different bits on different products. | 40 | /* The DS1302 might be connected to different bits on different products. |
@@ -357,9 +358,9 @@ static long rtc_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned lon | |||
357 | { | 358 | { |
358 | int ret; | 359 | int ret; |
359 | 360 | ||
360 | lock_kernel(); | 361 | mutex_lock(&ds1302_mutex); |
361 | ret = rtc_ioctl(file, cmd, arg); | 362 | ret = rtc_ioctl(file, cmd, arg); |
362 | unlock_kernel(); | 363 | mutex_unlock(&ds1302_mutex); |
363 | 364 | ||
364 | return ret; | 365 | return ret; |
365 | } | 366 | } |
@@ -387,6 +388,7 @@ print_rtc_status(void) | |||
387 | static const struct file_operations rtc_fops = { | 388 | static const struct file_operations rtc_fops = { |
388 | .owner = THIS_MODULE, | 389 | .owner = THIS_MODULE, |
389 | .unlocked_ioctl = rtc_unlocked_ioctl, | 390 | .unlocked_ioctl = rtc_unlocked_ioctl, |
391 | .llseek = noop_llseek, | ||
390 | }; | 392 | }; |
391 | 393 | ||
392 | /* Probe for the chip by writing something to its RAM and try reading it back. */ | 394 | /* Probe for the chip by writing something to its RAM and try reading it back. */ |
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c index a07b6d25b0c7..a276f0811731 100644 --- a/arch/cris/arch-v10/drivers/gpio.c +++ b/arch/cris/arch-v10/drivers/gpio.c | |||
@@ -745,6 +745,7 @@ static const struct file_operations gpio_fops = { | |||
745 | .write = gpio_write, | 745 | .write = gpio_write, |
746 | .open = gpio_open, | 746 | .open = gpio_open, |
747 | .release = gpio_release, | 747 | .release = gpio_release, |
748 | .llseek = noop_llseek, | ||
748 | }; | 749 | }; |
749 | 750 | ||
750 | static void ioif_watcher(const unsigned int gpio_in_available, | 751 | static void ioif_watcher(const unsigned int gpio_in_available, |
diff --git a/arch/cris/arch-v10/drivers/i2c.c b/arch/cris/arch-v10/drivers/i2c.c index 77a941813819..c413539d4205 100644 --- a/arch/cris/arch-v10/drivers/i2c.c +++ b/arch/cris/arch-v10/drivers/i2c.c | |||
@@ -617,6 +617,7 @@ static const struct file_operations i2c_fops = { | |||
617 | .unlocked_ioctl = i2c_ioctl, | 617 | .unlocked_ioctl = i2c_ioctl, |
618 | .open = i2c_open, | 618 | .open = i2c_open, |
619 | .release = i2c_release, | 619 | .release = i2c_release, |
620 | .llseek = noop_llseek, | ||
620 | }; | 621 | }; |
621 | 622 | ||
622 | int __init | 623 | int __init |
diff --git a/arch/cris/arch-v10/drivers/pcf8563.c b/arch/cris/arch-v10/drivers/pcf8563.c index 7dcb1f85f42b..ea69faba9b62 100644 --- a/arch/cris/arch-v10/drivers/pcf8563.c +++ b/arch/cris/arch-v10/drivers/pcf8563.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
28 | #include <linux/bcd.h> | 28 | #include <linux/bcd.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/smp_lock.h> | ||
31 | 30 | ||
32 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
33 | #include <asm/system.h> | 32 | #include <asm/system.h> |
@@ -49,6 +48,7 @@ | |||
49 | #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) | 48 | #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) |
50 | #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) | 49 | #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) |
51 | 50 | ||
51 | static DEFINE_MUTEX(pcf8563_mutex); | ||
52 | static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ | 52 | static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ |
53 | 53 | ||
54 | static const unsigned char days_in_month[] = | 54 | static const unsigned char days_in_month[] = |
@@ -64,6 +64,7 @@ static int voltage_low; | |||
64 | static const struct file_operations pcf8563_fops = { | 64 | static const struct file_operations pcf8563_fops = { |
65 | .owner = THIS_MODULE, | 65 | .owner = THIS_MODULE, |
66 | .unlocked_ioctl = pcf8563_unlocked_ioctl, | 66 | .unlocked_ioctl = pcf8563_unlocked_ioctl, |
67 | .llseek = noop_llseek, | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | unsigned char | 70 | unsigned char |
@@ -343,9 +344,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned | |||
343 | { | 344 | { |
344 | int ret; | 345 | int ret; |
345 | 346 | ||
346 | lock_kernel(); | 347 | mutex_lock(&pcf8563_mutex); |
347 | return pcf8563_ioctl(filp, cmd, arg); | 348 | return pcf8563_ioctl(filp, cmd, arg); |
348 | unlock_kernel(); | 349 | mutex_unlock(&pcf8563_mutex); |
349 | 350 | ||
350 | return ret; | 351 | return ret; |
351 | } | 352 | } |
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index ee2dd4323daf..399dc1ec8e6f 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/poll.h> | 21 | #include <linux/poll.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/smp_lock.h> | 23 | #include <linux/mutex.h> |
24 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | #include <asm/dma.h> | 26 | #include <asm/dma.h> |
@@ -149,6 +149,7 @@ struct sync_port { | |||
149 | }; | 149 | }; |
150 | 150 | ||
151 | 151 | ||
152 | static DEFINE_MUTEX(sync_serial_mutex); | ||
152 | static int etrax_sync_serial_init(void); | 153 | static int etrax_sync_serial_init(void); |
153 | static void initialize_port(int portnbr); | 154 | static void initialize_port(int portnbr); |
154 | static inline int sync_data_avail(struct sync_port *port); | 155 | static inline int sync_data_avail(struct sync_port *port); |
@@ -250,7 +251,8 @@ static const struct file_operations sync_serial_fops = { | |||
250 | .poll = sync_serial_poll, | 251 | .poll = sync_serial_poll, |
251 | .unlocked_ioctl = sync_serial_ioctl, | 252 | .unlocked_ioctl = sync_serial_ioctl, |
252 | .open = sync_serial_open, | 253 | .open = sync_serial_open, |
253 | .release = sync_serial_release | 254 | .release = sync_serial_release, |
255 | .llseek = noop_llseek, | ||
254 | }; | 256 | }; |
255 | 257 | ||
256 | static int __init etrax_sync_serial_init(void) | 258 | static int __init etrax_sync_serial_init(void) |
@@ -445,7 +447,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
445 | int mode; | 447 | int mode; |
446 | int err = -EBUSY; | 448 | int err = -EBUSY; |
447 | 449 | ||
448 | lock_kernel(); | 450 | mutex_lock(&sync_serial_mutex); |
449 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); | 451 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); |
450 | 452 | ||
451 | if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { | 453 | if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { |
@@ -626,7 +628,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
626 | ret = 0; | 628 | ret = 0; |
627 | 629 | ||
628 | out: | 630 | out: |
629 | unlock_kernel(); | 631 | mutex_unlock(&sync_serial_mutex); |
630 | return ret; | 632 | return ret; |
631 | } | 633 | } |
632 | 634 | ||
@@ -961,9 +963,9 @@ static long sync_serial_ioctl(struct file *file, | |||
961 | { | 963 | { |
962 | long ret; | 964 | long ret; |
963 | 965 | ||
964 | lock_kernel(); | 966 | mutex_lock(&sync_serial_mutex); |
965 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); | 967 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); |
966 | unlock_kernel(); | 968 | mutex_unlock(&sync_serial_mutex); |
967 | 969 | ||
968 | return ret; | 970 | return ret; |
969 | } | 971 | } |
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index b07646a30509..c03bc3bc30c2 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c | |||
@@ -281,7 +281,8 @@ const struct file_operations cryptocop_fops = { | |||
281 | .owner = THIS_MODULE, | 281 | .owner = THIS_MODULE, |
282 | .open = cryptocop_open, | 282 | .open = cryptocop_open, |
283 | .release = cryptocop_release, | 283 | .release = cryptocop_release, |
284 | .unlocked_ioctl = cryptocop_ioctl | 284 | .unlocked_ioctl = cryptocop_ioctl, |
285 | .llseek = noop_llseek, | ||
285 | }; | 286 | }; |
286 | 287 | ||
287 | 288 | ||
@@ -3139,9 +3140,9 @@ cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
3139 | struct inode *inode = file->f_path.dentry->d_inode; | 3140 | struct inode *inode = file->f_path.dentry->d_inode; |
3140 | long ret; | 3141 | long ret; |
3141 | 3142 | ||
3142 | lock_kernel(); | 3143 | mutex_lock(&cryptocop_mutex); |
3143 | ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); | 3144 | ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); |
3144 | unlock_kernel(); | 3145 | mutex_unlock(&cryptocop_mutex); |
3145 | 3146 | ||
3146 | return ret; | 3147 | return ret; |
3147 | } | 3148 | } |
diff --git a/arch/cris/arch-v32/drivers/i2c.c b/arch/cris/arch-v32/drivers/i2c.c index 5a3e900c9a78..ddb23996f11a 100644 --- a/arch/cris/arch-v32/drivers/i2c.c +++ b/arch/cris/arch-v32/drivers/i2c.c | |||
@@ -698,6 +698,7 @@ static const struct file_operations i2c_fops = { | |||
698 | .unlocked_ioctl = i2c_ioctl, | 698 | .unlocked_ioctl = i2c_ioctl, |
699 | .open = i2c_open, | 699 | .open = i2c_open, |
700 | .release = i2c_release, | 700 | .release = i2c_release, |
701 | .llseek = noop_llseek, | ||
701 | }; | 702 | }; |
702 | 703 | ||
703 | static int __init i2c_init(void) | 704 | static int __init i2c_init(void) |
diff --git a/arch/cris/arch-v32/drivers/mach-a3/gpio.c b/arch/cris/arch-v32/drivers/mach-a3/gpio.c index 2dcd27adbad4..c845831e2225 100644 --- a/arch/cris/arch-v32/drivers/mach-a3/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-a3/gpio.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
26 | #include <linux/smp_lock.h> | 26 | #include <linux/mutex.h> |
27 | 27 | ||
28 | #include <asm/etraxgpio.h> | 28 | #include <asm/etraxgpio.h> |
29 | #include <hwregs/reg_map.h> | 29 | #include <hwregs/reg_map.h> |
@@ -66,6 +66,7 @@ static int dp_cnt; | |||
66 | #define DP(x) | 66 | #define DP(x) |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | static DEFINE_MUTEX(gpio_mutex); | ||
69 | static char gpio_name[] = "etrax gpio"; | 70 | static char gpio_name[] = "etrax gpio"; |
70 | 71 | ||
71 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 72 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
@@ -391,7 +392,7 @@ static int gpio_open(struct inode *inode, struct file *filp) | |||
391 | if (!priv) | 392 | if (!priv) |
392 | return -ENOMEM; | 393 | return -ENOMEM; |
393 | 394 | ||
394 | lock_kernel(); | 395 | mutex_lock(&gpio_mutex); |
395 | memset(priv, 0, sizeof(*priv)); | 396 | memset(priv, 0, sizeof(*priv)); |
396 | 397 | ||
397 | priv->minor = p; | 398 | priv->minor = p; |
@@ -414,7 +415,7 @@ static int gpio_open(struct inode *inode, struct file *filp) | |||
414 | spin_unlock_irq(&gpio_lock); | 415 | spin_unlock_irq(&gpio_lock); |
415 | } | 416 | } |
416 | 417 | ||
417 | unlock_kernel(); | 418 | mutex_unlock(&gpio_mutex); |
418 | return 0; | 419 | return 0; |
419 | } | 420 | } |
420 | 421 | ||
@@ -667,9 +668,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
667 | { | 668 | { |
668 | long ret; | 669 | long ret; |
669 | 670 | ||
670 | lock_kernel(); | 671 | mutex_lock(&gpio_mutex); |
671 | ret = gpio_ioctl_unlocked(file, cmd, arg); | 672 | ret = gpio_ioctl_unlocked(file, cmd, arg); |
672 | unlock_kernel(); | 673 | mutex_unlock(&gpio_mutex); |
673 | 674 | ||
674 | return ret; | 675 | return ret; |
675 | } | 676 | } |
@@ -893,6 +894,7 @@ static const struct file_operations gpio_fops = { | |||
893 | .write = gpio_write, | 894 | .write = gpio_write, |
894 | .open = gpio_open, | 895 | .open = gpio_open, |
895 | .release = gpio_release, | 896 | .release = gpio_release, |
897 | .llseek = noop_llseek, | ||
896 | }; | 898 | }; |
897 | 899 | ||
898 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 900 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c index 5ec8a7d4e7d7..ee90d2659be7 100644 --- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c +++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/smp_lock.h> | 25 | #include <linux/mutex.h> |
26 | 26 | ||
27 | #include <asm/etraxgpio.h> | 27 | #include <asm/etraxgpio.h> |
28 | #include <hwregs/reg_map.h> | 28 | #include <hwregs/reg_map.h> |
@@ -64,6 +64,7 @@ static int dp_cnt; | |||
64 | #define DP(x) | 64 | #define DP(x) |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | static DEFINE_MUTEX(gpio_mutex); | ||
67 | static char gpio_name[] = "etrax gpio"; | 68 | static char gpio_name[] = "etrax gpio"; |
68 | 69 | ||
69 | #if 0 | 70 | #if 0 |
@@ -429,7 +430,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
429 | if (!priv) | 430 | if (!priv) |
430 | return -ENOMEM; | 431 | return -ENOMEM; |
431 | 432 | ||
432 | lock_kernel(); | 433 | mutex_lock(&gpio_mutex); |
433 | memset(priv, 0, sizeof(*priv)); | 434 | memset(priv, 0, sizeof(*priv)); |
434 | 435 | ||
435 | priv->minor = p; | 436 | priv->minor = p; |
@@ -450,7 +451,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
450 | alarmlist = priv; | 451 | alarmlist = priv; |
451 | spin_unlock_irq(&alarm_lock); | 452 | spin_unlock_irq(&alarm_lock); |
452 | 453 | ||
453 | unlock_kernel(); | 454 | mutex_unlock(&gpio_mutex); |
454 | return 0; | 455 | return 0; |
455 | } | 456 | } |
456 | 457 | ||
@@ -708,9 +709,9 @@ static long gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
708 | { | 709 | { |
709 | long ret; | 710 | long ret; |
710 | 711 | ||
711 | lock_kernel(); | 712 | mutex_lock(&gpio_mutex); |
712 | ret = gpio_ioctl_unlocked(file, cmd, arg); | 713 | ret = gpio_ioctl_unlocked(file, cmd, arg); |
713 | unlock_kernel(); | 714 | mutex_unlock(&gpio_mutex); |
714 | 715 | ||
715 | return ret; | 716 | return ret; |
716 | } | 717 | } |
@@ -870,6 +871,7 @@ static const struct file_operations gpio_fops = { | |||
870 | .write = gpio_write, | 871 | .write = gpio_write, |
871 | .open = gpio_open, | 872 | .open = gpio_open, |
872 | .release = gpio_release, | 873 | .release = gpio_release, |
874 | .llseek = noop_llseek, | ||
873 | }; | 875 | }; |
874 | 876 | ||
875 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO | 877 | #ifdef CONFIG_ETRAX_VIRTUAL_GPIO |
diff --git a/arch/cris/arch-v32/drivers/pcf8563.c b/arch/cris/arch-v32/drivers/pcf8563.c index bef6eb53b153..b6e4fc0aad42 100644 --- a/arch/cris/arch-v32/drivers/pcf8563.c +++ b/arch/cris/arch-v32/drivers/pcf8563.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | #include <linux/smp_lock.h> | ||
28 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
29 | #include <linux/bcd.h> | 28 | #include <linux/bcd.h> |
30 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
@@ -45,6 +44,7 @@ | |||
45 | #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) | 44 | #define rtc_read(x) i2c_readreg(RTC_I2C_READ, x) |
46 | #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) | 45 | #define rtc_write(x,y) i2c_writereg(RTC_I2C_WRITE, x, y) |
47 | 46 | ||
47 | static DEFINE_MUTEX(pcf8563_mutex); | ||
48 | static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ | 48 | static DEFINE_MUTEX(rtc_lock); /* Protect state etc */ |
49 | 49 | ||
50 | static const unsigned char days_in_month[] = | 50 | static const unsigned char days_in_month[] = |
@@ -60,6 +60,7 @@ static int voltage_low; | |||
60 | static const struct file_operations pcf8563_fops = { | 60 | static const struct file_operations pcf8563_fops = { |
61 | .owner = THIS_MODULE, | 61 | .owner = THIS_MODULE, |
62 | .unlocked_ioctl = pcf8563_unlocked_ioctl, | 62 | .unlocked_ioctl = pcf8563_unlocked_ioctl, |
63 | .llseek = noop_llseek, | ||
63 | }; | 64 | }; |
64 | 65 | ||
65 | unsigned char | 66 | unsigned char |
@@ -339,9 +340,9 @@ static long pcf8563_unlocked_ioctl(struct file *filp, unsigned int cmd, unsigned | |||
339 | { | 340 | { |
340 | int ret; | 341 | int ret; |
341 | 342 | ||
342 | lock_kernel(); | 343 | mutex_lock(&pcf8563_mutex); |
343 | return pcf8563_ioctl(filp, cmd, arg); | 344 | return pcf8563_ioctl(filp, cmd, arg); |
344 | unlock_kernel(); | 345 | mutex_unlock(&pcf8563_mutex); |
345 | 346 | ||
346 | return ret; | 347 | return ret; |
347 | } | 348 | } |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index ca248f3adb80..c8637a9195ea 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
14 | #include <linux/major.h> | 14 | #include <linux/major.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/smp_lock.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/poll.h> | 18 | #include <linux/poll.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
@@ -145,6 +145,7 @@ typedef struct sync_port | |||
145 | spinlock_t lock; | 145 | spinlock_t lock; |
146 | } sync_port; | 146 | } sync_port; |
147 | 147 | ||
148 | static DEFINE_MUTEX(sync_serial_mutex); | ||
148 | static int etrax_sync_serial_init(void); | 149 | static int etrax_sync_serial_init(void); |
149 | static void initialize_port(int portnbr); | 150 | static void initialize_port(int portnbr); |
150 | static inline int sync_data_avail(struct sync_port *port); | 151 | static inline int sync_data_avail(struct sync_port *port); |
@@ -247,7 +248,8 @@ static const struct file_operations sync_serial_fops = { | |||
247 | .poll = sync_serial_poll, | 248 | .poll = sync_serial_poll, |
248 | .unlocked_ioctl = sync_serial_ioctl, | 249 | .unlocked_ioctl = sync_serial_ioctl, |
249 | .open = sync_serial_open, | 250 | .open = sync_serial_open, |
250 | .release = sync_serial_release | 251 | .release = sync_serial_release, |
252 | .llseek = noop_llseek, | ||
251 | }; | 253 | }; |
252 | 254 | ||
253 | static int __init etrax_sync_serial_init(void) | 255 | static int __init etrax_sync_serial_init(void) |
@@ -434,7 +436,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
434 | reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; | 436 | reg_dma_rw_cfg cfg = {.en = regk_dma_yes}; |
435 | reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; | 437 | reg_dma_rw_intr_mask intr_mask = {.data = regk_dma_yes}; |
436 | 438 | ||
437 | lock_kernel(); | 439 | mutex_lock(&sync_serial_mutex); |
438 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); | 440 | DEBUG(printk(KERN_DEBUG "Open sync serial port %d\n", dev)); |
439 | 441 | ||
440 | if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) | 442 | if (dev < 0 || dev >= NBR_PORTS || !ports[dev].enabled) |
@@ -583,7 +585,7 @@ static int sync_serial_open(struct inode *inode, struct file *file) | |||
583 | port->busy++; | 585 | port->busy++; |
584 | ret = 0; | 586 | ret = 0; |
585 | out: | 587 | out: |
586 | unlock_kernel(); | 588 | mutex_unlock(&sync_serial_mutex); |
587 | return ret; | 589 | return ret; |
588 | } | 590 | } |
589 | 591 | ||
@@ -966,9 +968,9 @@ static long sync_serial_ioctl(struct file *file, | |||
966 | { | 968 | { |
967 | long ret; | 969 | long ret; |
968 | 970 | ||
969 | lock_kernel(); | 971 | mutex_lock(&sync_serial_mutex); |
970 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); | 972 | ret = sync_serial_ioctl_unlocked(file, cmd, arg); |
971 | unlock_kernel(); | 973 | mutex_unlock(&sync_serial_mutex); |
972 | 974 | ||
973 | return ret; | 975 | return ret; |
974 | } | 976 | } |
diff --git a/arch/cris/include/arch-v10/arch/irqflags.h b/arch/cris/include/arch-v10/arch/irqflags.h new file mode 100644 index 000000000000..75ef18991240 --- /dev/null +++ b/arch/cris/include/arch-v10/arch/irqflags.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef __ASM_CRIS_ARCH_IRQFLAGS_H | ||
2 | #define __ASM_CRIS_ARCH_IRQFLAGS_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | static inline unsigned long arch_local_save_flags(void) | ||
7 | { | ||
8 | unsigned long flags; | ||
9 | asm volatile("move $ccr,%0" : "=rm" (flags) : : "memory"); | ||
10 | return flags; | ||
11 | } | ||
12 | |||
13 | static inline void arch_local_irq_disable(void) | ||
14 | { | ||
15 | asm volatile("di" : : : "memory"); | ||
16 | } | ||
17 | |||
18 | static inline void arch_local_irq_enable(void) | ||
19 | { | ||
20 | asm volatile("ei" : : : "memory"); | ||
21 | } | ||
22 | |||
23 | static inline unsigned long arch_local_irq_save(void) | ||
24 | { | ||
25 | unsigned long flags = arch_local_save_flags(); | ||
26 | arch_local_irq_disable(); | ||
27 | return flags; | ||
28 | } | ||
29 | |||
30 | static inline void arch_local_irq_restore(unsigned long flags) | ||
31 | { | ||
32 | asm volatile("move %0,$ccr" : : "rm" (flags) : "memory"); | ||
33 | } | ||
34 | |||
35 | static inline bool arch_irqs_disabled_flags(unsigned long flags) | ||
36 | { | ||
37 | return !(flags & (1 << 5)); | ||
38 | } | ||
39 | |||
40 | static inline bool arch_irqs_disabled(void) | ||
41 | { | ||
42 | return arch_irqs_disabled_flags(arch_local_save_flags()); | ||
43 | } | ||
44 | |||
45 | #endif /* __ASM_CRIS_ARCH_IRQFLAGS_H */ | ||
diff --git a/arch/cris/include/arch-v10/arch/system.h b/arch/cris/include/arch-v10/arch/system.h index 4a9cd36c9e16..935fde34aa15 100644 --- a/arch/cris/include/arch-v10/arch/system.h +++ b/arch/cris/include/arch-v10/arch/system.h | |||
@@ -44,20 +44,4 @@ static inline unsigned long _get_base(char * addr) | |||
44 | struct __xchg_dummy { unsigned long a[100]; }; | 44 | struct __xchg_dummy { unsigned long a[100]; }; |
45 | #define __xg(x) ((struct __xchg_dummy *)(x)) | 45 | #define __xg(x) ((struct __xchg_dummy *)(x)) |
46 | 46 | ||
47 | /* interrupt control.. */ | ||
48 | #define local_save_flags(x) __asm__ __volatile__ ("move $ccr,%0" : "=rm" (x) : : "memory"); | ||
49 | #define local_irq_restore(x) __asm__ __volatile__ ("move %0,$ccr" : : "rm" (x) : "memory"); | ||
50 | #define local_irq_disable() __asm__ __volatile__ ( "di" : : :"memory"); | ||
51 | #define local_irq_enable() __asm__ __volatile__ ( "ei" : : :"memory"); | ||
52 | |||
53 | #define irqs_disabled() \ | ||
54 | ({ \ | ||
55 | unsigned long flags; \ | ||
56 | local_save_flags(flags); \ | ||
57 | !(flags & (1<<5)); \ | ||
58 | }) | ||
59 | |||
60 | /* For spinlocks etc */ | ||
61 | #define local_irq_save(x) __asm__ __volatile__ ("move $ccr,%0\n\tdi" : "=rm" (x) : : "memory"); | ||
62 | |||
63 | #endif | 47 | #endif |
diff --git a/arch/cris/include/arch-v32/arch/irqflags.h b/arch/cris/include/arch-v32/arch/irqflags.h new file mode 100644 index 000000000000..041851f8ec6f --- /dev/null +++ b/arch/cris/include/arch-v32/arch/irqflags.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef __ASM_CRIS_ARCH_IRQFLAGS_H | ||
2 | #define __ASM_CRIS_ARCH_IRQFLAGS_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <arch/ptrace.h> | ||
6 | |||
7 | static inline unsigned long arch_local_save_flags(void) | ||
8 | { | ||
9 | unsigned long flags; | ||
10 | asm volatile("move $ccs,%0" : "=rm" (flags) : : "memory"); | ||
11 | return flags; | ||
12 | } | ||
13 | |||
14 | static inline void arch_local_irq_disable(void) | ||
15 | { | ||
16 | asm volatile("di" : : : "memory"); | ||
17 | } | ||
18 | |||
19 | static inline void arch_local_irq_enable(void) | ||
20 | { | ||
21 | asm volatile("ei" : : : "memory"); | ||
22 | } | ||
23 | |||
24 | static inline unsigned long arch_local_irq_save(void) | ||
25 | { | ||
26 | unsigned long flags = arch_local_save_flags(); | ||
27 | arch_local_irq_disable(); | ||
28 | return flags; | ||
29 | } | ||
30 | |||
31 | static inline void arch_local_irq_restore(unsigned long flags) | ||
32 | { | ||
33 | asm volatile("move %0,$ccs" : : "rm" (flags) : "memory"); | ||
34 | } | ||
35 | |||
36 | static inline bool arch_irqs_disabled_flags(unsigned long flags) | ||
37 | { | ||
38 | return !(flags & (1 << I_CCS_BITNR)); | ||
39 | } | ||
40 | |||
41 | static inline bool arch_irqs_disabled(void) | ||
42 | { | ||
43 | return arch_irqs_disabled_flags(arch_local_save_flags()); | ||
44 | } | ||
45 | |||
46 | #endif /* __ASM_CRIS_ARCH_IRQFLAGS_H */ | ||
diff --git a/arch/cris/include/arch-v32/arch/system.h b/arch/cris/include/arch-v32/arch/system.h index 6ca90f1f110a..76cea99eaa60 100644 --- a/arch/cris/include/arch-v32/arch/system.h +++ b/arch/cris/include/arch-v32/arch/system.h | |||
@@ -44,26 +44,4 @@ static inline unsigned long rdsp(void) | |||
44 | struct __xchg_dummy { unsigned long a[100]; }; | 44 | struct __xchg_dummy { unsigned long a[100]; }; |
45 | #define __xg(x) ((struct __xchg_dummy *)(x)) | 45 | #define __xg(x) ((struct __xchg_dummy *)(x)) |
46 | 46 | ||
47 | /* Used for interrupt control. */ | ||
48 | #define local_save_flags(x) \ | ||
49 | __asm__ __volatile__ ("move $ccs, %0" : "=rm" (x) : : "memory"); | ||
50 | |||
51 | #define local_irq_restore(x) \ | ||
52 | __asm__ __volatile__ ("move %0, $ccs" : : "rm" (x) : "memory"); | ||
53 | |||
54 | #define local_irq_disable() __asm__ __volatile__ ("di" : : : "memory"); | ||
55 | #define local_irq_enable() __asm__ __volatile__ ("ei" : : : "memory"); | ||
56 | |||
57 | #define irqs_disabled() \ | ||
58 | ({ \ | ||
59 | unsigned long flags; \ | ||
60 | \ | ||
61 | local_save_flags(flags);\ | ||
62 | !(flags & (1 << I_CCS_BITNR)); \ | ||
63 | }) | ||
64 | |||
65 | /* Used for spinlocks, etc. */ | ||
66 | #define local_irq_save(x) \ | ||
67 | __asm__ __volatile__ ("move $ccs, %0\n\tdi" : "=rm" (x) : : "memory"); | ||
68 | |||
69 | #endif /* _ASM_CRIS_ARCH_SYSTEM_H */ | 47 | #endif /* _ASM_CRIS_ARCH_SYSTEM_H */ |
diff --git a/arch/cris/include/asm/irqflags.h b/arch/cris/include/asm/irqflags.h new file mode 100644 index 000000000000..943ba5ca6d2c --- /dev/null +++ b/arch/cris/include/asm/irqflags.h | |||
@@ -0,0 +1 @@ | |||
#include <arch/irqflags.h> | |||
diff --git a/arch/cris/include/asm/system.h b/arch/cris/include/asm/system.h index 8657b084a922..ea10592f7d75 100644 --- a/arch/cris/include/asm/system.h +++ b/arch/cris/include/asm/system.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef __ASM_CRIS_SYSTEM_H | 1 | #ifndef __ASM_CRIS_SYSTEM_H |
2 | #define __ASM_CRIS_SYSTEM_H | 2 | #define __ASM_CRIS_SYSTEM_H |
3 | 3 | ||
4 | #include <linux/irqflags.h> | ||
4 | #include <arch/system.h> | 5 | #include <arch/system.h> |
5 | 6 | ||
6 | /* the switch_to macro calls resume, an asm function in entry.S which does the actual | 7 | /* the switch_to macro calls resume, an asm function in entry.S which does the actual |
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c index 195ec5fa0dd2..b82e08615d1b 100644 --- a/arch/cris/kernel/profile.c +++ b/arch/cris/kernel/profile.c | |||
@@ -59,6 +59,7 @@ write_cris_profile(struct file *file, const char __user *buf, | |||
59 | static const struct file_operations cris_proc_profile_operations = { | 59 | static const struct file_operations cris_proc_profile_operations = { |
60 | .read = read_cris_profile, | 60 | .read = read_cris_profile, |
61 | .write = write_cris_profile, | 61 | .write = write_cris_profile, |
62 | .llseek = default_llseek, | ||
62 | }; | 63 | }; |
63 | 64 | ||
64 | static int __init init_cris_profile(void) | 65 | static int __init init_cris_profile(void) |