Skip to content

Commit

Permalink
spi: pxa2xx: derive struct chip_data from struct drv_data
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jarkko Nikula <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
andy-shev authored and broonie committed Oct 22, 2015
1 parent d74c4b1 commit d2c2f6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/spi/spi-pxa2xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d2c2f6a

Please sign in to comment.