diff options
author | Richard Weinberger <richard@nod.at> | 2012-04-17 16:37:13 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2012-05-21 15:09:36 -0400 |
commit | fa7a0449e0ea6588f64c06a045ea8728280f3457 (patch) | |
tree | 3a309dc94896e03d55707f07813bc1b325a4ee75 | |
parent | 2b76ebaa728f8a3967c52aa189261c72fe56a6f1 (diff) |
um: Implement um_free_irq()
Instead of using chip->release() we can achieve the same
using a simple wrapper for free_irq().
We have already um_request_irq(), so um_free_irq() is the perfect
counterpart.
Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/um/drivers/chan_kern.c | 9 | ||||
-rw-r--r-- | arch/um/drivers/line.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/net_kern.c | 4 | ||||
-rw-r--r-- | arch/um/drivers/port_kern.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/xterm_kern.c | 2 | ||||
-rw-r--r-- | arch/um/include/shared/irq_kern.h | 2 | ||||
-rw-r--r-- | arch/um/kernel/irq.c | 7 |
7 files changed, 18 insertions, 10 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index ca4c7ebfd0aa..45e248c2f43c 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/tty_flip.h> | 8 | #include <linux/tty_flip.h> |
9 | #include "chan.h" | 9 | #include "chan.h" |
10 | #include "os.h" | 10 | #include "os.h" |
11 | #include "irq_kern.h" | ||
11 | 12 | ||
12 | #ifdef CONFIG_NOCONFIG_CHAN | 13 | #ifdef CONFIG_NOCONFIG_CHAN |
13 | static void *not_configged_init(char *str, int device, | 14 | static void *not_configged_init(char *str, int device, |
@@ -213,9 +214,9 @@ void free_irqs(void) | |||
213 | chan = list_entry(ele, struct chan, free_list); | 214 | chan = list_entry(ele, struct chan, free_list); |
214 | 215 | ||
215 | if (chan->input && chan->enabled) | 216 | if (chan->input && chan->enabled) |
216 | free_irq(chan->line->driver->read_irq, chan); | 217 | um_free_irq(chan->line->driver->read_irq, chan); |
217 | if (chan->output && chan->enabled) | 218 | if (chan->output && chan->enabled) |
218 | free_irq(chan->line->driver->write_irq, chan); | 219 | um_free_irq(chan->line->driver->write_irq, chan); |
219 | chan->enabled = 0; | 220 | chan->enabled = 0; |
220 | } | 221 | } |
221 | } | 222 | } |
@@ -234,9 +235,9 @@ static void close_one_chan(struct chan *chan, int delay_free_irq) | |||
234 | } | 235 | } |
235 | else { | 236 | else { |
236 | if (chan->input && chan->enabled) | 237 | if (chan->input && chan->enabled) |
237 | free_irq(chan->line->driver->read_irq, chan); | 238 | um_free_irq(chan->line->driver->read_irq, chan); |
238 | if (chan->output && chan->enabled) | 239 | if (chan->output && chan->enabled) |
239 | free_irq(chan->line->driver->write_irq, chan); | 240 | um_free_irq(chan->line->driver->write_irq, chan); |
240 | chan->enabled = 0; | 241 | chan->enabled = 0; |
241 | } | 242 | } |
242 | if (chan->ops->close != NULL) | 243 | if (chan->ops->close != NULL) |
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 4ab0d9c0911c..acfd0e0fd0c9 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -699,7 +699,7 @@ struct winch { | |||
699 | static void __free_winch(struct work_struct *work) | 699 | static void __free_winch(struct work_struct *work) |
700 | { | 700 | { |
701 | struct winch *winch = container_of(work, struct winch, work); | 701 | struct winch *winch = container_of(work, struct winch, work); |
702 | free_irq(WINCH_IRQ, winch); | 702 | um_free_irq(WINCH_IRQ, winch); |
703 | 703 | ||
704 | if (winch->pid != -1) | 704 | if (winch->pid != -1) |
705 | os_kill_process(winch->pid, 1); | 705 | os_kill_process(winch->pid, 1); |
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 95f4416e6d9f..0d60c5685c26 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -195,7 +195,7 @@ static int uml_net_close(struct net_device *dev) | |||
195 | 195 | ||
196 | netif_stop_queue(dev); | 196 | netif_stop_queue(dev); |
197 | 197 | ||
198 | free_irq(dev->irq, dev); | 198 | um_free_irq(dev->irq, dev); |
199 | if (lp->close != NULL) | 199 | if (lp->close != NULL) |
200 | (*lp->close)(lp->fd, &lp->user); | 200 | (*lp->close)(lp->fd, &lp->user); |
201 | lp->fd = -1; | 201 | lp->fd = -1; |
@@ -835,7 +835,7 @@ static void close_devices(void) | |||
835 | spin_lock(&opened_lock); | 835 | spin_lock(&opened_lock); |
836 | list_for_each(ele, &opened) { | 836 | list_for_each(ele, &opened) { |
837 | lp = list_entry(ele, struct uml_net_private, list); | 837 | lp = list_entry(ele, struct uml_net_private, list); |
838 | free_irq(lp->dev->irq, lp->dev); | 838 | um_free_irq(lp->dev->irq, lp->dev); |
839 | if ((lp->close != NULL) && (lp->fd >= 0)) | 839 | if ((lp->close != NULL) && (lp->fd >= 0)) |
840 | (*lp->close)(lp->fd, &lp->user); | 840 | (*lp->close)(lp->fd, &lp->user); |
841 | if (lp->remove != NULL) | 841 | if (lp->remove != NULL) |
diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index e31680e662a4..11866ffd45a9 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c | |||
@@ -254,7 +254,7 @@ int port_wait(void *data) | |||
254 | * connection. Then we loop here throwing out failed | 254 | * connection. Then we loop here throwing out failed |
255 | * connections until a good one is found. | 255 | * connections until a good one is found. |
256 | */ | 256 | */ |
257 | free_irq(TELNETD_IRQ, conn); | 257 | um_free_irq(TELNETD_IRQ, conn); |
258 | 258 | ||
259 | if (conn->fd >= 0) | 259 | if (conn->fd >= 0) |
260 | break; | 260 | break; |
diff --git a/arch/um/drivers/xterm_kern.c b/arch/um/drivers/xterm_kern.c index 8bd130f0bda3..b68bbe269e01 100644 --- a/arch/um/drivers/xterm_kern.c +++ b/arch/um/drivers/xterm_kern.c | |||
@@ -65,7 +65,7 @@ int xterm_fd(int socket, int *pid_out) | |||
65 | * isn't set) this will hang... */ | 65 | * isn't set) this will hang... */ |
66 | wait_for_completion(&data->ready); | 66 | wait_for_completion(&data->ready); |
67 | 67 | ||
68 | free_irq(XTERM_IRQ, data); | 68 | um_free_irq(XTERM_IRQ, data); |
69 | 69 | ||
70 | ret = data->new_fd; | 70 | ret = data->new_fd; |
71 | *pid_out = data->pid; | 71 | *pid_out = data->pid; |
diff --git a/arch/um/include/shared/irq_kern.h b/arch/um/include/shared/irq_kern.h index b05d22f3d84e..7a5bfa6291b8 100644 --- a/arch/um/include/shared/irq_kern.h +++ b/arch/um/include/shared/irq_kern.h | |||
@@ -13,6 +13,6 @@ extern int um_request_irq(unsigned int irq, int fd, int type, | |||
13 | irq_handler_t handler, | 13 | irq_handler_t handler, |
14 | unsigned long irqflags, const char * devname, | 14 | unsigned long irqflags, const char * devname, |
15 | void *dev_id); | 15 | void *dev_id); |
16 | 16 | void um_free_irq(unsigned int irq, void *dev); | |
17 | #endif | 17 | #endif |
18 | 18 | ||
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 71b8c947e5ef..47a09eea49ed 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
@@ -297,6 +297,13 @@ unsigned int do_IRQ(int irq, struct uml_pt_regs *regs) | |||
297 | return 1; | 297 | return 1; |
298 | } | 298 | } |
299 | 299 | ||
300 | void um_free_irq(unsigned int irq, void *dev) | ||
301 | { | ||
302 | free_irq_by_irq_and_dev(irq, dev); | ||
303 | free_irq(irq, dev); | ||
304 | } | ||
305 | EXPORT_SYMBOL(um_free_irq); | ||
306 | |||
300 | int um_request_irq(unsigned int irq, int fd, int type, | 307 | int um_request_irq(unsigned int irq, int fd, int type, |
301 | irq_handler_t handler, | 308 | irq_handler_t handler, |
302 | unsigned long irqflags, const char * devname, | 309 | unsigned long irqflags, const char * devname, |