Commit ab300d18 authored by Jonas Gorski's avatar Jonas Gorski Committed by Mark Brown

spi/bcm63xx: remove unused speed_hz variable

speed_hz is a write only member, so we can safely remove it and its
generation. Also fixes the missing clk_put after getting the periph
clock.
Signed-off-by: default avatarJonas Gorski <jogo@openwrt.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 8b0bebe2
...@@ -85,20 +85,9 @@ static struct platform_device bcm63xx_spi_device = { ...@@ -85,20 +85,9 @@ static struct platform_device bcm63xx_spi_device = {
int __init bcm63xx_spi_register(void) int __init bcm63xx_spi_register(void)
{ {
struct clk *periph_clk;
if (BCMCPU_IS_6328() || BCMCPU_IS_6345()) if (BCMCPU_IS_6328() || BCMCPU_IS_6345())
return -ENODEV; return -ENODEV;
periph_clk = clk_get(NULL, "periph");
if (IS_ERR(periph_clk)) {
pr_err("unable to get periph clock\n");
return -ENODEV;
}
/* Set bus frequency */
spi_pdata.speed_hz = clk_get_rate(periph_clk);
spi_resources[0].start = bcm63xx_regset_address(RSET_SPI); spi_resources[0].start = bcm63xx_regset_address(RSET_SPI);
spi_resources[0].end = spi_resources[0].start; spi_resources[0].end = spi_resources[0].start;
spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI);
......
...@@ -13,7 +13,6 @@ struct bcm63xx_spi_pdata { ...@@ -13,7 +13,6 @@ struct bcm63xx_spi_pdata {
unsigned int msg_ctl_width; unsigned int msg_ctl_width;
int bus_num; int bus_num;
int num_chipselect; int num_chipselect;
u32 speed_hz;
}; };
enum bcm63xx_regs_spi { enum bcm63xx_regs_spi {
......
...@@ -46,7 +46,6 @@ struct bcm63xx_spi { ...@@ -46,7 +46,6 @@ struct bcm63xx_spi {
int irq; int irq;
/* Platform data */ /* Platform data */
u32 speed_hz;
unsigned fifo_size; unsigned fifo_size;
unsigned int msg_type_shift; unsigned int msg_type_shift;
unsigned int msg_ctl_width; unsigned int msg_ctl_width;
...@@ -436,7 +435,6 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) ...@@ -436,7 +435,6 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
master->unprepare_transfer_hardware = bcm63xx_spi_unprepare_transfer; master->unprepare_transfer_hardware = bcm63xx_spi_unprepare_transfer;
master->transfer_one_message = bcm63xx_spi_transfer_one; master->transfer_one_message = bcm63xx_spi_transfer_one;
master->mode_bits = MODEBITS; master->mode_bits = MODEBITS;
bs->speed_hz = pdata->speed_hz;
bs->msg_type_shift = pdata->msg_type_shift; bs->msg_type_shift = pdata->msg_type_shift;
bs->msg_ctl_width = pdata->msg_ctl_width; bs->msg_ctl_width = pdata->msg_ctl_width;
bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA)); bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment