staging: brcm80211: remove function pointer of interrupt isr in brcmfmac
authorFranky Lin <frankyl@broadcom.com>
Mon, 8 Aug 2011 13:58:56 +0000 (15:58 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Aug 2011 20:00:09 +0000 (13:00 -0700)
The use of function pointer of bus interrupt isr is no longer needed
in fullmac as there is only one available isr.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/bcmsdh.c
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/brcmfmac/sdio_host.h

index 3a6c015b0e30c90a294d0d47be636760223129fc..c9893e9287b85e3790924eab7cca4f4bef441859 100644 (file)
@@ -53,10 +53,9 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_dev *sdiodev, const char *name,
                                    len, set);
 }
 
-int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev,
-                         void (*fn)(void *), void *argh)
+int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev)
 {
-       return brcmf_sdioh_interrupt_register(sdiodev->sdioh, fn, argh);
+       return brcmf_sdioh_interrupt_register(sdiodev->sdioh);
 }
 
 int brcmf_sdcard_intr_dereg(struct brcmf_sdio_dev *sdiodev)
index db43b09829dd829b9631d68abe2a20fc63cde100..1256847ae91c667aa33093ac9ed1f26ac07e3ec5 100644 (file)
@@ -228,19 +228,9 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd)
 
 /* Configure callback to client when we receive client interrupt */
 extern int
-brcmf_sdioh_interrupt_register(struct sdioh_info *sd, void (*fn)(void *),
-                              void *argh)
+brcmf_sdioh_interrupt_register(struct sdioh_info *sd)
 {
        BRCMF_TRACE(("%s: Entering\n", __func__));
-       if (fn == NULL) {
-               BRCMF_ERROR(("%s: interrupt handler is NULL, not registering\n",
-                       __func__));
-               return -EINVAL;
-       }
-
-       sd->intr_handler = fn;
-       sd->intr_handler_arg = argh;
-       sd->intr_handler_valid = true;
 
        /* register and unmask irq */
        if (gInstance->func[2]) {
@@ -277,10 +267,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
                sdio_release_host(gInstance->func[2]);
        }
 
-       sd->intr_handler_valid = false;
-       sd->intr_handler = NULL;
-       sd->intr_handler_arg = NULL;
-
        return 0;
 }
 
@@ -877,6 +863,7 @@ brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
 static void brcmf_sdioh_irqhandler(struct sdio_func *func)
 {
        struct sdioh_info *sd;
+       struct brcmf_sdio_dev *sdiodev = dev_get_drvdata(&func->card->dev);
 
        BRCMF_TRACE(("brcmf: ***IRQHandler\n"));
        sd = gInstance->sd;
@@ -884,7 +871,7 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
        sdio_release_host(gInstance->func[0]);
 
        sd->intrcount++;
-       (sd->intr_handler) (sd->intr_handler_arg);
+       brcmf_sdbrcm_isr(sdiodev->bus);
 
        sdio_claim_host(gInstance->func[0]);
 }
index 126090b45b572441f6eac84be5ad52a62ef6ca53..8bea86595d609a16bc60939e2131996059a44486 100644 (file)
@@ -5424,6 +5424,7 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
                goto fail;
        }
        bus->sdiodev = sdiodev;
+       sdiodev->bus = bus;
        bus->bus = BRCMF_BUS;
        bus->tx_seq = SDPCM_SEQUENCE_WRAP - 1;
        bus->usebufpool = false;        /* Use bufpool if allocated,
@@ -5506,7 +5507,7 @@ void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
        /* Register interrupt callback, but mask it (not operational yet). */
        BRCMF_INTR(("%s: disable SDIO interrupts (not interested yet)\n",
                    __func__));
-       ret = brcmf_sdcard_intr_reg(bus->sdiodev, brcmf_sdbrcm_isr, bus);
+       ret = brcmf_sdcard_intr_reg(bus->sdiodev);
        if (ret != 0) {
                BRCMF_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
                             __func__, ret));
index 4fcba2ad3685770a8185912889dd9d6edc1f0653..c5a68c0382afe1dc01e33c23034dd81a9bbad2de 100644 (file)
@@ -124,9 +124,6 @@ struct brcmf_sdreg {
 
 struct sdioh_info {
        struct osl_info *osh;           /* osh handler */
-       bool intr_handler_valid; /* client driver interrupt handler valid */
-       void (*intr_handler)(void *);   /* registered interrupt handler */
-       void *intr_handler_arg; /* argument to call interrupt handler */
 
        uint irq;               /* Client irq */
        int intrcount;          /* Client interrupts */
@@ -159,8 +156,7 @@ struct brcmf_sdio_dev {
 
 /* Register/deregister device interrupt handler. */
 extern int
-brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev,
-                     void (*fn)(void *), void *argh);
+brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev);
 
 extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_dev *sdiodev);
 
@@ -278,8 +274,7 @@ extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl);
 extern int brcmf_sdioh_detach(struct sdioh_info *si);
 
 extern int
-brcmf_sdioh_interrupt_register(struct sdioh_info *si,
-                              void (*sdioh_cb_fn)(void *), void *argh);
+brcmf_sdioh_interrupt_register(struct sdioh_info *si);
 
 extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
 
@@ -328,4 +323,5 @@ extern struct brcmf_sdmmc_instance *gInstance;
 extern void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
                                u32 regsva, struct brcmf_sdio_dev *sdiodev);
 extern void brcmf_sdbrcm_disconnect(void *ptr);
+extern void brcmf_sdbrcm_isr(void *arg);
 #endif                         /* _BRCM_SDH_H_ */