diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-10 05:36:33 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-19 06:58:06 -0500 |
commit | a0cd9ca2b907d7ee26575e7b63ac92dad768a75e (patch) | |
tree | 4b46f7951b9cd76531caf6d4d68d687e1b622336 /include/linux | |
parent | 43abe43ce0619d744c7a5bb15cce075e532b53b7 (diff) |
genirq: Namespace cleanup
The irq namespace has become quite convoluted. My bad. Clean it up
and deprecate the old functions. All new functions follow the scheme:
irq number based:
irq_set/get/xxx/_xxx(unsigned int irq, ...)
irq_data based:
irq_data_set/get/xxx/_xxx(struct irq_data *d, ....)
irq_desc based:
irq_desc_get_xxx(struct irq_desc *desc)
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/interrupt.h | 14 | ||||
-rw-r--r-- | include/linux/irq.h | 79 | ||||
-rw-r--r-- | include/linux/irqdesc.h | 44 |
3 files changed, 116 insertions, 21 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 56b7c97aaf0a..7834726dd95b 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -346,16 +346,24 @@ static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long | |||
346 | } | 346 | } |
347 | 347 | ||
348 | /* IRQ wakeup (PM) control: */ | 348 | /* IRQ wakeup (PM) control: */ |
349 | extern int set_irq_wake(unsigned int irq, unsigned int on); | 349 | extern int irq_set_irq_wake(unsigned int irq, unsigned int on); |
350 | |||
351 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT | ||
352 | /* Please do not use: Use the replacement functions instead */ | ||
353 | static inline int set_irq_wake(unsigned int irq, unsigned int on) | ||
354 | { | ||
355 | return irq_set_irq_wake(irq, on); | ||
356 | } | ||
357 | #endif | ||
350 | 358 | ||
351 | static inline int enable_irq_wake(unsigned int irq) | 359 | static inline int enable_irq_wake(unsigned int irq) |
352 | { | 360 | { |
353 | return set_irq_wake(irq, 1); | 361 | return irq_set_irq_wake(irq, 1); |
354 | } | 362 | } |
355 | 363 | ||
356 | static inline int disable_irq_wake(unsigned int irq) | 364 | static inline int disable_irq_wake(unsigned int irq) |
357 | { | 365 | { |
358 | return set_irq_wake(irq, 0); | 366 | return irq_set_irq_wake(irq, 0); |
359 | } | 367 | } |
360 | 368 | ||
361 | #else /* !CONFIG_GENERIC_HARDIRQS */ | 369 | #else /* !CONFIG_GENERIC_HARDIRQS */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 80fcb53057bc..e9f847d56c4d 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -292,8 +292,7 @@ set_irq_handler(unsigned int irq, irq_flow_handler_t handle) | |||
292 | * IRQ_NOREQUEST and IRQ_NOPROBE) | 292 | * IRQ_NOREQUEST and IRQ_NOPROBE) |
293 | */ | 293 | */ |
294 | static inline void | 294 | static inline void |
295 | set_irq_chained_handler(unsigned int irq, | 295 | set_irq_chained_handler(unsigned int irq, irq_flow_handler_t handle) |
296 | irq_flow_handler_t handle) | ||
297 | { | 296 | { |
298 | __set_irq_handler(irq, handle, 1, NULL); | 297 | __set_irq_handler(irq, handle, 1, NULL); |
299 | } | 298 | } |
@@ -312,12 +311,12 @@ static inline void irq_clear_status_flags(unsigned int irq, unsigned long clr) | |||
312 | irq_modify_status(irq, clr, 0); | 311 | irq_modify_status(irq, clr, 0); |
313 | } | 312 | } |
314 | 313 | ||
315 | static inline void set_irq_noprobe(unsigned int irq) | 314 | static inline void irq_set_noprobe(unsigned int irq) |
316 | { | 315 | { |
317 | irq_modify_status(irq, 0, IRQ_NOPROBE); | 316 | irq_modify_status(irq, 0, IRQ_NOPROBE); |
318 | } | 317 | } |
319 | 318 | ||
320 | static inline void set_irq_probe(unsigned int irq) | 319 | static inline void irq_set_probe(unsigned int irq) |
321 | { | 320 | { |
322 | irq_modify_status(irq, IRQ_NOPROBE, 0); | 321 | irq_modify_status(irq, IRQ_NOPROBE, 0); |
323 | } | 322 | } |
@@ -338,14 +337,14 @@ static inline void dynamic_irq_init(unsigned int irq) | |||
338 | } | 337 | } |
339 | 338 | ||
340 | /* Set/get chip/data for an IRQ: */ | 339 | /* Set/get chip/data for an IRQ: */ |
341 | extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); | 340 | extern int irq_set_chip(unsigned int irq, struct irq_chip *chip); |
342 | extern int set_irq_data(unsigned int irq, void *data); | 341 | extern int irq_set_handler_data(unsigned int irq, void *data); |
343 | extern int set_irq_chip_data(unsigned int irq, void *data); | 342 | extern int irq_set_chip_data(unsigned int irq, void *data); |
344 | extern int set_irq_type(unsigned int irq, unsigned int type); | 343 | extern int irq_set_irq_type(unsigned int irq, unsigned int type); |
345 | extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); | 344 | extern int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry); |
346 | extern struct irq_data *irq_get_irq_data(unsigned int irq); | 345 | extern struct irq_data *irq_get_irq_data(unsigned int irq); |
347 | 346 | ||
348 | static inline struct irq_chip *get_irq_chip(unsigned int irq) | 347 | static inline struct irq_chip *irq_get_chip(unsigned int irq) |
349 | { | 348 | { |
350 | struct irq_data *d = irq_get_irq_data(irq); | 349 | struct irq_data *d = irq_get_irq_data(irq); |
351 | return d ? d->chip : NULL; | 350 | return d ? d->chip : NULL; |
@@ -356,7 +355,7 @@ static inline struct irq_chip *irq_data_get_irq_chip(struct irq_data *d) | |||
356 | return d->chip; | 355 | return d->chip; |
357 | } | 356 | } |
358 | 357 | ||
359 | static inline void *get_irq_chip_data(unsigned int irq) | 358 | static inline void *irq_get_chip_data(unsigned int irq) |
360 | { | 359 | { |
361 | struct irq_data *d = irq_get_irq_data(irq); | 360 | struct irq_data *d = irq_get_irq_data(irq); |
362 | return d ? d->chip_data : NULL; | 361 | return d ? d->chip_data : NULL; |
@@ -367,18 +366,18 @@ static inline void *irq_data_get_irq_chip_data(struct irq_data *d) | |||
367 | return d->chip_data; | 366 | return d->chip_data; |
368 | } | 367 | } |
369 | 368 | ||
370 | static inline void *get_irq_data(unsigned int irq) | 369 | static inline void *irq_get_handler_data(unsigned int irq) |
371 | { | 370 | { |
372 | struct irq_data *d = irq_get_irq_data(irq); | 371 | struct irq_data *d = irq_get_irq_data(irq); |
373 | return d ? d->handler_data : NULL; | 372 | return d ? d->handler_data : NULL; |
374 | } | 373 | } |
375 | 374 | ||
376 | static inline void *irq_data_get_irq_data(struct irq_data *d) | 375 | static inline void *irq_data_get_irq_handler_data(struct irq_data *d) |
377 | { | 376 | { |
378 | return d->handler_data; | 377 | return d->handler_data; |
379 | } | 378 | } |
380 | 379 | ||
381 | static inline struct msi_desc *get_irq_msi(unsigned int irq) | 380 | static inline struct msi_desc *irq_get_msi_desc(unsigned int irq) |
382 | { | 381 | { |
383 | struct irq_data *d = irq_get_irq_data(irq); | 382 | struct irq_data *d = irq_get_irq_data(irq); |
384 | return d ? d->msi_desc : NULL; | 383 | return d ? d->msi_desc : NULL; |
@@ -389,6 +388,58 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d) | |||
389 | return d->msi_desc; | 388 | return d->msi_desc; |
390 | } | 389 | } |
391 | 390 | ||
391 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT | ||
392 | /* Please do not use: Use the replacement functions instead */ | ||
393 | static inline int set_irq_chip(unsigned int irq, struct irq_chip *chip) | ||
394 | { | ||
395 | return irq_set_chip(irq, chip); | ||
396 | } | ||
397 | static inline int set_irq_data(unsigned int irq, void *data) | ||
398 | { | ||
399 | return irq_set_handler_data(irq, data); | ||
400 | } | ||
401 | static inline int set_irq_chip_data(unsigned int irq, void *data) | ||
402 | { | ||
403 | return irq_set_chip_data(irq, data); | ||
404 | } | ||
405 | static inline int set_irq_type(unsigned int irq, unsigned int type) | ||
406 | { | ||
407 | return irq_set_irq_type(irq, type); | ||
408 | } | ||
409 | static inline int set_irq_msi(unsigned int irq, struct msi_desc *entry) | ||
410 | { | ||
411 | return irq_set_msi_desc(irq, entry); | ||
412 | } | ||
413 | static inline struct irq_chip *get_irq_chip(unsigned int irq) | ||
414 | { | ||
415 | return irq_get_chip(irq); | ||
416 | } | ||
417 | static inline void *get_irq_chip_data(unsigned int irq) | ||
418 | { | ||
419 | return irq_get_chip_data(irq); | ||
420 | } | ||
421 | static inline void *get_irq_data(unsigned int irq) | ||
422 | { | ||
423 | return irq_get_handler_data(irq); | ||
424 | } | ||
425 | static inline void *irq_data_get_irq_data(struct irq_data *d) | ||
426 | { | ||
427 | return irq_data_get_irq_handler_data(d); | ||
428 | } | ||
429 | static inline struct msi_desc *get_irq_msi(unsigned int irq) | ||
430 | { | ||
431 | return irq_get_msi_desc(irq); | ||
432 | } | ||
433 | static inline void set_irq_noprobe(unsigned int irq) | ||
434 | { | ||
435 | irq_set_noprobe(irq); | ||
436 | } | ||
437 | static inline void set_irq_probe(unsigned int irq) | ||
438 | { | ||
439 | irq_set_probe(irq); | ||
440 | } | ||
441 | #endif | ||
442 | |||
392 | int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node); | 443 | int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node); |
393 | void irq_free_descs(unsigned int irq, unsigned int cnt); | 444 | void irq_free_descs(unsigned int irq, unsigned int cnt); |
394 | int irq_reserve_irqs(unsigned int from, unsigned int cnt); | 445 | int irq_reserve_irqs(unsigned int from, unsigned int cnt); |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index bfef56dadddb..64794dec93b6 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -98,10 +98,46 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) | |||
98 | 98 | ||
99 | #ifdef CONFIG_GENERIC_HARDIRQS | 99 | #ifdef CONFIG_GENERIC_HARDIRQS |
100 | 100 | ||
101 | #define get_irq_desc_chip(desc) ((desc)->irq_data.chip) | 101 | static inline struct irq_chip *irq_desc_get_chip(struct irq_desc *desc) |
102 | #define get_irq_desc_chip_data(desc) ((desc)->irq_data.chip_data) | 102 | { |
103 | #define get_irq_desc_data(desc) ((desc)->irq_data.handler_data) | 103 | return desc->irq_data.chip; |
104 | #define get_irq_desc_msi(desc) ((desc)->irq_data.msi_desc) | 104 | } |
105 | |||
106 | static inline void *irq_desc_get_chip_data(struct irq_desc *desc) | ||
107 | { | ||
108 | return desc->irq_data.chip_data; | ||
109 | } | ||
110 | |||
111 | static inline void *irq_desc_get_handler_data(struct irq_desc *desc) | ||
112 | { | ||
113 | return desc->irq_data.handler_data; | ||
114 | } | ||
115 | |||
116 | static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc) | ||
117 | { | ||
118 | return desc->irq_data.msi_desc; | ||
119 | } | ||
120 | |||
121 | #ifndef CONFIG_GENERIC_HARDIRQS_NO_COMPAT | ||
122 | static inline struct irq_chip *get_irq_desc_chip(struct irq_desc *desc) | ||
123 | { | ||
124 | return irq_desc_get_chip(desc); | ||
125 | } | ||
126 | static inline void *get_irq_desc_data(struct irq_desc *desc) | ||
127 | { | ||
128 | return irq_desc_get_handler_data(desc); | ||
129 | } | ||
130 | |||
131 | static inline void *get_irq_desc_chip_data(struct irq_desc *desc) | ||
132 | { | ||
133 | return irq_desc_get_chip_data(desc); | ||
134 | } | ||
135 | |||
136 | static inline struct msi_desc *get_irq_desc_msi(struct irq_desc *desc) | ||
137 | { | ||
138 | return irq_desc_get_msi_desc(desc); | ||
139 | } | ||
140 | #endif | ||
105 | 141 | ||
106 | /* | 142 | /* |
107 | * Architectures call this to let the generic IRQ layer | 143 | * Architectures call this to let the generic IRQ layer |