diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2021-02-07 15:46:47 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2021-02-07 15:47:04 +0200 |
commit | 1a1cc3d6bcfe9636eed3abf719bd27f5532f4ddd (patch) | |
tree | 5fbd48aeb13c3b49255dfa71d4423b27d3464997 /drivers/spi | |
parent | 0c2a5838a4964533d885f646814fce22c8e813f0 (diff) | |
parent | 32ed4c6cace37c492b7deacdf3fa223618b1ad2e (diff) |
Merge remote-tracking branch 'msm8998/lineage-18.1' into lineage-18.1
Conflicts:
drivers/iio/adc/qcom-rradc.c
drivers/power/supply/qcom/fg-core.h
drivers/power/supply/qcom/fg-memif.c
drivers/power/supply/qcom/fg-reg.h
drivers/power/supply/qcom/fg-util.c
drivers/power/supply/qcom/qpnp-fg-gen3.c
include/linux/power_supply.h
Change-Id: Ia9367e04097cacda9c8cb3568e7e8916474b7205
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-cadence.c | 6 | ||||
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c index 5a6749881ff9..05b5df04f3b8 100644 --- a/drivers/spi/spi-cadence.c +++ b/drivers/spi/spi-cadence.c @@ -116,6 +116,7 @@ struct cdns_spi { void __iomem *regs; struct clk *ref_clk; struct clk *pclk; + unsigned int clk_rate; u32 speed_hz; const u8 *txbuf; u8 *rxbuf; @@ -257,7 +258,7 @@ static void cdns_spi_config_clock_freq(struct spi_device *spi, u32 ctrl_reg, baud_rate_val; unsigned long frequency; - frequency = clk_get_rate(xspi->ref_clk); + frequency = xspi->clk_rate; ctrl_reg = cdns_spi_read(xspi, CDNS_SPI_CR_OFFSET); @@ -557,8 +558,9 @@ static int cdns_spi_probe(struct platform_device *pdev) master->set_cs = cdns_spi_chipselect; master->mode_bits = SPI_CPOL | SPI_CPHA; + xspi->clk_rate = clk_get_rate(xspi->ref_clk); /* Set to default valid value */ - master->max_speed_hz = clk_get_rate(xspi->ref_clk) / 4; + master->max_speed_hz = xspi->clk_rate / 4; xspi->speed_hz = master->max_speed_hz; master->bits_per_word_mask = SPI_BPW_MASK(8); diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index cfcc5a9a5cc9..d696cdd961a9 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1479,7 +1479,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) return -ENODEV; } - master = spi_alloc_master(dev, sizeof(struct driver_data)); + master = devm_spi_alloc_master(dev, sizeof(*drv_data)); if (!master) { dev_err(&pdev->dev, "cannot alloc spi_master\n"); pxa_ssp_free(ssp); @@ -1619,7 +1619,6 @@ out_error_clock_enabled: free_irq(ssp->irq, drv_data); out_error_master_alloc: - spi_master_put(master); pxa_ssp_free(ssp); return status; } |