diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-10-22 16:44:40 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-10-23 08:56:05 +0900 |
commit | d2c2f6a47633a36bc8db8c802f7c284da36a7a53 (patch) | |
tree | ddccc26a96ae33c849d0b192a09d76d405056c24 /drivers/spi/spi-pxa2xx.c | |
parent | d74c4b1c61ecc5ad8158ac649245fdfc9601c1b5 (diff) | |
download | lwn-d2c2f6a47633a36bc8db8c802f7c284da36a7a53.tar.gz lwn-d2c2f6a47633a36bc8db8c802f7c284da36a7a53.zip |
spi: pxa2xx: derive struct chip_data from struct drv_data
Since we call pxa2xx_ssp_get_clk_div() from pump_transfers() we may derive
pointer to struct chip_data from struct drv_data like it's done in the rest
of the functions. This will make it less errorprone.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pxa2xx.c')
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 986a2911e94e..4fddc2a37a81 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -814,8 +814,9 @@ static unsigned int ssp_get_clk_div(struct driver_data *drv_data, int rate) } static unsigned int pxa2xx_ssp_get_clk_div(struct driver_data *drv_data, - struct chip_data *chip, int rate) + int rate) { + struct chip_data *chip = drv_data->cur_chip; unsigned int clk_div; switch (drv_data->ssp_type) { @@ -921,7 +922,7 @@ static void pump_transfers(unsigned long data) bits = transfer->bits_per_word; speed = transfer->speed_hz; - clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, speed); + clk_div = pxa2xx_ssp_get_clk_div(drv_data, speed); if (bits <= 8) { drv_data->n_bytes = 1; |