*/
void dynamic_irq_init(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- /* first time to use this irq_desc */
- desc = irq_to_desc(irq);
if (!desc) {
WARN(1, KERN_ERR "Trying to initialize invalid IRQ%d\n", irq);
return;
*/
void dynamic_irq_cleanup(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
WARN(1, KERN_ERR "Trying to cleanup invalid IRQ%d\n", irq);
return;
*/
int set_irq_chip(unsigned int irq, struct irq_chip *chip)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
WARN(1, KERN_ERR "Trying to install chip for IRQ%d\n", irq);
return -EINVAL;
*/
int set_irq_type(unsigned int irq, unsigned int type)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
int ret = -ENXIO;
- desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR "Trying to set irq type for IRQ%d\n", irq);
return -ENODEV;
*/
int set_irq_data(unsigned int irq, void *data)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install controller data for IRQ%d\n", irq);
*/
int set_irq_msi(unsigned int irq, struct msi_desc *entry)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install msi data for IRQ%d\n", irq);
*/
int set_irq_chip_data(unsigned int irq, void *data)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install chip data for IRQ%d\n", irq);
*/
static void default_enable(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
- desc = irq_to_desc(irq);
desc->chip->unmask(irq);
desc->status &= ~IRQ_MASKED;
}
*/
static unsigned int default_startup(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
- desc = irq_to_desc(irq);
desc->chip->enable(irq);
-
return 0;
}
*/
static void default_shutdown(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
- desc = irq_to_desc(irq);
desc->chip->mask(irq);
desc->status |= IRQ_MASKED;
}
__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
const char *name)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install type control for IRQ%d\n", irq);
void __init set_irq_noprobe(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
-
return;
}
void __init set_irq_probe(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
-
return;
}
*/
static void ack_bad(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
- desc = irq_to_desc(irq);
print_irq_desc(irq, desc);
ack_bad_irq(irq);
}
*/
void disable_irq_nosync(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc)
return;
*/
void disable_irq(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
- desc = irq_to_desc(irq);
if (!desc)
return;
*/
void enable_irq(unsigned int irq)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned long flags;
- desc = irq_to_desc(irq);
if (!desc)
return;
*/
int can_request_irq(unsigned int irq, unsigned long irqflags)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
struct irqaction *action;
- desc = irq_to_desc(irq);
if (!desc)
return 0;
* Internal function to register an irqaction - typically used to
* allocate special interrupts that are part of the architecture.
*/
-int setup_irq(unsigned int irq, struct irqaction *new)
+static int
+__setup_irq(unsigned int irq, struct irq_desc * desc, struct irqaction *new)
{
- struct irq_desc *desc;
struct irqaction *old, **p;
const char *old_name = NULL;
unsigned long flags;
int shared = 0;
int ret;
- desc = irq_to_desc(irq);
if (!desc)
return -EINVAL;
return -EBUSY;
}
+/**
+ * setup_irq - setup an interrupt
+ * @irq: Interrupt line to setup
+ * @act: irqaction for the interrupt
+ *
+ * Used to statically setup interrupts in the early boot process.
+ */
+int setup_irq(unsigned int irq, struct irqaction *act)
+{
+ struct irq_desc *desc = irq_to_desc(irq);
+
+ return __setup_irq(irq, desc, act);
+}
+
/**
* free_irq - free an interrupt
* @irq: Interrupt line to free
*/
void free_irq(unsigned int irq, void *dev_id)
{
- struct irq_desc *desc;
+ struct irq_desc *desc = irq_to_desc(irq);
struct irqaction **p;
unsigned long flags;
WARN_ON(in_interrupt());
- desc = irq_to_desc(irq);
if (!desc)
return;
unsigned long irqflags, const char *devname, void *dev_id)
{
struct irqaction *action;
- int retval;
struct irq_desc *desc;
+ int retval;
#ifdef CONFIG_LOCKDEP
/*
action->next = NULL;
action->dev_id = dev_id;
- retval = setup_irq(irq, action);
+ retval = __setup_irq(irq, desc, action);
if (retval)
kfree(action);
{
if (action->dir) {
struct irq_desc *desc = irq_to_desc(irq);
+
remove_proc_entry(action->dir->name, desc->dir);
}
}
static int try_one_irq(int irq, struct irq_desc *desc)
{
struct irqaction *action;
- int ok = 0;
- int work = 0; /* Did we do work for a real IRQ */
+ int ok = 0, work = 0;
spin_lock(&desc->lock);
/* Already running on another processor */
static int misrouted_irq(int irq)
{
- int i;
- int ok = 0;
struct irq_desc *desc;
+ int i, ok = 0;
for_each_irq_desc(i, desc) {
if (!i)
static void poll_spurious_irqs(unsigned long dummy)
{
- int i;
struct irq_desc *desc;
+ int i;
for_each_irq_desc(i, desc) {
unsigned int status;
try_one_irq(i, desc);
}
- mod_timer(&poll_spurious_irq_timer, jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
+ mod_timer(&poll_spurious_irq_timer,
+ jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
}
/*
}
}
-static inline int try_misrouted_irq(unsigned int irq, struct irq_desc *desc, irqreturn_t action_ret)
+static inline int
+try_misrouted_irq(unsigned int irq, struct irq_desc *desc,
+ irqreturn_t action_ret)
{
struct irqaction *action;
desc->depth++;
desc->chip->disable(irq);
- mod_timer(&poll_spurious_irq_timer, jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
+ mod_timer(&poll_spurious_irq_timer,
+ jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
}
desc->irqs_unhandled = 0;
}