diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-17 10:01:28 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-07-01 09:15:38 -0400 |
commit | aeea1808fe752e917b966961bde3e9603f206dec (patch) | |
tree | a826ec3a86dd99203eb30dded5b2b82ac13db0bb | |
parent | 48afb3112e6373a292e54d675e986a5da14c0516 (diff) |
dmaengine: PL08x: clean up get_signal/put_signal
Try to avoid dereferencing the DMA engine's channel struct in these
platform helpers; instead, pass a pointer to the channel data into
get_signal(), and the returned signal number to put_signal().
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/dma/amba-pl08x.c | 4 | ||||
-rw-r--r-- | include/linux/amba/pl08x.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index 5821125f0458..cc08c8c01a9e 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c | |||
@@ -874,7 +874,7 @@ static int prep_phy_channel(struct pl08x_dma_chan *plchan, | |||
874 | * Can the platform allow us to use this channel? | 874 | * Can the platform allow us to use this channel? |
875 | */ | 875 | */ |
876 | if (plchan->slave && pl08x->pd->get_signal) { | 876 | if (plchan->slave && pl08x->pd->get_signal) { |
877 | ret = pl08x->pd->get_signal(plchan); | 877 | ret = pl08x->pd->get_signal(plchan->cd); |
878 | if (ret < 0) { | 878 | if (ret < 0) { |
879 | dev_dbg(&pl08x->adev->dev, | 879 | dev_dbg(&pl08x->adev->dev, |
880 | "unable to use physical channel %d for transfer on %s due to platform restrictions\n", | 880 | "unable to use physical channel %d for transfer on %s due to platform restrictions\n", |
@@ -909,7 +909,7 @@ static void release_phy_channel(struct pl08x_dma_chan *plchan) | |||
909 | struct pl08x_driver_data *pl08x = plchan->host; | 909 | struct pl08x_driver_data *pl08x = plchan->host; |
910 | 910 | ||
911 | if ((plchan->phychan->signal >= 0) && pl08x->pd->put_signal) { | 911 | if ((plchan->phychan->signal >= 0) && pl08x->pd->put_signal) { |
912 | pl08x->pd->put_signal(plchan); | 912 | pl08x->pd->put_signal(plchan->cd, plchan->phychan->signal); |
913 | plchan->phychan->signal = -1; | 913 | plchan->phychan->signal = -1; |
914 | } | 914 | } |
915 | pl08x_put_phy_channel(pl08x, plchan->phychan); | 915 | pl08x_put_phy_channel(pl08x, plchan->phychan); |
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h index 0f5b34d668b6..88765a62c8f2 100644 --- a/include/linux/amba/pl08x.h +++ b/include/linux/amba/pl08x.h | |||
@@ -225,8 +225,8 @@ struct pl08x_platform_data { | |||
225 | const struct pl08x_channel_data *slave_channels; | 225 | const struct pl08x_channel_data *slave_channels; |
226 | unsigned int num_slave_channels; | 226 | unsigned int num_slave_channels; |
227 | struct pl08x_channel_data memcpy_channel; | 227 | struct pl08x_channel_data memcpy_channel; |
228 | int (*get_signal)(struct pl08x_dma_chan *); | 228 | int (*get_signal)(const struct pl08x_channel_data *); |
229 | void (*put_signal)(struct pl08x_dma_chan *); | 229 | void (*put_signal)(const struct pl08x_channel_data *, int); |
230 | u8 lli_buses; | 230 | u8 lli_buses; |
231 | u8 mem_buses; | 231 | u8 mem_buses; |
232 | }; | 232 | }; |