diff options
-rw-r--r-- | drivers/dca/dca-sysfs.c | 15 | ||||
-rw-r--r-- | drivers/net/wan/x25_asy.c | 5 | ||||
-rw-r--r-- | fs/proc/base.c | 12 | ||||
-rw-r--r-- | include/asm-frv/atomic.h | 81 | ||||
-rw-r--r-- | include/asm-frv/bitops.h | 83 | ||||
-rw-r--r-- | include/asm-frv/system.h | 3 | ||||
-rw-r--r-- | include/asm-xtensa/unistd.h | 4 | ||||
-rw-r--r-- | include/linux/dca.h | 2 | ||||
-rw-r--r-- | lib/Makefile | 4 |
9 files changed, 103 insertions, 106 deletions
diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c index 24a263b6844c..011328faa5f2 100644 --- a/drivers/dca/dca-sysfs.c +++ b/drivers/dca/dca-sysfs.c | |||
@@ -12,10 +12,10 @@ static spinlock_t dca_idr_lock; | |||
12 | 12 | ||
13 | int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) | 13 | int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) |
14 | { | 14 | { |
15 | struct class_device *cd; | 15 | struct device *cd; |
16 | 16 | ||
17 | cd = class_device_create(dca_class, dca->cd, MKDEV(0, slot + 1), | 17 | cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), |
18 | dev, "requester%d", slot); | 18 | "requester%d", slot); |
19 | if (IS_ERR(cd)) | 19 | if (IS_ERR(cd)) |
20 | return PTR_ERR(cd); | 20 | return PTR_ERR(cd); |
21 | return 0; | 21 | return 0; |
@@ -23,12 +23,12 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) | |||
23 | 23 | ||
24 | void dca_sysfs_remove_req(struct dca_provider *dca, int slot) | 24 | void dca_sysfs_remove_req(struct dca_provider *dca, int slot) |
25 | { | 25 | { |
26 | class_device_destroy(dca_class, MKDEV(0, slot + 1)); | 26 | device_destroy(dca_class, MKDEV(0, slot + 1)); |
27 | } | 27 | } |
28 | 28 | ||
29 | int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) | 29 | int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) |
30 | { | 30 | { |
31 | struct class_device *cd; | 31 | struct device *cd; |
32 | int err = 0; | 32 | int err = 0; |
33 | 33 | ||
34 | idr_try_again: | 34 | idr_try_again: |
@@ -46,8 +46,7 @@ idr_try_again: | |||
46 | return err; | 46 | return err; |
47 | } | 47 | } |
48 | 48 | ||
49 | cd = class_device_create(dca_class, NULL, MKDEV(0, 0), | 49 | cd = device_create(dca_class, dev, MKDEV(0, 0), "dca%d", dca->id); |
50 | dev, "dca%d", dca->id); | ||
51 | if (IS_ERR(cd)) { | 50 | if (IS_ERR(cd)) { |
52 | spin_lock(&dca_idr_lock); | 51 | spin_lock(&dca_idr_lock); |
53 | idr_remove(&dca_idr, dca->id); | 52 | idr_remove(&dca_idr, dca->id); |
@@ -60,7 +59,7 @@ idr_try_again: | |||
60 | 59 | ||
61 | void dca_sysfs_remove_provider(struct dca_provider *dca) | 60 | void dca_sysfs_remove_provider(struct dca_provider *dca) |
62 | { | 61 | { |
63 | class_device_unregister(dca->cd); | 62 | device_unregister(dca->cd); |
64 | dca->cd = NULL; | 63 | dca->cd = NULL; |
65 | spin_lock(&dca_idr_lock); | 64 | spin_lock(&dca_idr_lock); |
66 | idr_remove(&dca_idr, dca->id); | 65 | idr_remove(&dca_idr, dca->id); |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 1e89d4de1bb7..5e2d763c6b5f 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -554,6 +554,7 @@ static void x25_asy_receive_buf(struct tty_struct *tty, const unsigned char *cp, | |||
554 | static int x25_asy_open_tty(struct tty_struct *tty) | 554 | static int x25_asy_open_tty(struct tty_struct *tty) |
555 | { | 555 | { |
556 | struct x25_asy *sl = (struct x25_asy *) tty->disc_data; | 556 | struct x25_asy *sl = (struct x25_asy *) tty->disc_data; |
557 | struct tty_ldisc *ld; | ||
557 | int err; | 558 | int err; |
558 | 559 | ||
559 | /* First make sure we're not already connected. */ | 560 | /* First make sure we're not already connected. */ |
@@ -572,9 +573,7 @@ static int x25_asy_open_tty(struct tty_struct *tty) | |||
572 | if (tty->driver->flush_buffer) { | 573 | if (tty->driver->flush_buffer) { |
573 | tty->driver->flush_buffer(tty); | 574 | tty->driver->flush_buffer(tty); |
574 | } | 575 | } |
575 | if (tty->ldisc.flush_buffer) { | 576 | tty_ldisc_flush(tty); |
576 | tty->ldisc.flush_buffer(tty); | ||
577 | } | ||
578 | 577 | ||
579 | /* Restore default settings */ | 578 | /* Restore default settings */ |
580 | sl->dev->type = ARPHRD_X25; | 579 | sl->dev->type = ARPHRD_X25; |
diff --git a/fs/proc/base.c b/fs/proc/base.c index a0c4ba6c6e57..7c6b4ec83cb7 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2102,22 +2102,22 @@ static int proc_self_readlink(struct dentry *dentry, char __user *buffer, | |||
2102 | int buflen) | 2102 | int buflen) |
2103 | { | 2103 | { |
2104 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; | 2104 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; |
2105 | pid_t pid = task_pid_nr_ns(current, ns); | 2105 | pid_t tgid = task_tgid_nr_ns(current, ns); |
2106 | char tmp[PROC_NUMBUF]; | 2106 | char tmp[PROC_NUMBUF]; |
2107 | if (!pid) | 2107 | if (!tgid) |
2108 | return -ENOENT; | 2108 | return -ENOENT; |
2109 | sprintf(tmp, "%d", pid); | 2109 | sprintf(tmp, "%d", tgid); |
2110 | return vfs_readlink(dentry,buffer,buflen,tmp); | 2110 | return vfs_readlink(dentry,buffer,buflen,tmp); |
2111 | } | 2111 | } |
2112 | 2112 | ||
2113 | static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) | 2113 | static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd) |
2114 | { | 2114 | { |
2115 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; | 2115 | struct pid_namespace *ns = dentry->d_sb->s_fs_info; |
2116 | pid_t pid = task_pid_nr_ns(current, ns); | 2116 | pid_t tgid = task_tgid_nr_ns(current, ns); |
2117 | char tmp[PROC_NUMBUF]; | 2117 | char tmp[PROC_NUMBUF]; |
2118 | if (!pid) | 2118 | if (!tgid) |
2119 | return ERR_PTR(-ENOENT); | 2119 | return ERR_PTR(-ENOENT); |
2120 | sprintf(tmp, "%d", pid); | 2120 | sprintf(tmp, "%d", task_tgid_nr_ns(current, ns)); |
2121 | return ERR_PTR(vfs_follow_link(nd,tmp)); | 2121 | return ERR_PTR(vfs_follow_link(nd,tmp)); |
2122 | } | 2122 | } |
2123 | 2123 | ||
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h index 6ec494a5bc5a..46d696b331e7 100644 --- a/include/asm-frv/atomic.h +++ b/include/asm-frv/atomic.h | |||
@@ -125,87 +125,6 @@ static inline void atomic_dec(atomic_t *v) | |||
125 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) | 125 | #define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) |
126 | #define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) | 126 | #define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) |
127 | 127 | ||
128 | #ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS | ||
129 | static inline | ||
130 | unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v) | ||
131 | { | ||
132 | unsigned long old, tmp; | ||
133 | |||
134 | asm volatile( | ||
135 | "0: \n" | ||
136 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
137 | " ckeq icc3,cc7 \n" | ||
138 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
139 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
140 | " and%I3 %1,%3,%2 \n" | ||
141 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
142 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
143 | " beq icc3,#0,0b \n" | ||
144 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
145 | : "NPr"(~mask) | ||
146 | : "memory", "cc7", "cc3", "icc3" | ||
147 | ); | ||
148 | |||
149 | return old; | ||
150 | } | ||
151 | |||
152 | static inline | ||
153 | unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v) | ||
154 | { | ||
155 | unsigned long old, tmp; | ||
156 | |||
157 | asm volatile( | ||
158 | "0: \n" | ||
159 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
160 | " ckeq icc3,cc7 \n" | ||
161 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
162 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
163 | " or%I3 %1,%3,%2 \n" | ||
164 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
165 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
166 | " beq icc3,#0,0b \n" | ||
167 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
168 | : "NPr"(mask) | ||
169 | : "memory", "cc7", "cc3", "icc3" | ||
170 | ); | ||
171 | |||
172 | return old; | ||
173 | } | ||
174 | |||
175 | static inline | ||
176 | unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v) | ||
177 | { | ||
178 | unsigned long old, tmp; | ||
179 | |||
180 | asm volatile( | ||
181 | "0: \n" | ||
182 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
183 | " ckeq icc3,cc7 \n" | ||
184 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
185 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
186 | " xor%I3 %1,%3,%2 \n" | ||
187 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
188 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
189 | " beq icc3,#0,0b \n" | ||
190 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
191 | : "NPr"(mask) | ||
192 | : "memory", "cc7", "cc3", "icc3" | ||
193 | ); | ||
194 | |||
195 | return old; | ||
196 | } | ||
197 | |||
198 | #else | ||
199 | |||
200 | extern unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v); | ||
201 | extern unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v); | ||
202 | extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v); | ||
203 | |||
204 | #endif | ||
205 | |||
206 | #define atomic_clear_mask(mask, v) atomic_test_and_ANDNOT_mask((mask), (v)) | ||
207 | #define atomic_set_mask(mask, v) atomic_test_and_OR_mask((mask), (v)) | ||
208 | |||
209 | /*****************************************************************************/ | 128 | /*****************************************************************************/ |
210 | /* | 129 | /* |
211 | * exchange value with memory | 130 | * exchange value with memory |
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h index 5f86b876b298..39456ba0ec17 100644 --- a/include/asm-frv/bitops.h +++ b/include/asm-frv/bitops.h | |||
@@ -16,8 +16,6 @@ | |||
16 | 16 | ||
17 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
18 | #include <asm/byteorder.h> | 18 | #include <asm/byteorder.h> |
19 | #include <asm/system.h> | ||
20 | #include <asm/atomic.h> | ||
21 | 19 | ||
22 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
23 | 21 | ||
@@ -33,6 +31,87 @@ | |||
33 | #define smp_mb__before_clear_bit() barrier() | 31 | #define smp_mb__before_clear_bit() barrier() |
34 | #define smp_mb__after_clear_bit() barrier() | 32 | #define smp_mb__after_clear_bit() barrier() |
35 | 33 | ||
34 | #ifndef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS | ||
35 | static inline | ||
36 | unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v) | ||
37 | { | ||
38 | unsigned long old, tmp; | ||
39 | |||
40 | asm volatile( | ||
41 | "0: \n" | ||
42 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
43 | " ckeq icc3,cc7 \n" | ||
44 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
45 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
46 | " and%I3 %1,%3,%2 \n" | ||
47 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
48 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
49 | " beq icc3,#0,0b \n" | ||
50 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
51 | : "NPr"(~mask) | ||
52 | : "memory", "cc7", "cc3", "icc3" | ||
53 | ); | ||
54 | |||
55 | return old; | ||
56 | } | ||
57 | |||
58 | static inline | ||
59 | unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v) | ||
60 | { | ||
61 | unsigned long old, tmp; | ||
62 | |||
63 | asm volatile( | ||
64 | "0: \n" | ||
65 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
66 | " ckeq icc3,cc7 \n" | ||
67 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
68 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
69 | " or%I3 %1,%3,%2 \n" | ||
70 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
71 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
72 | " beq icc3,#0,0b \n" | ||
73 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
74 | : "NPr"(mask) | ||
75 | : "memory", "cc7", "cc3", "icc3" | ||
76 | ); | ||
77 | |||
78 | return old; | ||
79 | } | ||
80 | |||
81 | static inline | ||
82 | unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v) | ||
83 | { | ||
84 | unsigned long old, tmp; | ||
85 | |||
86 | asm volatile( | ||
87 | "0: \n" | ||
88 | " orcc gr0,gr0,gr0,icc3 \n" /* set ICC3.Z */ | ||
89 | " ckeq icc3,cc7 \n" | ||
90 | " ld.p %M0,%1 \n" /* LD.P/ORCR are atomic */ | ||
91 | " orcr cc7,cc7,cc3 \n" /* set CC3 to true */ | ||
92 | " xor%I3 %1,%3,%2 \n" | ||
93 | " cst.p %2,%M0 ,cc3,#1 \n" /* if store happens... */ | ||
94 | " corcc gr29,gr29,gr0 ,cc3,#1 \n" /* ... clear ICC3.Z */ | ||
95 | " beq icc3,#0,0b \n" | ||
96 | : "+U"(*v), "=&r"(old), "=r"(tmp) | ||
97 | : "NPr"(mask) | ||
98 | : "memory", "cc7", "cc3", "icc3" | ||
99 | ); | ||
100 | |||
101 | return old; | ||
102 | } | ||
103 | |||
104 | #else | ||
105 | |||
106 | extern unsigned long atomic_test_and_ANDNOT_mask(unsigned long mask, volatile unsigned long *v); | ||
107 | extern unsigned long atomic_test_and_OR_mask(unsigned long mask, volatile unsigned long *v); | ||
108 | extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsigned long *v); | ||
109 | |||
110 | #endif | ||
111 | |||
112 | #define atomic_clear_mask(mask, v) atomic_test_and_ANDNOT_mask((mask), (v)) | ||
113 | #define atomic_set_mask(mask, v) atomic_test_and_OR_mask((mask), (v)) | ||
114 | |||
36 | static inline int test_and_clear_bit(int nr, volatile void *addr) | 115 | static inline int test_and_clear_bit(int nr, volatile void *addr) |
37 | { | 116 | { |
38 | volatile unsigned long *ptr = addr; | 117 | volatile unsigned long *ptr = addr; |
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index 59be5443a68f..b400cea81487 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <linux/kernel.h> | ||
17 | 18 | ||
18 | struct thread_struct; | 19 | struct thread_struct; |
19 | 20 | ||
@@ -276,7 +277,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr, | |||
276 | { | 277 | { |
277 | switch (size) { | 278 | switch (size) { |
278 | case 4: | 279 | case 4: |
279 | return cmpxchg(ptr, old, new); | 280 | return cmpxchg((unsigned long *)ptr, old, new); |
280 | default: | 281 | default: |
281 | return __cmpxchg_local_generic(ptr, old, new, size); | 282 | return __cmpxchg_local_generic(ptr, old, new, size); |
282 | } | 283 | } |
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h index 92968aabe34e..c092c8fbb2cf 100644 --- a/include/asm-xtensa/unistd.h +++ b/include/asm-xtensa/unistd.h | |||
@@ -677,8 +677,8 @@ __SYSCALL(303, sys_ni_syscall, 0) | |||
677 | 677 | ||
678 | #define __NR_signalfd 304 | 678 | #define __NR_signalfd 304 |
679 | __SYSCALL(304, sys_signalfd, 3) | 679 | __SYSCALL(304, sys_signalfd, 3) |
680 | #define __NR_timerfd 305 | 680 | /* 305 was __NR_timerfd */ |
681 | __SYSCALL(305, sys_timerfd, 4) | 681 | __SYSCALL(305, sys_ni_syscall, 0) |
682 | #define __NR_eventfd 306 | 682 | #define __NR_eventfd 306 |
683 | __SYSCALL(306, sys_eventfd, 1) | 683 | __SYSCALL(306, sys_eventfd, 1) |
684 | 684 | ||
diff --git a/include/linux/dca.h b/include/linux/dca.h index 83eaecc6f8ab..af61cd1f37e9 100644 --- a/include/linux/dca.h +++ b/include/linux/dca.h | |||
@@ -11,7 +11,7 @@ void dca_unregister_notify(struct notifier_block *nb); | |||
11 | 11 | ||
12 | struct dca_provider { | 12 | struct dca_provider { |
13 | struct dca_ops *ops; | 13 | struct dca_ops *ops; |
14 | struct class_device *cd; | 14 | struct device *cd; |
15 | int id; | 15 | int id; |
16 | }; | 16 | }; |
17 | 17 | ||
diff --git a/lib/Makefile b/lib/Makefile index a18062e4633f..23de261a4c83 100644 --- a/lib/Makefile +++ b/lib/Makefile | |||
@@ -6,7 +6,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ | |||
6 | rbtree.o radix-tree.o dump_stack.o \ | 6 | rbtree.o radix-tree.o dump_stack.o \ |
7 | idr.o int_sqrt.o extable.o prio_tree.o \ | 7 | idr.o int_sqrt.o extable.o prio_tree.o \ |
8 | sha1.o irq_regs.o reciprocal_div.o argv_split.o \ | 8 | sha1.o irq_regs.o reciprocal_div.o argv_split.o \ |
9 | proportions.o prio_heap.o scatterlist.o | 9 | proportions.o prio_heap.o |
10 | 10 | ||
11 | lib-$(CONFIG_MMU) += ioremap.o | 11 | lib-$(CONFIG_MMU) += ioremap.o |
12 | lib-$(CONFIG_SMP) += cpumask.o | 12 | lib-$(CONFIG_SMP) += cpumask.o |
@@ -14,7 +14,7 @@ lib-$(CONFIG_SMP) += cpumask.o | |||
14 | lib-y += kobject.o kref.o klist.o | 14 | lib-y += kobject.o kref.o klist.o |
15 | 15 | ||
16 | obj-y += div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ | 16 | obj-y += div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ |
17 | bust_spinlocks.o hexdump.o kasprintf.o bitmap.o | 17 | bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o |
18 | 18 | ||
19 | ifeq ($(CONFIG_DEBUG_KOBJECT),y) | 19 | ifeq ($(CONFIG_DEBUG_KOBJECT),y) |
20 | CFLAGS_kobject.o += -DDEBUG | 20 | CFLAGS_kobject.o += -DDEBUG |