diff options
author | Aaron Sierra <asierra@xes-inc.com> | 2016-04-29 23:41:02 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-31 13:20:15 +0200 |
commit | fa54b326803d91b04705a6adf0ff963593a9fe5c (patch) | |
tree | 98f6c8d87031facf1ccb9adf734d9962d21a86fb /drivers/vme/bridges/vme_tsi148.c | |
parent | VMCI: use memdup_user(). (diff) | |
download | linux-fa54b326803d91b04705a6adf0ff963593a9fe5c.tar.xz linux-fa54b326803d91b04705a6adf0ff963593a9fe5c.zip |
vme: change LM callback argument to void pointer
Make the location monitor callback function prototype more useful by
changing the argument from an integer to a void pointer.
All VME bridge drivers were simply passing the location monitor index
(e.g. 0-3) as the argument to these callbacks. It is much more useful
to pass back a pointer to data that the callback-registering driver
cares about.
There appear to be no in-kernel callers of vme_lm_attach (or
vme_lme_request for that matter), so this change only affects the VME
subsystem and bridge drivers.
This has been tested with Tsi148 hardware, but the CA91Cx42 changes
have only been compiled.
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Martyn Welch <martyn@welchs.me.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vme/bridges/vme_tsi148.c')
-rw-r--r-- | drivers/vme/bridges/vme_tsi148.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c index 4bc5d451ec6c..2d3ba1a1d42d 100644 --- a/drivers/vme/bridges/vme_tsi148.c +++ b/drivers/vme/bridges/vme_tsi148.c @@ -102,7 +102,7 @@ static u32 tsi148_LM_irqhandler(struct tsi148_driver *bridge, u32 stat) for (i = 0; i < 4; i++) { if (stat & TSI148_LCSR_INTS_LMS[i]) { /* We only enable interrupts if the callback is set */ - bridge->lm_callback[i](i); + bridge->lm_callback[i](bridge->lm_data[i]); serviced |= TSI148_LCSR_INTC_LMC[i]; } } @@ -2047,7 +2047,7 @@ static int tsi148_lm_get(struct vme_lm_resource *lm, * Callback will be passed the monitor triggered. */ static int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor, - void (*callback)(int)) + void (*callback)(void *), void *data) { u32 lm_ctl, tmp; struct vme_bridge *tsi148_bridge; @@ -2077,6 +2077,7 @@ static int tsi148_lm_attach(struct vme_lm_resource *lm, int monitor, /* Attach callback */ bridge->lm_callback[monitor] = callback; + bridge->lm_data[monitor] = data; /* Enable Location Monitor interrupt */ tmp = ioread32be(bridge->base + TSI148_LCSR_INTEN); @@ -2124,6 +2125,7 @@ static int tsi148_lm_detach(struct vme_lm_resource *lm, int monitor) /* Detach callback */ bridge->lm_callback[monitor] = NULL; + bridge->lm_data[monitor] = NULL; /* If all location monitors disabled, disable global Location Monitor */ if ((lm_en & (TSI148_LCSR_INTS_LM0S | TSI148_LCSR_INTS_LM1S | |