/**
* struct ep93xx_spi_chip - SPI device hardware settings
* @spi: back pointer to the SPI device
- * @rate: max rate in hz this chip supports
* @div_cpsr: cpsr (pre-scaler) divider
* @div_scr: scr divider
* @ops: private chip operations
*/
struct ep93xx_spi_chip {
const struct spi_device *spi;
- unsigned long rate;
u8 div_cpsr;
u8 div_scr;
struct ep93xx_spi_chip_ops *ops;
spi_set_ctldata(spi, chip);
}
- if (spi->max_speed_hz != chip->rate) {
- int err;
-
- err = ep93xx_spi_calc_divisors(espi, chip, spi->max_speed_hz);
- if (err != 0) {
- spi_set_ctldata(spi, NULL);
- kfree(chip);
- return err;
- }
- chip->rate = spi->max_speed_hz;
- }
-
ep93xx_spi_cs_control(spi, false);
return 0;
}