@@ -714,7 +714,7 @@ static void gpmc_irq_enable(struct irq_data *p)
static void gpmc_irq_noop(struct irq_data *data) { }
-static unsigned int gpmc_irq_noop_ret(struct irq_data *data) { return 0; }
+static int gpmc_irq_noop_ret(struct irq_data *data) { return 0; }
static int gpmc_setup_irq(void)
{
@@ -734,7 +734,7 @@ static void bfin_gpio_unmask_irq(struct irq_data *d)
set_gpio_maska(irq_to_gpio(d->irq), 1);
}
-static unsigned int bfin_gpio_irq_startup(struct irq_data *d)
+static int bfin_gpio_irq_startup(struct irq_data *d)
{
u32 gpionr = irq_to_gpio(d->irq);
@@ -12,7 +12,7 @@
#include "hpsim_ssc.h"
-static unsigned int
+static int
hpsim_irq_startup(struct irq_data *data)
{
return 0;
@@ -381,7 +381,7 @@ iosapic_set_affinity(struct irq_data *data, const struct cpumask *mask,
* Handlers for level-triggered interrupts.
*/
-static unsigned int
+static int
iosapic_startup_level_irq (struct irq_data *data)
{
unmask_irq(data);
@@ -433,7 +433,7 @@ static struct irq_chip irq_type_iosapic_level = {
* Handlers for edge-triggered interrupts.
*/
-static unsigned int
+static int
iosapic_startup_edge_irq (struct irq_data *data)
{
unmask_irq(data);
@@ -14,7 +14,7 @@
#include <linux/sched.h>
#include <linux/irq.h>
-static unsigned int
+static int
lsapic_noop_startup (struct irq_data *data)
{
return 0;
@@ -76,7 +76,7 @@ u64 sn_intr_redirect(nasid_t local_nasid, int local_widget,
return ret_stuff.status;
}
-static unsigned int sn_startup_irq(struct irq_data *data)
+static int sn_startup_irq(struct irq_data *data)
{
return 0;
}
@@ -4,7 +4,7 @@
#include <asm/traps.h>
#include <asm/apollohw.h>
-unsigned int apollo_irq_startup(struct irq_data *data)
+int apollo_irq_startup(struct irq_data *data)
{
unsigned int irq = data->irq;
@@ -82,7 +82,7 @@ __ALIGN_STR "\n\t"
extern void atari_microwire_cmd(int cmd);
-static unsigned int atari_irq_startup(struct irq_data *data)
+static int atari_irq_startup(struct irq_data *data)
{
unsigned int irq = data->irq;
@@ -190,7 +190,7 @@ static struct irq_chip atari_mfptimer_chip = {
static unsigned char *enat_cpld;
-static unsigned int atari_ethernat_startup(struct irq_data *data)
+static int atari_ethernat_startup(struct irq_data *data)
{
int enat_num = 140 - data->irq + 1;
@@ -57,8 +57,8 @@
struct irq_data;
struct irq_chip;
struct irq_desc;
-extern unsigned int m68k_irq_startup(struct irq_data *data);
-extern unsigned int m68k_irq_startup_irq(unsigned int irq);
+extern int m68k_irq_startup(struct irq_data *data);
+extern int m68k_irq_startup_irq(unsigned int irq);
extern void m68k_irq_shutdown(struct irq_data *data);
extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int,
struct pt_regs *));
@@ -125,7 +125,7 @@ void m68k_setup_irq_controller(struct irq_chip *chip,
}
}
-unsigned int m68k_irq_startup_irq(unsigned int irq)
+int m68k_irq_startup_irq(unsigned int irq)
{
if (irq <= IRQ_AUTO_7)
vectors[VEC_SPUR + irq] = auto_inthandler;
@@ -134,7 +134,7 @@ unsigned int m68k_irq_startup_irq(unsigned int irq)
return 0;
}
-unsigned int m68k_irq_startup(struct irq_data *data)
+int m68k_irq_startup(struct irq_data *data)
{
return m68k_irq_startup_irq(data->irq);
}
@@ -136,7 +136,7 @@ irqreturn_t mac_debug_handler(int, void *);
/* #define DEBUG_MACINTS */
-static unsigned int mac_irq_startup(struct irq_data *);
+static int mac_irq_startup(struct irq_data *);
static void mac_irq_shutdown(struct irq_data *);
static struct irq_chip mac_irq_chip = {
@@ -254,7 +254,7 @@ void mac_irq_disable(struct irq_data *data)
}
}
-static unsigned int mac_irq_startup(struct irq_data *data)
+static int mac_irq_startup(struct irq_data *data)
{
int irq = data->irq;
@@ -109,7 +109,7 @@ static void intc_irq_ack(struct irq_data *d)
*/
static u8 intc_intpri = MCFSIM_ICR_LEVEL(6) | MCFSIM_ICR_PRI(6);
-static unsigned int intc_irq_startup(struct irq_data *d)
+static int intc_irq_startup(struct irq_data *d)
{
unsigned int irq = d->irq - MCFINT_VECBASE;
unsigned long icraddr;
@@ -95,7 +95,7 @@ static void intc_irq_ack(struct irq_data *d)
__raw_writeb(0x1 << ebit, MCFEPORT_EPFR);
}
-static unsigned int intc_irq_startup(struct irq_data *d)
+static int intc_irq_startup(struct irq_data *d)
{
unsigned int irq = d->irq;
@@ -40,7 +40,7 @@ static void q40_irq_disable(struct irq_data *data);
unsigned short q40_ablecount[35];
unsigned short q40_state[35];
-static unsigned int q40_irq_startup(struct irq_data *data)
+static int q40_irq_startup(struct irq_data *data)
{
unsigned int irq = data->irq;
@@ -27,7 +27,7 @@ static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly;
static struct irq_domain *root_domain;
-static unsigned int startup_meta_irq(struct irq_data *data)
+static int startup_meta_irq(struct irq_data *data)
{
tbi_startup_interrupt(data->hwirq);
return 0;
@@ -329,7 +329,7 @@ static void jz_gpio_irq_unmask(struct irq_data *data)
};
/* TODO: Check if function is gpio */
-static unsigned int jz_gpio_irq_startup(struct irq_data *data)
+static int jz_gpio_irq_startup(struct irq_data *data)
{
jz_gpio_set_irq_bit(data, JZ_REG_GPIO_SELECT_SET);
jz_gpio_irq_unmask(data);
@@ -62,7 +62,7 @@ static struct irq_chip mips_cpu_irq_controller = {
* Basically the same as above but taking care of all the MT stuff
*/
-static unsigned int mips_mt_cpu_irq_startup(struct irq_data *d)
+static int mips_mt_cpu_irq_startup(struct irq_data *d)
{
unsigned int vpflags = dvpe();
@@ -167,7 +167,7 @@ static int ltq_eiu_settype(struct irq_data *d, unsigned int type)
return 0;
}
-static unsigned int ltq_startup_eiu_irq(struct irq_data *d)
+static int ltq_startup_eiu_irq(struct irq_data *d)
{
int i;
@@ -132,7 +132,7 @@ static int intr_disconnect_level(int cpu, int bit)
}
/* Startup one of the (PCI ...) IRQs routes over a bridge. */
-static unsigned int startup_bridge_irq(struct irq_data *d)
+static int startup_bridge_irq(struct irq_data *d)
{
struct bridge_controller *bc;
bridgereg_t device;
@@ -143,7 +143,7 @@ static void __pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
/* When an irq gets requested for the first client, if it's an
* edge interrupt, we clear any previous one on the controller
*/
-static unsigned int pmac_startup_irq(struct irq_data *d)
+static int pmac_startup_irq(struct irq_data *d)
{
unsigned long flags;
unsigned int src = irqd_to_hwirq(d);
@@ -295,7 +295,7 @@ static void wsp_chip_unmask_irq(struct irq_data *d)
wsp_ics_set_xive(ics, hw_irq, xive);
}
-static unsigned int wsp_chip_startup(struct irq_data *d)
+static int wsp_chip_startup(struct irq_data *d)
{
/* unmask it */
wsp_chip_unmask_irq(d);
@@ -720,7 +720,7 @@ static void wsp_ics_msi_unmask_irq(struct irq_data *d)
unmask_msi_irq(d);
}
-static unsigned int wsp_ics_msi_startup(struct irq_data *d)
+static int wsp_ics_msi_startup(struct irq_data *d)
{
wsp_ics_msi_unmask_irq(d);
return 0;
@@ -735,7 +735,7 @@ static void mpic_unmask_ht_irq(struct irq_data *d)
mpic_ht_end_irq(mpic, src);
}
-static unsigned int mpic_startup_ht_irq(struct irq_data *d)
+static int mpic_startup_ht_irq(struct irq_data *d)
{
struct mpic *mpic = mpic_from_irq_data(d);
unsigned int src = irqd_to_hwirq(d);
@@ -64,7 +64,7 @@ static void ics_opal_unmask_irq(struct irq_data *d)
__func__, d->irq, hw_irq, server, rc);
}
-static unsigned int ics_opal_startup(struct irq_data *d)
+static int ics_opal_startup(struct irq_data *d)
{
#ifdef CONFIG_PCI_MSI
/*
@@ -67,7 +67,7 @@ static void ics_rtas_unmask_irq(struct irq_data *d)
}
}
-static unsigned int ics_rtas_startup(struct irq_data *d)
+static int ics_rtas_startup(struct irq_data *d)
{
#ifdef CONFIG_PCI_MSI
/*
@@ -168,7 +168,7 @@ static void leon_mask_irq(struct irq_data *data)
spin_unlock_irqrestore(&leon_irq_lock, flags);
}
-static unsigned int leon_startup_irq(struct irq_data *data)
+static int leon_startup_irq(struct irq_data *data)
{
irq_link(data->irq);
leon_unmask_irq(data);
@@ -337,7 +337,7 @@ static void grpci1_unmask_irq(struct irq_data *data)
REGSTORE(priv->regs->irq, REGLOAD(priv->regs->irq) | (1 << irqidx));
}
-static unsigned int grpci1_startup_irq(struct irq_data *data)
+static int grpci1_startup_irq(struct irq_data *data)
{
grpci1_unmask_irq(data);
return 0;
@@ -477,7 +477,7 @@ static void grpci2_unmask_irq(struct irq_data *data)
spin_unlock_irqrestore(&grpci2_dev_lock, flags);
}
-static unsigned int grpci2_startup_irq(struct irq_data *data)
+static int grpci2_startup_irq(struct irq_data *data)
{
grpci2_unmask_irq(data);
return 0;
@@ -825,7 +825,7 @@ static void pcic_unmask_irq(struct irq_data *data)
local_irq_restore(flags);
}
-static unsigned int pcic_startup_irq(struct irq_data *data)
+static int pcic_startup_irq(struct irq_data *data)
{
irq_link(data->irq);
pcic_unmask_irq(data);
@@ -223,7 +223,7 @@ static void sun4d_unmask_irq(struct irq_data *data)
#endif
}
-static unsigned int sun4d_startup_irq(struct irq_data *data)
+static int sun4d_startup_irq(struct irq_data *data)
{
irq_link(data->irq);
sun4d_unmask_irq(data);
@@ -220,7 +220,7 @@ static void sun4m_unmask_irq(struct irq_data *data)
}
}
-static unsigned int sun4m_startup_irq(struct irq_data *data)
+static int sun4m_startup_irq(struct irq_data *data)
{
irq_link(data->irq);
sun4m_unmask_irq(data);
@@ -1463,7 +1463,7 @@ static struct pci_ops tile_cfg_ops = {
/* MSI support starts here. */
-static unsigned int tilegx_msi_startup(struct irq_data *d)
+static int tilegx_msi_startup(struct irq_data *d)
{
if (d->msi_desc)
unmask_msi_irq(d);
@@ -2132,7 +2132,7 @@ static int __init timer_irq_works(void)
* an edge even if it isn't on the 8259A...
*/
-static unsigned int startup_ioapic_irq(struct irq_data *data)
+static int startup_ioapic_irq(struct irq_data *data)
{
int was_pending = 0, irq = data->irq;
unsigned long flags;
@@ -467,7 +467,7 @@ static struct irq_chip cobalt_irq_type = {
* interrupt controller type, and through a special virtual interrupt-
* controller. Device drivers only see the virtual interrupt sources.
*/
-static unsigned int startup_piix4_master_irq(struct irq_data *data)
+static int startup_piix4_master_irq(struct irq_data *data)
{
legacy_pic->init(0);
enable_cobalt_irq(data);
@@ -408,7 +408,7 @@ static void adnp_irq_bus_unlock(struct irq_data *data)
mutex_unlock(&adnp->irq_lock);
}
-static unsigned int adnp_irq_startup(struct irq_data *data)
+static int adnp_irq_startup(struct irq_data *data)
{
struct adnp *adnp = irq_data_get_irq_chip_data(data);
@@ -449,7 +449,7 @@ static void bcm_kona_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
chained_irq_exit(chip, desc);
}
-static unsigned int bcm_kona_gpio_irq_startup(struct irq_data *d)
+static int bcm_kona_gpio_irq_startup(struct irq_data *d)
{
struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d);
@@ -99,7 +99,7 @@ static void em_gio_irq_enable(struct irq_data *d)
em_gio_write(p, GIO_IEN, BIT(irqd_to_hwirq(d)));
}
-static unsigned int em_gio_irq_startup(struct irq_data *d)
+static int em_gio_irq_startup(struct irq_data *d)
{
struct em_gio_priv *p = irq_data_get_irq_chip_data(d);
@@ -235,7 +235,7 @@ static void intel_mid_irq_mask(struct irq_data *d)
{
}
-static unsigned int intel_mid_irq_startup(struct irq_data *d)
+static int intel_mid_irq_startup(struct irq_data *d)
{
struct intel_mid_gpio *priv = irq_data_get_irq_chip_data(d);
@@ -301,7 +301,7 @@ static void lp_irq_disable(struct irq_data *d)
spin_unlock_irqrestore(&lg->lock, flags);
}
-static unsigned int lp_irq_startup(struct irq_data *d)
+static int lp_irq_startup(struct irq_data *d)
{
struct lp_gpio *lg = irq_data_get_irq_chip_data(d);
@@ -440,7 +440,7 @@ static void mcp23s08_irq_bus_unlock(struct irq_data *data)
mutex_unlock(&mcp->irq_lock);
}
-static unsigned int mcp23s08_irq_startup(struct irq_data *data)
+static int mcp23s08_irq_startup(struct irq_data *data)
{
struct mcp23s08 *mcp = irq_data_get_irq_chip_data(data);
@@ -302,7 +302,7 @@ static void tz1090_gpio_irq_next_edge(struct tz1090_gpio_bank *bank,
__global_unlock2(lstat);
}
-static unsigned int gpio_startup_irq(struct irq_data *data)
+static int gpio_startup_irq(struct irq_data *data)
{
/*
* This warning indicates that the type of the irq hasn't been set
@@ -34,7 +34,7 @@ struct metag_internal_irq_priv {
/* Private data for the one and only internal interrupt controller */
static struct metag_internal_irq_priv metag_internal_irq_priv;
-static unsigned int metag_internal_irq_startup(struct irq_data *data);
+static int metag_internal_irq_startup(struct irq_data *data);
static void metag_internal_irq_shutdown(struct irq_data *data);
static void metag_internal_irq_ack(struct irq_data *data);
static void metag_internal_irq_mask(struct irq_data *data);
@@ -88,7 +88,7 @@ static inline void __iomem *metag_hwvec_addr(irq_hw_number_t hw)
* Multiplex interrupts for @irq onto TR1. Clear any pending
* interrupts.
*/
-static unsigned int metag_internal_irq_startup(struct irq_data *data)
+static int metag_internal_irq_startup(struct irq_data *data)
{
/* Clear (toggle) the bit in HWSTATMETA for our interrupt. */
metag_internal_irq_ack(data);
@@ -316,7 +316,7 @@ static void adi_gpio_unmask_irq(struct irq_data *d)
spin_unlock_irqrestore(&port->lock, flags);
}
-static unsigned int adi_gpio_irq_startup(struct irq_data *d)
+static int adi_gpio_irq_startup(struct irq_data *d)
{
unsigned long flags;
struct gpio_port *port = irq_data_get_irq_chip_data(d);
@@ -371,7 +371,7 @@ static void byt_irq_mask(struct irq_data *d)
{
}
-static unsigned int byt_irq_startup(struct irq_data *d)
+static int byt_irq_startup(struct irq_data *d)
{
struct byt_gpio *vg = irq_data_get_irq_chip_data(d);
@@ -805,7 +805,7 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
return 0;
}
-static unsigned int msm_gpio_irq_startup(struct irq_data *d)
+static int msm_gpio_irq_startup(struct irq_data *d)
{
struct msm_pinctrl *pctrl = irq_data_get_irq_chip_data(d);
@@ -844,7 +844,7 @@ static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
return 0;
}
-static unsigned int nmk_gpio_irq_startup(struct irq_data *d)
+static int nmk_gpio_irq_startup(struct irq_data *d)
{
struct nmk_gpio_chip *nmk_chip = irq_data_get_irq_chip_data(d);
@@ -594,7 +594,7 @@ static int sirfsoc_gpio_irq_type(struct irq_data *d, unsigned type)
return 0;
}
-static unsigned int sirfsoc_gpio_irq_startup(struct irq_data *d)
+static int sirfsoc_gpio_irq_startup(struct irq_data *d)
{
struct sirfsoc_gpio_bank *bank = irq_data_get_irq_chip_data(d);
@@ -520,7 +520,7 @@ static void mask_ack_pirq(struct irq_data *data)
eoi_pirq(data);
}
-static unsigned int __startup_pirq(unsigned int irq)
+static int __startup_pirq(unsigned int irq)
{
struct evtchn_bind_pirq bind_pirq;
struct irq_info *info = info_for_irq(irq);
@@ -563,7 +563,7 @@ out:
return 0;
}
-static unsigned int startup_pirq(struct irq_data *data)
+static int startup_pirq(struct irq_data *data)
{
return __startup_pirq(data->irq);
}
@@ -307,7 +307,7 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
*/
struct irq_chip {
const char *name;
- unsigned int (*irq_startup)(struct irq_data *data);
+ int (*irq_startup)(struct irq_data *data);
void (*irq_shutdown)(struct irq_data *data);
void (*irq_enable)(struct irq_data *data);
void (*irq_disable)(struct irq_data *data);
@@ -27,7 +27,7 @@ static void ack_bad(struct irq_data *data)
*/
static void noop(struct irq_data *data) { }
-static unsigned int noop_ret(struct irq_data *data)
+static int noop_ret(struct irq_data *data)
{
return 0;
}
This patch changes the return type of the irq_startup() callback in irq_chip from unsigned int to int, and modify the IRQ drivers providing this feature. This allows the callback to return negative error codes. This patch prepares the way for another patch that'll make request_irq() fail when irq_startup() fails. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com> --- arch/arm/mach-omap2/gpmc.c | 2 +- arch/blackfin/mach-common/ints-priority.c | 2 +- arch/ia64/hp/sim/hpsim_irq.c | 2 +- arch/ia64/kernel/iosapic.c | 4 ++-- arch/ia64/kernel/irq_lsapic.c | 2 +- arch/ia64/sn/kernel/irq.c | 2 +- arch/m68k/apollo/dn_ints.c | 2 +- arch/m68k/atari/ataints.c | 4 ++-- arch/m68k/include/asm/irq.h | 4 ++-- arch/m68k/kernel/ints.c | 4 ++-- arch/m68k/mac/macints.c | 4 ++-- arch/m68k/platform/coldfire/intc-2.c | 2 +- arch/m68k/platform/coldfire/intc-simr.c | 2 +- arch/m68k/q40/q40ints.c | 2 +- arch/metag/kernel/irq.c | 2 +- arch/mips/jz4740/gpio.c | 2 +- arch/mips/kernel/irq_cpu.c | 2 +- arch/mips/lantiq/irq.c | 2 +- arch/mips/sgi-ip27/ip27-irq-pci.c | 2 +- arch/powerpc/platforms/powermac/pic.c | 2 +- arch/powerpc/platforms/wsp/ics.c | 4 ++-- arch/powerpc/sysdev/mpic.c | 2 +- arch/powerpc/sysdev/xics/ics-opal.c | 2 +- arch/powerpc/sysdev/xics/ics-rtas.c | 2 +- arch/sparc/kernel/leon_kernel.c | 2 +- arch/sparc/kernel/leon_pci_grpci1.c | 2 +- arch/sparc/kernel/leon_pci_grpci2.c | 2 +- arch/sparc/kernel/pcic.c | 2 +- arch/sparc/kernel/sun4d_irq.c | 2 +- arch/sparc/kernel/sun4m_irq.c | 2 +- arch/tile/kernel/pci_gx.c | 2 +- arch/x86/kernel/apic/io_apic.c | 2 +- arch/x86/platform/visws/visws_quirks.c | 2 +- drivers/gpio/gpio-adnp.c | 2 +- drivers/gpio/gpio-bcm-kona.c | 2 +- drivers/gpio/gpio-em.c | 2 +- drivers/gpio/gpio-intel-mid.c | 2 +- drivers/gpio/gpio-lynxpoint.c | 2 +- drivers/gpio/gpio-mcp23s08.c | 2 +- drivers/gpio/gpio-tz1090.c | 2 +- drivers/irqchip/irq-metag.c | 4 ++-- drivers/pinctrl/pinctrl-adi2.c | 2 +- drivers/pinctrl/pinctrl-baytrail.c | 2 +- drivers/pinctrl/pinctrl-msm.c | 2 +- drivers/pinctrl/pinctrl-nomadik.c | 2 +- drivers/pinctrl/sirf/pinctrl-sirf.c | 2 +- drivers/xen/events/events_base.c | 4 ++-- include/linux/irq.h | 2 +- kernel/irq/dummychip.c | 2 +- 49 files changed, 57 insertions(+), 57 deletions(-)