diff options
| author | Geert Uytterhoeven <geert+renesas@glider.be> | 2016-06-22 08:50:03 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2016-06-22 09:14:38 -0400 |
| commit | a6802cc05f9e48e86bc3f9f056c74a69dc5e37fa (patch) | |
| tree | ce9d64d8e7a93a3d8b0560ce13d8d1146dc94b9f | |
| parent | 1a695a905c18548062509178b98bc91e67510864 (diff) | |
spi: sh-msiof: Remove sh_msiof_spi_priv.chipdata
After probe time, the pointer to the sh_msiof_chipdata structure in the
sh_msiof_spi_priv structure is used only for checking the SPI master flags.
As these are also available in the spi_master structure, convert the
users to access those, and remove the pointer.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi-sh-msiof.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index a7934ab00b96..0f83ad1d5a58 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c | |||
| @@ -45,7 +45,6 @@ struct sh_msiof_spi_priv { | |||
| 45 | void __iomem *mapbase; | 45 | void __iomem *mapbase; |
| 46 | struct clk *clk; | 46 | struct clk *clk; |
| 47 | struct platform_device *pdev; | 47 | struct platform_device *pdev; |
| 48 | const struct sh_msiof_chipdata *chipdata; | ||
| 49 | struct sh_msiof_spi_info *info; | 48 | struct sh_msiof_spi_info *info; |
| 50 | struct completion done; | 49 | struct completion done; |
| 51 | unsigned int tx_fifo_size; | 50 | unsigned int tx_fifo_size; |
| @@ -271,7 +270,7 @@ static void sh_msiof_spi_set_clk_regs(struct sh_msiof_spi_priv *p, | |||
| 271 | 270 | ||
| 272 | scr = sh_msiof_spi_div_table[k].brdv | SCR_BRPS(brps); | 271 | scr = sh_msiof_spi_div_table[k].brdv | SCR_BRPS(brps); |
| 273 | sh_msiof_write(p, TSCR, scr); | 272 | sh_msiof_write(p, TSCR, scr); |
| 274 | if (!(p->chipdata->master_flags & SPI_MASTER_MUST_TX)) | 273 | if (!(p->master->flags & SPI_MASTER_MUST_TX)) |
| 275 | sh_msiof_write(p, RSCR, scr); | 274 | sh_msiof_write(p, RSCR, scr); |
| 276 | } | 275 | } |
| 277 | 276 | ||
| @@ -336,7 +335,7 @@ static void sh_msiof_spi_set_pin_regs(struct sh_msiof_spi_priv *p, | |||
| 336 | tmp |= lsb_first << MDR1_BITLSB_SHIFT; | 335 | tmp |= lsb_first << MDR1_BITLSB_SHIFT; |
| 337 | tmp |= sh_msiof_spi_get_dtdl_and_syncdl(p); | 336 | tmp |= sh_msiof_spi_get_dtdl_and_syncdl(p); |
| 338 | sh_msiof_write(p, TMDR1, tmp | MDR1_TRMD | TMDR1_PCON); | 337 | sh_msiof_write(p, TMDR1, tmp | MDR1_TRMD | TMDR1_PCON); |
| 339 | if (p->chipdata->master_flags & SPI_MASTER_MUST_TX) { | 338 | if (p->master->flags & SPI_MASTER_MUST_TX) { |
| 340 | /* These bits are reserved if RX needs TX */ | 339 | /* These bits are reserved if RX needs TX */ |
| 341 | tmp &= ~0x0000ffff; | 340 | tmp &= ~0x0000ffff; |
| 342 | } | 341 | } |
| @@ -360,7 +359,7 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p, | |||
| 360 | { | 359 | { |
| 361 | u32 dr2 = MDR2_BITLEN1(bits) | MDR2_WDLEN1(words); | 360 | u32 dr2 = MDR2_BITLEN1(bits) | MDR2_WDLEN1(words); |
| 362 | 361 | ||
| 363 | if (tx_buf || (p->chipdata->master_flags & SPI_MASTER_MUST_TX)) | 362 | if (tx_buf || (p->master->flags & SPI_MASTER_MUST_TX)) |
| 364 | sh_msiof_write(p, TMDR2, dr2); | 363 | sh_msiof_write(p, TMDR2, dr2); |
| 365 | else | 364 | else |
| 366 | sh_msiof_write(p, TMDR2, dr2 | MDR2_GRPMASK1); | 365 | sh_msiof_write(p, TMDR2, dr2 | MDR2_GRPMASK1); |
| @@ -1152,6 +1151,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) | |||
| 1152 | { | 1151 | { |
| 1153 | struct resource *r; | 1152 | struct resource *r; |
| 1154 | struct spi_master *master; | 1153 | struct spi_master *master; |
| 1154 | const struct sh_msiof_chipdata *chipdata; | ||
| 1155 | const struct of_device_id *of_id; | 1155 | const struct of_device_id *of_id; |
| 1156 | struct sh_msiof_spi_priv *p; | 1156 | struct sh_msiof_spi_priv *p; |
| 1157 | int i; | 1157 | int i; |
| @@ -1170,10 +1170,10 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) | |||
| 1170 | 1170 | ||
| 1171 | of_id = of_match_device(sh_msiof_match, &pdev->dev); | 1171 | of_id = of_match_device(sh_msiof_match, &pdev->dev); |
| 1172 | if (of_id) { | 1172 | if (of_id) { |
| 1173 | p->chipdata = of_id->data; | 1173 | chipdata = of_id->data; |
| 1174 | p->info = sh_msiof_spi_parse_dt(&pdev->dev); | 1174 | p->info = sh_msiof_spi_parse_dt(&pdev->dev); |
| 1175 | } else { | 1175 | } else { |
| 1176 | p->chipdata = (const void *)pdev->id_entry->driver_data; | 1176 | chipdata = (const void *)pdev->id_entry->driver_data; |
| 1177 | p->info = dev_get_platdata(&pdev->dev); | 1177 | p->info = dev_get_platdata(&pdev->dev); |
| 1178 | } | 1178 | } |
| 1179 | 1179 | ||
| @@ -1217,8 +1217,8 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) | |||
| 1217 | pm_runtime_enable(&pdev->dev); | 1217 | pm_runtime_enable(&pdev->dev); |
| 1218 | 1218 | ||
| 1219 | /* Platform data may override FIFO sizes */ | 1219 | /* Platform data may override FIFO sizes */ |
| 1220 | p->tx_fifo_size = p->chipdata->tx_fifo_size; | 1220 | p->tx_fifo_size = chipdata->tx_fifo_size; |
| 1221 | p->rx_fifo_size = p->chipdata->rx_fifo_size; | 1221 | p->rx_fifo_size = chipdata->rx_fifo_size; |
| 1222 | if (p->info->tx_fifo_override) | 1222 | if (p->info->tx_fifo_override) |
| 1223 | p->tx_fifo_size = p->info->tx_fifo_override; | 1223 | p->tx_fifo_size = p->info->tx_fifo_override; |
| 1224 | if (p->info->rx_fifo_override) | 1224 | if (p->info->rx_fifo_override) |
| @@ -1227,7 +1227,7 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) | |||
| 1227 | /* init master code */ | 1227 | /* init master code */ |
| 1228 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; | 1228 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; |
| 1229 | master->mode_bits |= SPI_LSB_FIRST | SPI_3WIRE; | 1229 | master->mode_bits |= SPI_LSB_FIRST | SPI_3WIRE; |
| 1230 | master->flags = p->chipdata->master_flags; | 1230 | master->flags = chipdata->master_flags; |
| 1231 | master->bus_num = pdev->id; | 1231 | master->bus_num = pdev->id; |
| 1232 | master->dev.of_node = pdev->dev.of_node; | 1232 | master->dev.of_node = pdev->dev.of_node; |
| 1233 | master->num_chipselect = p->info->num_chipselect; | 1233 | master->num_chipselect = p->info->num_chipselect; |
