ia64/xen-unstable

changeset 9600:a151e82c4ffd

Remove unused teardown_irq() definition. Removes two files from sparse tree.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Apr 06 09:22:00 2006 +0100 (2006-04-06)
parents ece9b5710b29
children bbd1057d38f0
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/linux/irq.h	Thu Apr 06 00:59:18 2006 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,244 +0,0 @@
     1.4 -#ifndef __irq_h
     1.5 -#define __irq_h
     1.6 -
     1.7 -/*
     1.8 - * Please do not include this file in generic code.  There is currently
     1.9 - * no requirement for any architecture to implement anything held
    1.10 - * within this file.
    1.11 - *
    1.12 - * Thanks. --rmk
    1.13 - */
    1.14 -
    1.15 -#include <linux/config.h>
    1.16 -#include <linux/smp.h>
    1.17 -
    1.18 -#if !defined(CONFIG_S390)
    1.19 -
    1.20 -#include <linux/linkage.h>
    1.21 -#include <linux/cache.h>
    1.22 -#include <linux/spinlock.h>
    1.23 -#include <linux/cpumask.h>
    1.24 -
    1.25 -#include <asm/irq.h>
    1.26 -#include <asm/ptrace.h>
    1.27 -
    1.28 -/*
    1.29 - * IRQ line status.
    1.30 - */
    1.31 -#define IRQ_INPROGRESS	1	/* IRQ handler active - do not enter! */
    1.32 -#define IRQ_DISABLED	2	/* IRQ disabled - do not enter! */
    1.33 -#define IRQ_PENDING	4	/* IRQ pending - replay on enable */
    1.34 -#define IRQ_REPLAY	8	/* IRQ has been replayed but not acked yet */
    1.35 -#define IRQ_AUTODETECT	16	/* IRQ is being autodetected */
    1.36 -#define IRQ_WAITING	32	/* IRQ not yet seen - for autodetection */
    1.37 -#define IRQ_LEVEL	64	/* IRQ level triggered */
    1.38 -#define IRQ_MASKED	128	/* IRQ masked - shouldn't be seen again */
    1.39 -#if defined(ARCH_HAS_IRQ_PER_CPU)
    1.40 -# define IRQ_PER_CPU	256	/* IRQ is per CPU */
    1.41 -# define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
    1.42 -#else
    1.43 -# define CHECK_IRQ_PER_CPU(var) 0
    1.44 -#endif
    1.45 -
    1.46 -/*
    1.47 - * Interrupt controller descriptor. This is all we need
    1.48 - * to describe about the low-level hardware. 
    1.49 - */
    1.50 -struct hw_interrupt_type {
    1.51 -	const char * typename;
    1.52 -	unsigned int (*startup)(unsigned int irq);
    1.53 -	void (*shutdown)(unsigned int irq);
    1.54 -	void (*enable)(unsigned int irq);
    1.55 -	void (*disable)(unsigned int irq);
    1.56 -	void (*ack)(unsigned int irq);
    1.57 -	void (*end)(unsigned int irq);
    1.58 -	void (*set_affinity)(unsigned int irq, cpumask_t dest);
    1.59 -	/* Currently used only by UML, might disappear one day.*/
    1.60 -#ifdef CONFIG_IRQ_RELEASE_METHOD
    1.61 -	void (*release)(unsigned int irq, void *dev_id);
    1.62 -#endif
    1.63 -};
    1.64 -
    1.65 -typedef struct hw_interrupt_type  hw_irq_controller;
    1.66 -
    1.67 -/*
    1.68 - * This is the "IRQ descriptor", which contains various information
    1.69 - * about the irq, including what kind of hardware handling it has,
    1.70 - * whether it is disabled etc etc.
    1.71 - *
    1.72 - * Pad this out to 32 bytes for cache and indexing reasons.
    1.73 - */
    1.74 -typedef struct irq_desc {
    1.75 -	hw_irq_controller *handler;
    1.76 -	void *handler_data;
    1.77 -	struct irqaction *action;	/* IRQ action list */
    1.78 -	unsigned int status;		/* IRQ status */
    1.79 -	unsigned int depth;		/* nested irq disables */
    1.80 -	unsigned int irq_count;		/* For detecting broken interrupts */
    1.81 -	unsigned int irqs_unhandled;
    1.82 -	spinlock_t lock;
    1.83 -#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
    1.84 -	unsigned int move_irq;		/* Flag need to re-target intr dest*/
    1.85 -#endif
    1.86 -} ____cacheline_aligned irq_desc_t;
    1.87 -
    1.88 -extern irq_desc_t irq_desc [NR_IRQS];
    1.89 -
    1.90 -/* Return a pointer to the irq descriptor for IRQ.  */
    1.91 -static inline irq_desc_t *
    1.92 -irq_descp (int irq)
    1.93 -{
    1.94 -	return irq_desc + irq;
    1.95 -}
    1.96 -
    1.97 -#include <asm/hw_irq.h> /* the arch dependent stuff */
    1.98 -
    1.99 -extern int setup_irq(unsigned int irq, struct irqaction * new);
   1.100 -#ifdef CONFIG_XEN
   1.101 -extern int teardown_irq(unsigned int irq, struct irqaction * old);
   1.102 -#endif
   1.103 -
   1.104 -#ifdef CONFIG_GENERIC_HARDIRQS
   1.105 -extern cpumask_t irq_affinity[NR_IRQS];
   1.106 -
   1.107 -#ifdef CONFIG_SMP
   1.108 -static inline void set_native_irq_info(int irq, cpumask_t mask)
   1.109 -{
   1.110 -	irq_affinity[irq] = mask;
   1.111 -}
   1.112 -#else
   1.113 -static inline void set_native_irq_info(int irq, cpumask_t mask)
   1.114 -{
   1.115 -}
   1.116 -#endif
   1.117 -
   1.118 -#ifdef CONFIG_SMP
   1.119 -
   1.120 -#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
   1.121 -extern cpumask_t pending_irq_cpumask[NR_IRQS];
   1.122 -
   1.123 -static inline void set_pending_irq(unsigned int irq, cpumask_t mask)
   1.124 -{
   1.125 -	irq_desc_t *desc = irq_desc + irq;
   1.126 -	unsigned long flags;
   1.127 -
   1.128 -	spin_lock_irqsave(&desc->lock, flags);
   1.129 -	desc->move_irq = 1;
   1.130 -	pending_irq_cpumask[irq] = mask;
   1.131 -	spin_unlock_irqrestore(&desc->lock, flags);
   1.132 -}
   1.133 -
   1.134 -static inline void
   1.135 -move_native_irq(int irq)
   1.136 -{
   1.137 -	cpumask_t tmp;
   1.138 -	irq_desc_t *desc = irq_descp(irq);
   1.139 -
   1.140 -	if (likely (!desc->move_irq))
   1.141 -		return;
   1.142 -
   1.143 -	desc->move_irq = 0;
   1.144 -
   1.145 -	if (likely(cpus_empty(pending_irq_cpumask[irq])))
   1.146 -		return;
   1.147 -
   1.148 -	if (!desc->handler->set_affinity)
   1.149 -		return;
   1.150 -
   1.151 -	/* note - we hold the desc->lock */
   1.152 -	cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map);
   1.153 -
   1.154 -	/*
   1.155 -	 * If there was a valid mask to work with, please
   1.156 -	 * do the disable, re-program, enable sequence.
   1.157 -	 * This is *not* particularly important for level triggered
   1.158 -	 * but in a edge trigger case, we might be setting rte
   1.159 -	 * when an active trigger is comming in. This could
   1.160 -	 * cause some ioapics to mal-function.
   1.161 -	 * Being paranoid i guess!
   1.162 -	 */
   1.163 -	if (unlikely(!cpus_empty(tmp))) {
   1.164 -		desc->handler->disable(irq);
   1.165 -		desc->handler->set_affinity(irq,tmp);
   1.166 -		desc->handler->enable(irq);
   1.167 -	}
   1.168 -	cpus_clear(pending_irq_cpumask[irq]);
   1.169 -}
   1.170 -
   1.171 -#ifdef CONFIG_PCI_MSI
   1.172 -/*
   1.173 - * Wonder why these are dummies?
   1.174 - * For e.g the set_ioapic_affinity_vector() calls the set_ioapic_affinity_irq()
   1.175 - * counter part after translating the vector to irq info. We need to perform
   1.176 - * this operation on the real irq, when we dont use vector, i.e when
   1.177 - * pci_use_vector() is false.
   1.178 - */
   1.179 -static inline void move_irq(int irq)
   1.180 -{
   1.181 -}
   1.182 -
   1.183 -static inline void set_irq_info(int irq, cpumask_t mask)
   1.184 -{
   1.185 -}
   1.186 -
   1.187 -#else // CONFIG_PCI_MSI
   1.188 -
   1.189 -static inline void move_irq(int irq)
   1.190 -{
   1.191 -	move_native_irq(irq);
   1.192 -}
   1.193 -
   1.194 -static inline void set_irq_info(int irq, cpumask_t mask)
   1.195 -{
   1.196 -	set_native_irq_info(irq, mask);
   1.197 -}
   1.198 -#endif // CONFIG_PCI_MSI
   1.199 -
   1.200 -#else	// CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE
   1.201 -
   1.202 -#define move_irq(x)
   1.203 -#define move_native_irq(x)
   1.204 -#define set_pending_irq(x,y)
   1.205 -static inline void set_irq_info(int irq, cpumask_t mask)
   1.206 -{
   1.207 -	set_native_irq_info(irq, mask);
   1.208 -}
   1.209 -
   1.210 -#endif // CONFIG_GENERIC_PENDING_IRQ
   1.211 -
   1.212 -#else // CONFIG_SMP
   1.213 -
   1.214 -#define move_irq(x)
   1.215 -#define move_native_irq(x)
   1.216 -
   1.217 -#endif // CONFIG_SMP
   1.218 -
   1.219 -extern int no_irq_affinity;
   1.220 -extern int noirqdebug_setup(char *str);
   1.221 -
   1.222 -extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
   1.223 -					struct irqaction *action);
   1.224 -extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
   1.225 -extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
   1.226 -					int action_ret, struct pt_regs *regs);
   1.227 -extern int can_request_irq(unsigned int irq, unsigned long irqflags);
   1.228 -
   1.229 -extern void init_irq_proc(void);
   1.230 -
   1.231 -#ifdef CONFIG_AUTO_IRQ_AFFINITY
   1.232 -extern int select_smp_affinity(unsigned int irq);
   1.233 -#else
   1.234 -static inline int
   1.235 -select_smp_affinity(unsigned int irq)
   1.236 -{
   1.237 -	return 1;
   1.238 -}
   1.239 -#endif
   1.240 -
   1.241 -#endif
   1.242 -
   1.243 -extern hw_irq_controller no_irq_type;  /* needed in every arch ? */
   1.244 -
   1.245 -#endif
   1.246 -
   1.247 -#endif /* __irq_h */
     2.1 --- a/linux-2.6-xen-sparse/kernel/irq/manage.c	Thu Apr 06 00:59:18 2006 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,425 +0,0 @@
     2.4 -/*
     2.5 - * linux/kernel/irq/manage.c
     2.6 - *
     2.7 - * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar
     2.8 - *
     2.9 - * This file contains driver APIs to the irq subsystem.
    2.10 - */
    2.11 -
    2.12 -#include <linux/config.h>
    2.13 -#include <linux/irq.h>
    2.14 -#include <linux/module.h>
    2.15 -#include <linux/random.h>
    2.16 -#include <linux/interrupt.h>
    2.17 -
    2.18 -#include "internals.h"
    2.19 -
    2.20 -#ifdef CONFIG_SMP
    2.21 -
    2.22 -cpumask_t irq_affinity[NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL };
    2.23 -
    2.24 -#if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE)
    2.25 -cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS];
    2.26 -#endif
    2.27 -
    2.28 -/**
    2.29 - *	synchronize_irq - wait for pending IRQ handlers (on other CPUs)
    2.30 - *	@irq: interrupt number to wait for
    2.31 - *
    2.32 - *	This function waits for any pending IRQ handlers for this interrupt
    2.33 - *	to complete before returning. If you use this function while
    2.34 - *	holding a resource the IRQ handler may need you will deadlock.
    2.35 - *
    2.36 - *	This function may be called - with care - from IRQ context.
    2.37 - */
    2.38 -void synchronize_irq(unsigned int irq)
    2.39 -{
    2.40 -	struct irq_desc *desc = irq_desc + irq;
    2.41 -
    2.42 -	if (irq >= NR_IRQS)
    2.43 -		return;
    2.44 -
    2.45 -	while (desc->status & IRQ_INPROGRESS)
    2.46 -		cpu_relax();
    2.47 -}
    2.48 -
    2.49 -EXPORT_SYMBOL(synchronize_irq);
    2.50 -
    2.51 -#endif
    2.52 -
    2.53 -/**
    2.54 - *	disable_irq_nosync - disable an irq without waiting
    2.55 - *	@irq: Interrupt to disable
    2.56 - *
    2.57 - *	Disable the selected interrupt line.  Disables and Enables are
    2.58 - *	nested.
    2.59 - *	Unlike disable_irq(), this function does not ensure existing
    2.60 - *	instances of the IRQ handler have completed before returning.
    2.61 - *
    2.62 - *	This function may be called from IRQ context.
    2.63 - */
    2.64 -void disable_irq_nosync(unsigned int irq)
    2.65 -{
    2.66 -	irq_desc_t *desc = irq_desc + irq;
    2.67 -	unsigned long flags;
    2.68 -
    2.69 -	if (irq >= NR_IRQS)
    2.70 -		return;
    2.71 -
    2.72 -	spin_lock_irqsave(&desc->lock, flags);
    2.73 -	if (!desc->depth++) {
    2.74 -		desc->status |= IRQ_DISABLED;
    2.75 -		desc->handler->disable(irq);
    2.76 -	}
    2.77 -	spin_unlock_irqrestore(&desc->lock, flags);
    2.78 -}
    2.79 -
    2.80 -EXPORT_SYMBOL(disable_irq_nosync);
    2.81 -
    2.82 -/**
    2.83 - *	disable_irq - disable an irq and wait for completion
    2.84 - *	@irq: Interrupt to disable
    2.85 - *
    2.86 - *	Disable the selected interrupt line.  Enables and Disables are
    2.87 - *	nested.
    2.88 - *	This function waits for any pending IRQ handlers for this interrupt
    2.89 - *	to complete before returning. If you use this function while
    2.90 - *	holding a resource the IRQ handler may need you will deadlock.
    2.91 - *
    2.92 - *	This function may be called - with care - from IRQ context.
    2.93 - */
    2.94 -void disable_irq(unsigned int irq)
    2.95 -{
    2.96 -	irq_desc_t *desc = irq_desc + irq;
    2.97 -
    2.98 -	if (irq >= NR_IRQS)
    2.99 -		return;
   2.100 -
   2.101 -	disable_irq_nosync(irq);
   2.102 -	if (desc->action)
   2.103 -		synchronize_irq(irq);
   2.104 -}
   2.105 -
   2.106 -EXPORT_SYMBOL(disable_irq);
   2.107 -
   2.108 -/**
   2.109 - *	enable_irq - enable handling of an irq
   2.110 - *	@irq: Interrupt to enable
   2.111 - *
   2.112 - *	Undoes the effect of one call to disable_irq().  If this
   2.113 - *	matches the last disable, processing of interrupts on this
   2.114 - *	IRQ line is re-enabled.
   2.115 - *
   2.116 - *	This function may be called from IRQ context.
   2.117 - */
   2.118 -void enable_irq(unsigned int irq)
   2.119 -{
   2.120 -	irq_desc_t *desc = irq_desc + irq;
   2.121 -	unsigned long flags;
   2.122 -
   2.123 -	if (irq >= NR_IRQS)
   2.124 -		return;
   2.125 -
   2.126 -	spin_lock_irqsave(&desc->lock, flags);
   2.127 -	switch (desc->depth) {
   2.128 -	case 0:
   2.129 -		WARN_ON(1);
   2.130 -		break;
   2.131 -	case 1: {
   2.132 -		unsigned int status = desc->status & ~IRQ_DISABLED;
   2.133 -
   2.134 -		desc->status = status;
   2.135 -		if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
   2.136 -			desc->status = status | IRQ_REPLAY;
   2.137 -			hw_resend_irq(desc->handler,irq);
   2.138 -		}
   2.139 -		desc->handler->enable(irq);
   2.140 -		/* fall-through */
   2.141 -	}
   2.142 -	default:
   2.143 -		desc->depth--;
   2.144 -	}
   2.145 -	spin_unlock_irqrestore(&desc->lock, flags);
   2.146 -}
   2.147 -
   2.148 -EXPORT_SYMBOL(enable_irq);
   2.149 -
   2.150 -/*
   2.151 - * Internal function that tells the architecture code whether a
   2.152 - * particular irq has been exclusively allocated or is available
   2.153 - * for driver use.
   2.154 - */
   2.155 -int can_request_irq(unsigned int irq, unsigned long irqflags)
   2.156 -{
   2.157 -	struct irqaction *action;
   2.158 -
   2.159 -	if (irq >= NR_IRQS)
   2.160 -		return 0;
   2.161 -
   2.162 -	action = irq_desc[irq].action;
   2.163 -	if (action)
   2.164 -		if (irqflags & action->flags & SA_SHIRQ)
   2.165 -			action = NULL;
   2.166 -
   2.167 -	return !action;
   2.168 -}
   2.169 -
   2.170 -/**
   2.171 - *	setup_irq - register an irqaction structure
   2.172 - *	@irq: Interrupt to register
   2.173 - *	@irqaction: The irqaction structure to be registered
   2.174 - *
   2.175 - *	Normally called by request_irq, this function can be used
   2.176 - *	directly to allocate special interrupts that are part of the
   2.177 - *	architecture.
   2.178 - */
   2.179 -int setup_irq(unsigned int irq, struct irqaction * new)
   2.180 -{
   2.181 -	struct irq_desc *desc = irq_desc + irq;
   2.182 -	struct irqaction *old, **p;
   2.183 -	unsigned long flags;
   2.184 -	int shared = 0;
   2.185 -
   2.186 -	if (irq >= NR_IRQS)
   2.187 -		return -EINVAL;
   2.188 -
   2.189 -	if (desc->handler == &no_irq_type)
   2.190 -		return -ENOSYS;
   2.191 -	/*
   2.192 -	 * Some drivers like serial.c use request_irq() heavily,
   2.193 -	 * so we have to be careful not to interfere with a
   2.194 -	 * running system.
   2.195 -	 */
   2.196 -	if (new->flags & SA_SAMPLE_RANDOM) {
   2.197 -		/*
   2.198 -		 * This function might sleep, we want to call it first,
   2.199 -		 * outside of the atomic block.
   2.200 -		 * Yes, this might clear the entropy pool if the wrong
   2.201 -		 * driver is attempted to be loaded, without actually
   2.202 -		 * installing a new handler, but is this really a problem,
   2.203 -		 * only the sysadmin is able to do this.
   2.204 -		 */
   2.205 -		rand_initialize_irq(irq);
   2.206 -	}
   2.207 -
   2.208 -	/*
   2.209 -	 * The following block of code has to be executed atomically
   2.210 -	 */
   2.211 -	spin_lock_irqsave(&desc->lock,flags);
   2.212 -	p = &desc->action;
   2.213 -	if ((old = *p) != NULL) {
   2.214 -		/* Can't share interrupts unless both agree to */
   2.215 -		if (!(old->flags & new->flags & SA_SHIRQ)) {
   2.216 -			spin_unlock_irqrestore(&desc->lock,flags);
   2.217 -			return -EBUSY;
   2.218 -		}
   2.219 -
   2.220 -		/* add new interrupt at end of irq queue */
   2.221 -		do {
   2.222 -			p = &old->next;
   2.223 -			old = *p;
   2.224 -		} while (old);
   2.225 -		shared = 1;
   2.226 -	}
   2.227 -
   2.228 -	*p = new;
   2.229 -
   2.230 -	if (!shared) {
   2.231 -		desc->depth = 0;
   2.232 -		desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT |
   2.233 -				  IRQ_WAITING | IRQ_INPROGRESS);
   2.234 -		if (desc->handler->startup)
   2.235 -			desc->handler->startup(irq);
   2.236 -		else
   2.237 -			desc->handler->enable(irq);
   2.238 -	}
   2.239 -	spin_unlock_irqrestore(&desc->lock,flags);
   2.240 -
   2.241 -	new->irq = irq;
   2.242 -	register_irq_proc(irq);
   2.243 -	new->dir = NULL;
   2.244 -	register_handler_proc(irq, new);
   2.245 -
   2.246 -	return 0;
   2.247 -}
   2.248 -
   2.249 -/*
   2.250 - *	teardown_irq - unregister an irqaction
   2.251 - *	@irq: Interrupt line being freed
   2.252 - *	@old: Pointer to the irqaction that is to be unregistered
   2.253 - *
   2.254 - *	This function is called by free_irq and does the actual
   2.255 - *	business of unregistering the handler. It exists as a 
   2.256 - *	seperate function to enable handlers to be unregistered 
   2.257 - *	for irqactions that have been allocated statically at 
   2.258 - *	boot time.
   2.259 - *
   2.260 - *	This function must not be called from interrupt context.
   2.261 - */
   2.262 -#ifndef CONFIG_XEN
   2.263 -static
   2.264 -#endif
   2.265 -int teardown_irq(unsigned int irq, struct irqaction * old)
   2.266 -{
   2.267 -	struct irq_desc *desc;
   2.268 -	struct irqaction **p;
   2.269 -	unsigned long flags;
   2.270 -
   2.271 -	if (irq >= NR_IRQS)
   2.272 -		return -ENOENT;
   2.273 -
   2.274 -	desc = irq_desc + irq;
   2.275 -	spin_lock_irqsave(&desc->lock,flags);
   2.276 -	p = &desc->action;
   2.277 -	for (;;) {
   2.278 -		struct irqaction * action = *p;
   2.279 -
   2.280 -		if (action) {
   2.281 -			struct irqaction **pp = p;
   2.282 -
   2.283 -			p = &action->next;
   2.284 -			if (action != old)
   2.285 -				continue;
   2.286 -
   2.287 -			/* Found it - now remove it from the list of entries */
   2.288 -			*pp = action->next;
   2.289 -
   2.290 -			/* Currently used only by UML, might disappear one day.*/
   2.291 -#ifdef CONFIG_IRQ_RELEASE_METHOD
   2.292 -			if (desc->handler->release)
   2.293 -				desc->handler->release(irq, dev_id);
   2.294 -#endif
   2.295 -
   2.296 -			if (!desc->action) {
   2.297 -				desc->status |= IRQ_DISABLED;
   2.298 -				if (desc->handler->shutdown)
   2.299 -					desc->handler->shutdown(irq);
   2.300 -				else
   2.301 -					desc->handler->disable(irq);
   2.302 -			}
   2.303 -			spin_unlock_irqrestore(&desc->lock,flags);
   2.304 -			unregister_handler_proc(irq, action);
   2.305 -
   2.306 -			/* Make sure it's not being used on another CPU */
   2.307 -			synchronize_irq(irq);
   2.308 -			return 0;
   2.309 -		}
   2.310 -		printk(KERN_ERR "Trying to teardown free IRQ%d\n",irq);
   2.311 -		spin_unlock_irqrestore(&desc->lock,flags);
   2.312 -		return -ENOENT;
   2.313 -	}
   2.314 -}
   2.315 -
   2.316 -/**
   2.317 - *	free_irq - free an interrupt
   2.318 - *	@irq: Interrupt line to free
   2.319 - *	@dev_id: Device identity to free
   2.320 - *
   2.321 - *	Remove an interrupt handler. The handler is removed and if the
   2.322 - *	interrupt line is no longer in use by any driver it is disabled.
   2.323 - *	On a shared IRQ the caller must ensure the interrupt is disabled
   2.324 - *	on the card it drives before calling this function. The function
   2.325 - *	does not return until any executing interrupts for this IRQ
   2.326 - *	have completed.
   2.327 - *
   2.328 - *	This function must not be called from interrupt context.
   2.329 - */
   2.330 -void free_irq(unsigned int irq, void *dev_id)
   2.331 -{
   2.332 -	struct irq_desc *desc;
   2.333 -	struct irqaction *action;
   2.334 -	unsigned long flags;
   2.335 -
   2.336 -	if (irq >= NR_IRQS)
   2.337 -		return;
   2.338 -
   2.339 -	desc = irq_desc + irq;
   2.340 -	spin_lock_irqsave(&desc->lock,flags);
   2.341 -	for (action = desc->action; action != NULL; action = action->next) {
   2.342 -		if (action->dev_id != dev_id)
   2.343 -			continue;
   2.344 -
   2.345 -		spin_unlock_irqrestore(&desc->lock,flags);
   2.346 -
   2.347 -		if (teardown_irq(irq, action) == 0)
   2.348 -			kfree(action);
   2.349 -		return;
   2.350 -	}
   2.351 -	printk(KERN_ERR "Trying to free free IRQ%d\n",irq);
   2.352 -	spin_unlock_irqrestore(&desc->lock,flags);
   2.353 -	return;
   2.354 -}
   2.355 -
   2.356 -EXPORT_SYMBOL(free_irq);
   2.357 -
   2.358 -/**
   2.359 - *	request_irq - allocate an interrupt line
   2.360 - *	@irq: Interrupt line to allocate
   2.361 - *	@handler: Function to be called when the IRQ occurs
   2.362 - *	@irqflags: Interrupt type flags
   2.363 - *	@devname: An ascii name for the claiming device
   2.364 - *	@dev_id: A cookie passed back to the handler function
   2.365 - *
   2.366 - *	This call allocates interrupt resources and enables the
   2.367 - *	interrupt line and IRQ handling. From the point this
   2.368 - *	call is made your handler function may be invoked. Since
   2.369 - *	your handler function must clear any interrupt the board
   2.370 - *	raises, you must take care both to initialise your hardware
   2.371 - *	and to set up the interrupt handler in the right order.
   2.372 - *
   2.373 - *	Dev_id must be globally unique. Normally the address of the
   2.374 - *	device data structure is used as the cookie. Since the handler
   2.375 - *	receives this value it makes sense to use it.
   2.376 - *
   2.377 - *	If your interrupt is shared you must pass a non NULL dev_id
   2.378 - *	as this is required when freeing the interrupt.
   2.379 - *
   2.380 - *	Flags:
   2.381 - *
   2.382 - *	SA_SHIRQ		Interrupt is shared
   2.383 - *	SA_INTERRUPT		Disable local interrupts while processing
   2.384 - *	SA_SAMPLE_RANDOM	The interrupt can be used for entropy
   2.385 - *
   2.386 - */
   2.387 -int request_irq(unsigned int irq,
   2.388 -		irqreturn_t (*handler)(int, void *, struct pt_regs *),
   2.389 -		unsigned long irqflags, const char * devname, void *dev_id)
   2.390 -{
   2.391 -	struct irqaction * action;
   2.392 -	int retval;
   2.393 -
   2.394 -	/*
   2.395 -	 * Sanity-check: shared interrupts must pass in a real dev-ID,
   2.396 -	 * otherwise we'll have trouble later trying to figure out
   2.397 -	 * which interrupt is which (messes up the interrupt freeing
   2.398 -	 * logic etc).
   2.399 -	 */
   2.400 -	if ((irqflags & SA_SHIRQ) && !dev_id)
   2.401 -		return -EINVAL;
   2.402 -	if (irq >= NR_IRQS)
   2.403 -		return -EINVAL;
   2.404 -	if (!handler)
   2.405 -		return -EINVAL;
   2.406 -
   2.407 -	action = kmalloc(sizeof(struct irqaction), GFP_ATOMIC);
   2.408 -	if (!action)
   2.409 -		return -ENOMEM;
   2.410 -
   2.411 -	action->handler = handler;
   2.412 -	action->flags = irqflags;
   2.413 -	cpus_clear(action->mask);
   2.414 -	action->name = devname;
   2.415 -	action->next = NULL;
   2.416 -	action->dev_id = dev_id;
   2.417 -
   2.418 -	select_smp_affinity(irq);
   2.419 -
   2.420 -	retval = setup_irq(irq, action);
   2.421 -	if (retval)
   2.422 -		kfree(action);
   2.423 -
   2.424 -	return retval;
   2.425 -}
   2.426 -
   2.427 -EXPORT_SYMBOL(request_irq);
   2.428 -