Commit aa62325d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'spi-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "The big theme for this release has been performance, we've had a
  series of unrelated overhauls of a few drivers all with a big
  peformance component.

  Otherwise it's been relatively quiet, highlights include:

   - A big overhaul of the spi-fsl-dspi driver improving the code
     quality, performance and stability from Vladimir Oltean.

   - A big performance enhancement for the bc2835 (Raspberry Pi) driver
     for unidirectional transfers from Lukas Wunner.

   - Improved performance on small transfers for the uniphier driver
     from Keiji Hayashibara.

   - Lots of coccinelle generated cleanups from Yue Haibing.

   - New device support for Freescale ls2080a and Nuvoton NPCM FIU"

* tag 'spi-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (102 commits)
  spi: mediatek: support large PA
  spi: mediatek: add spi support for mt6765 IC
  dt-bindings: spi: update bindings for MT6765 SoC
  spi: bcm2835: Speed up RX-only DMA transfers by zero-filling TX FIFO
  spi: bcm2835: Speed up TX-only DMA transfers by clearing RX FIFO
  dmaengine: bcm2835: Avoid accessing memory when copying zeroes
  spi: bcm2835: Cache CS register value for ->prepare_message()
  dmaengine: bcm2835: Document struct bcm2835_dmadev
  spi: Guarantee cacheline alignment of driver-private data
  dmaengine: bcm2835: Allow reusable descriptors
  dmaengine: bcm2835: Allow cyclic transactions without interrupt
  spi: bcm2835: Drop dma_pending flag
  spi: bcm2835: Work around DONE bit erratum
  spi-gpio: Use PTR_ERR_OR_ZERO() in spi_gpio_request()
  spi: Use an abbreviated pointer to ctlr->cur_msg in __spi_pump_messages
  spi: npcm-fiu: remove set but not used variable 'retlen'
  spi: fsl-spi: use devm_platform_ioremap_resource() to simplify code
  spi: zynq-qspi: use devm_platform_ioremap_resource() to simplify code
  spi: zynqmp: use devm_platform_ioremap_resource() to simplify code
  spi: xlp: use devm_platform_ioremap_resource() to simplify code
  ...
parents c4d11ccb b769c5ba
...@@ -185,7 +185,6 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) ...@@ -185,7 +185,6 @@ spi_lp8841_rtc_probe(struct platform_device *pdev)
int ret; int ret;
struct spi_master *master; struct spi_master *master;
struct spi_lp8841_rtc *data; struct spi_lp8841_rtc *data;
void *iomem;
master = spi_alloc_master(&pdev->dev, sizeof(*data)); master = spi_alloc_master(&pdev->dev, sizeof(*data));
if (!master) if (!master)
...@@ -207,8 +206,7 @@ spi_lp8841_rtc_probe(struct platform_device *pdev) ...@@ -207,8 +206,7 @@ spi_lp8841_rtc_probe(struct platform_device *pdev)
data = spi_master_get_devdata(master); data = spi_master_get_devdata(master);
iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); data->iomem = devm_platform_ioremap_resource(pdev, 0);
data->iomem = devm_ioremap_resource(&pdev->dev, iomem);
ret = PTR_ERR_OR_ZERO(data->iomem); ret = PTR_ERR_OR_ZERO(data->iomem);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to get IO address\n"); dev_err(&pdev->dev, "failed to get IO address\n");
......
...@@ -503,7 +503,6 @@ static int meson_spicc_probe(struct platform_device *pdev) ...@@ -503,7 +503,6 @@ static int meson_spicc_probe(struct platform_device *pdev)
{ {
struct spi_master *master; struct spi_master *master;
struct meson_spicc_device *spicc; struct meson_spicc_device *spicc;
struct resource *res;
int ret, irq, rate; int ret, irq, rate;
master = spi_alloc_master(&pdev->dev, sizeof(*spicc)); master = spi_alloc_master(&pdev->dev, sizeof(*spicc));
...@@ -517,8 +516,7 @@ static int meson_spicc_probe(struct platform_device *pdev) ...@@ -517,8 +516,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
spicc->pdev = pdev; spicc->pdev = pdev;
platform_set_drvdata(pdev, spicc); platform_set_drvdata(pdev, spicc);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); spicc->base = devm_platform_ioremap_resource(pdev, 0);
spicc->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(spicc->base)) { if (IS_ERR(spicc->base)) {
dev_err(&pdev->dev, "io resource mapping failed\n"); dev_err(&pdev->dev, "io resource mapping failed\n");
ret = PTR_ERR(spicc->base); ret = PTR_ERR(spicc->base);
......
...@@ -286,7 +286,6 @@ static int meson_spifc_probe(struct platform_device *pdev) ...@@ -286,7 +286,6 @@ static int meson_spifc_probe(struct platform_device *pdev)
{ {
struct spi_master *master; struct spi_master *master;
struct meson_spifc *spifc; struct meson_spifc *spifc;
struct resource *res;
void __iomem *base; void __iomem *base;
unsigned int rate; unsigned int rate;
int ret = 0; int ret = 0;
...@@ -300,8 +299,7 @@ static int meson_spifc_probe(struct platform_device *pdev) ...@@ -300,8 +299,7 @@ static int meson_spifc_probe(struct platform_device *pdev)
spifc = spi_master_get_devdata(master); spifc = spi_master_get_devdata(master);
spifc->dev = &pdev->dev; spifc->dev = &pdev->dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(spifc->dev, res);
if (IS_ERR(base)) { if (IS_ERR(base)) {
ret = PTR_ERR(base); ret = PTR_ERR(base);
goto out_err; goto out_err;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/platform_data/spi-mt65xx.h> #include <linux/platform_data/spi-mt65xx.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/dma-mapping.h>
#define SPI_CFG0_REG 0x0000 #define SPI_CFG0_REG 0x0000
#define SPI_CFG1_REG 0x0004 #define SPI_CFG1_REG 0x0004
...@@ -28,6 +29,8 @@ ...@@ -28,6 +29,8 @@
#define SPI_STATUS0_REG 0x001c #define SPI_STATUS0_REG 0x001c
#define SPI_PAD_SEL_REG 0x0024 #define SPI_PAD_SEL_REG 0x0024
#define SPI_CFG2_REG 0x0028 #define SPI_CFG2_REG 0x0028
#define SPI_TX_SRC_REG_64 0x002c
#define SPI_RX_DST_REG_64 0x0030
#define SPI_CFG0_SCK_HIGH_OFFSET 0 #define SPI_CFG0_SCK_HIGH_OFFSET 0
#define SPI_CFG0_SCK_LOW_OFFSET 8 #define SPI_CFG0_SCK_LOW_OFFSET 8
...@@ -73,6 +76,10 @@ ...@@ -73,6 +76,10 @@
#define MTK_SPI_MAX_FIFO_SIZE 32U #define MTK_SPI_MAX_FIFO_SIZE 32U
#define MTK_SPI_PACKET_SIZE 1024 #define MTK_SPI_PACKET_SIZE 1024
#define MTK_SPI_32BITS_MASK (0xffffffff)
#define DMA_ADDR_EXT_BITS (36)
#define DMA_ADDR_DEF_BITS (32)
struct mtk_spi_compatible { struct mtk_spi_compatible {
bool need_pad_sel; bool need_pad_sel;
...@@ -80,6 +87,8 @@ struct mtk_spi_compatible { ...@@ -80,6 +87,8 @@ struct mtk_spi_compatible {
bool must_tx; bool must_tx;
/* some IC design adjust cfg register to enhance time accuracy */ /* some IC design adjust cfg register to enhance time accuracy */
bool enhance_timing; bool enhance_timing;
/* some IC support DMA addr extension */
bool dma_ext;
}; };
struct mtk_spi { struct mtk_spi {
...@@ -102,6 +111,13 @@ static const struct mtk_spi_compatible mt2712_compat = { ...@@ -102,6 +111,13 @@ static const struct mtk_spi_compatible mt2712_compat = {
.must_tx = true, .must_tx = true,
}; };
static const struct mtk_spi_compatible mt6765_compat = {
.need_pad_sel = true,
.must_tx = true,
.enhance_timing = true,
.dma_ext = true,
};
static const struct mtk_spi_compatible mt7622_compat = { static const struct mtk_spi_compatible mt7622_compat = {
.must_tx = true, .must_tx = true,
.enhance_timing = true, .enhance_timing = true,
...@@ -137,6 +153,9 @@ static const struct of_device_id mtk_spi_of_match[] = { ...@@ -137,6 +153,9 @@ static const struct of_device_id mtk_spi_of_match[] = {
{ .compatible = "mediatek,mt6589-spi", { .compatible = "mediatek,mt6589-spi",
.data = (void *)&mtk_common_compat, .data = (void *)&mtk_common_compat,
}, },
{ .compatible = "mediatek,mt6765-spi",
.data = (void *)&mt6765_compat,
},
{ .compatible = "mediatek,mt7622-spi", { .compatible = "mediatek,mt7622-spi",
.data = (void *)&mt7622_compat, .data = (void *)&mt7622_compat,
}, },
...@@ -371,10 +390,25 @@ static void mtk_spi_setup_dma_addr(struct spi_master *master, ...@@ -371,10 +390,25 @@ static void mtk_spi_setup_dma_addr(struct spi_master *master,
{ {
struct mtk_spi *mdata = spi_master_get_devdata(master); struct mtk_spi *mdata = spi_master_get_devdata(master);
if (mdata->tx_sgl) if (mdata->tx_sgl) {
writel(xfer->tx_dma, mdata->base + SPI_TX_SRC_REG); writel((u32)(xfer->tx_dma & MTK_SPI_32BITS_MASK),
if (mdata->rx_sgl) mdata->base + SPI_TX_SRC_REG);
writel(xfer->rx_dma, mdata->base + SPI_RX_DST_REG); #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
if (mdata->dev_comp->dma_ext)
writel((u32)(xfer->tx_dma >> 32),
mdata->base + SPI_TX_SRC_REG_64);
#endif
}
if (mdata->rx_sgl) {
writel((u32)(xfer->rx_dma & MTK_SPI_32BITS_MASK),
mdata->base + SPI_RX_DST_REG);
#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
if (mdata->dev_comp->dma_ext)
writel((u32)(xfer->rx_dma >> 32),
mdata->base + SPI_RX_DST_REG_64);
#endif
}
} }
static int mtk_spi_fifo_transfer(struct spi_master *master, static int mtk_spi_fifo_transfer(struct spi_master *master,
...@@ -586,7 +620,7 @@ static int mtk_spi_probe(struct platform_device *pdev) ...@@ -586,7 +620,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
struct mtk_spi *mdata; struct mtk_spi *mdata;
const struct of_device_id *of_id; const struct of_device_id *of_id;
struct resource *res; struct resource *res;
int i, irq, ret; int i, irq, ret, addr_bits;
master = spi_alloc_master(&pdev->dev, sizeof(*mdata)); master = spi_alloc_master(&pdev->dev, sizeof(*mdata));
if (!master) { if (!master) {
...@@ -664,7 +698,6 @@ static int mtk_spi_probe(struct platform_device *pdev) ...@@ -664,7 +698,6 @@ static int mtk_spi_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "failed to get irq (%d)\n", irq);
ret = irq; ret = irq;
goto err_put_master; goto err_put_master;
} }
...@@ -753,6 +786,15 @@ static int mtk_spi_probe(struct platform_device *pdev) ...@@ -753,6 +786,15 @@ static int mtk_spi_probe(struct platform_device *pdev)
} }
} }
if (mdata->dev_comp->dma_ext)
addr_bits = DMA_ADDR_EXT_BITS;
else
addr_bits = DMA_ADDR_DEF_BITS;
ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(addr_bits));
if (ret)
dev_notice(&pdev->dev, "SPI dma_set_mask(%d) failed, ret:%d\n",
addr_bits, ret);
return 0; return 0;
err_disable_runtime_pm: err_disable_runtime_pm:
......
...@@ -327,7 +327,6 @@ static int mt7621_spi_probe(struct platform_device *pdev) ...@@ -327,7 +327,6 @@ static int mt7621_spi_probe(struct platform_device *pdev)
struct spi_controller *master; struct spi_controller *master;
struct mt7621_spi *rs; struct mt7621_spi *rs;
void __iomem *base; void __iomem *base;
struct resource *r;
int status = 0; int status = 0;
struct clk *clk; struct clk *clk;
int ret; int ret;
...@@ -336,8 +335,7 @@ static int mt7621_spi_probe(struct platform_device *pdev) ...@@ -336,8 +335,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
if (!match) if (!match)
return -EINVAL; return -EINVAL;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
...@@ -532,7 +532,6 @@ static int mxs_spi_probe(struct platform_device *pdev) ...@@ -532,7 +532,6 @@ static int mxs_spi_probe(struct platform_device *pdev)
struct spi_master *master; struct spi_master *master;
struct mxs_spi *spi; struct mxs_spi *spi;
struct mxs_ssp *ssp; struct mxs_ssp *ssp;
struct resource *iores;
struct clk *clk; struct clk *clk;
void __iomem *base; void __iomem *base;
int devid, clk_freq; int devid, clk_freq;
...@@ -545,12 +544,11 @@ static int mxs_spi_probe(struct platform_device *pdev) ...@@ -545,12 +544,11 @@ static int mxs_spi_probe(struct platform_device *pdev)
*/ */
const int clk_freq_default = 160000000; const int clk_freq_default = 160000000;
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq_err = platform_get_irq(pdev, 0); irq_err = platform_get_irq(pdev, 0);
if (irq_err < 0) if (irq_err < 0)
return irq_err; return irq_err;
base = devm_ioremap_resource(&pdev->dev, iores); base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
This diff is collapsed.
...@@ -341,7 +341,6 @@ static int npcm_pspi_probe(struct platform_device *pdev) ...@@ -341,7 +341,6 @@ static int npcm_pspi_probe(struct platform_device *pdev)
{ {
struct npcm_pspi *priv; struct npcm_pspi *priv;
struct spi_master *master; struct spi_master *master;
struct resource *res;
unsigned long clk_hz; unsigned long clk_hz;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
int num_cs, i; int num_cs, i;
...@@ -368,8 +367,7 @@ static int npcm_pspi_probe(struct platform_device *pdev) ...@@ -368,8 +367,7 @@ static int npcm_pspi_probe(struct platform_device *pdev)
priv->is_save_param = false; priv->is_save_param = false;
priv->id = pdev->id; priv->id = pdev->id;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->base = devm_platform_ioremap_resource(pdev, 0);
priv->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {
ret = PTR_ERR(priv->base); ret = PTR_ERR(priv->base);
goto out_master_put; goto out_master_put;
...@@ -388,7 +386,6 @@ static int npcm_pspi_probe(struct platform_device *pdev) ...@@ -388,7 +386,6 @@ static int npcm_pspi_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "failed to get IRQ\n");
ret = irq; ret = irq;
goto out_disable_clk; goto out_disable_clk;
} }
......
...@@ -327,7 +327,6 @@ static int nuc900_spi_probe(struct platform_device *pdev) ...@@ -327,7 +327,6 @@ static int nuc900_spi_probe(struct platform_device *pdev)
{ {
struct nuc900_spi *hw; struct nuc900_spi *hw;
struct spi_master *master; struct spi_master *master;
struct resource *res;
int err = 0; int err = 0;
master = spi_alloc_master(&pdev->dev, sizeof(struct nuc900_spi)); master = spi_alloc_master(&pdev->dev, sizeof(struct nuc900_spi));
...@@ -358,8 +357,7 @@ static int nuc900_spi_probe(struct platform_device *pdev) ...@@ -358,8 +357,7 @@ static int nuc900_spi_probe(struct platform_device *pdev)
hw->bitbang.chipselect = nuc900_spi_chipsel; hw->bitbang.chipselect = nuc900_spi_chipsel;
hw->bitbang.txrx_bufs = nuc900_spi_txrx; hw->bitbang.txrx_bufs = nuc900_spi_txrx;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hw->regs = devm_platform_ioremap_resource(pdev, 0);
hw->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hw->regs)) { if (IS_ERR(hw->regs)) {
err = PTR_ERR(hw->regs); err = PTR_ERR(hw->regs);
goto err_pdata; goto err_pdata;
...@@ -367,7 +365,6 @@ static int nuc900_spi_probe(struct platform_device *pdev) ...@@ -367,7 +365,6 @@ static int nuc900_spi_probe(struct platform_device *pdev)
hw->irq = platform_get_irq(pdev, 0); hw->irq = platform_get_irq(pdev, 0);
if (hw->irq < 0) { if (hw->irq < 0) {
dev_err(&pdev->dev, "No IRQ specified\n");
err = -ENOENT; err = -ENOENT;
goto err_pdata; goto err_pdata;
} }
......
...@@ -1007,10 +1007,8 @@ static int nxp_fspi_probe(struct platform_device *pdev) ...@@ -1007,10 +1007,8 @@ static int nxp_fspi_probe(struct platform_device *pdev)
/* find the irq */ /* find the irq */
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(dev, "failed to get the irq: %d\n", ret);
goto err_disable_clk; goto err_disable_clk;
}
ret = devm_request_irq(dev, ret, ret = devm_request_irq(dev, ret,
nxp_fspi_irq_handler, 0, pdev->name, f); nxp_fspi_irq_handler, 0, pdev->name, f);
......
...@@ -240,7 +240,6 @@ static int tiny_spi_probe(struct platform_device *pdev) ...@@ -240,7 +240,6 @@ static int tiny_spi_probe(struct platform_device *pdev)
struct tiny_spi_platform_data *platp = dev_get_platdata(&pdev->dev); struct tiny_spi_platform_data *platp = dev_get_platdata(&pdev->dev);
struct tiny_spi *hw; struct tiny_spi *hw;
struct spi_master *master; struct spi_master *master;
struct resource *res;
unsigned int i; unsigned int i;
int err = -ENODEV; int err = -ENODEV;
...@@ -264,8 +263,7 @@ static int tiny_spi_probe(struct platform_device *pdev) ...@@ -264,8 +263,7 @@ static int tiny_spi_probe(struct platform_device *pdev)
hw->bitbang.txrx_bufs = tiny_spi_txrx_bufs; hw->bitbang.txrx_bufs = tiny_spi_txrx_bufs;
/* find and map our resources */ /* find and map our resources */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hw->base = devm_platform_ioremap_resource(pdev, 0);
hw->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hw->base)) { if (IS_ERR(hw->base)) {
err = PTR_ERR(hw->base); err = PTR_ERR(hw->base);
goto exit; goto exit;
......
...@@ -570,7 +570,6 @@ static int pic32_sqi_probe(struct platform_device *pdev) ...@@ -570,7 +570,6 @@ static int pic32_sqi_probe(struct platform_device *pdev)
{ {
struct spi_master *master; struct spi_master *master;
struct pic32_sqi *sqi; struct pic32_sqi *sqi;
struct resource *reg;
int ret; int ret;
master = spi_alloc_master(&pdev->dev, sizeof(*sqi)); master = spi_alloc_master(&pdev->dev, sizeof(*sqi));
...@@ -580,8 +579,7 @@ static int pic32_sqi_probe(struct platform_device *pdev) ...@@ -580,8 +579,7 @@ static int pic32_sqi_probe(struct platform_device *pdev)
sqi = spi_master_get_devdata(master); sqi = spi_master_get_devdata(master);
sqi->master = master; sqi->master = master;
reg = platform_get_resource(pdev, IORESOURCE_MEM, 0); sqi->regs = devm_platform_ioremap_resource(pdev, 0);
sqi->regs = devm_ioremap_resource(&pdev->dev, reg);
if (IS_ERR(sqi->regs)) { if (IS_ERR(sqi->regs)) {
ret = PTR_ERR(sqi->regs); ret = PTR_ERR(sqi->regs);
goto err_free_master; goto err_free_master;
...@@ -590,7 +588,6 @@ static int pic32_sqi_probe(struct platform_device *pdev) ...@@ -590,7 +588,6 @@ static int pic32_sqi_probe(struct platform_device *pdev)
/* irq */ /* irq */
sqi->irq = platform_get_irq(pdev, 0); sqi->irq = platform_get_irq(pdev, 0);
if (sqi->irq < 0) { if (sqi->irq < 0) {
dev_err(&pdev->dev, "no irq found\n");
ret = sqi->irq; ret = sqi->irq;
goto err_free_master; goto err_free_master;
} }
......
...@@ -711,22 +711,16 @@ static int pic32_spi_hw_probe(struct platform_device *pdev, ...@@ -711,22 +711,16 @@ static int pic32_spi_hw_probe(struct platform_device *pdev,
/* get irq resources: err-irq, rx-irq, tx-irq */ /* get irq resources: err-irq, rx-irq, tx-irq */
pic32s->fault_irq = platform_get_irq_byname(pdev, "fault"); pic32s->fault_irq = platform_get_irq_byname(pdev, "fault");
if (pic32s->fault_irq < 0) { if (pic32s->fault_irq < 0)
dev_err(&pdev->dev, "fault-irq not found\n");
return pic32s->fault_irq; return pic32s->fault_irq;
}
pic32s->rx_irq = platform_get_irq_byname(pdev, "rx"); pic32s->rx_irq = platform_get_irq_byname(pdev, "rx");
if (pic32s->rx_irq < 0) { if (pic32s->rx_irq < 0)
dev_err(&pdev->dev, "rx-irq not found\n");
return pic32s->rx_irq; return pic32s->rx_irq;
}
pic32s->tx_irq = platform_get_irq_byname(pdev, "tx"); pic32s->tx_irq = platform_get_irq_byname(pdev, "tx");
if (pic32s->tx_irq < 0) { if (pic32s->tx_irq < 0)
dev_err(&pdev->dev, "tx-irq not found\n");
return pic32s->tx_irq; return pic32s->tx_irq;
}
/* get clock */ /* get clock */
pic32s->clk = devm_clk_get(&pdev->dev, "mck0"); pic32s->clk = devm_clk_get(&pdev->dev, "mck0");
......
...@@ -424,7 +424,6 @@ static int qcom_qspi_probe(struct platform_device *pdev) ...@@ -424,7 +424,6 @@ static int qcom_qspi_probe(struct platform_device *pdev)
{ {
int ret; int ret;
struct device *dev; struct device *dev;
struct resource *res;
struct spi_master *master; struct spi_master *master;
struct qcom_qspi *ctrl; struct qcom_qspi *ctrl;
...@@ -440,8 +439,7 @@ static int qcom_qspi_probe(struct platform_device *pdev) ...@@ -440,8 +439,7 @@ static int qcom_qspi_probe(struct platform_device *pdev)
spin_lock_init(&ctrl->lock); spin_lock_init(&ctrl->lock);
ctrl->dev = dev; ctrl->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctrl->base = devm_platform_ioremap_resource(pdev, 0);
ctrl->base = devm_ioremap_resource(dev, res);
if (IS_ERR(ctrl->base)) { if (IS_ERR(ctrl->base)) {
ret = PTR_ERR(ctrl->base); ret = PTR_ERR(ctrl->base);
goto exit_probe_master_put; goto exit_probe_master_put;
...@@ -454,10 +452,8 @@ static int qcom_qspi_probe(struct platform_device *pdev) ...@@ -454,10 +452,8 @@ static int qcom_qspi_probe(struct platform_device *pdev)
goto exit_probe_master_put; goto exit_probe_master_put;
ret = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0) { if (ret < 0)
dev_err(dev, "Failed to get irq %d\n", ret);
goto exit_probe_master_put; goto exit_probe_master_put;
}
ret = devm_request_irq(dev, ret, qcom_qspi_irq, ret = devm_request_irq(dev, ret, qcom_qspi_irq,
IRQF_TRIGGER_HIGH, dev_name(dev), ctrl); IRQF_TRIGGER_HIGH, dev_name(dev), ctrl);
if (ret) { if (ret) {
......
...@@ -135,12 +135,10 @@ static int rb4xx_spi_probe(struct platform_device *pdev) ...@@ -135,12 +135,10 @@ static int rb4xx_spi_probe(struct platform_device *pdev)
struct spi_master *master; struct spi_master *master;
struct clk *ahb_clk; struct clk *ahb_clk;
struct rb4xx_spi *rbspi; struct rb4xx_spi *rbspi;
struct resource *r;
int err; int err;
void __iomem *spi_base; void __iomem *spi_base;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0); spi_base = devm_platform_ioremap_resource(pdev, 0);
spi_base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(spi_base)) if (IS_ERR(spi_base))
return PTR_ERR(spi_base); return PTR_ERR(spi_base);
......
...@@ -487,7 +487,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev) ...@@ -487,7 +487,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev)
struct s3c2410_spi_info *pdata; struct s3c2410_spi_info *pdata;
struct s3c24xx_spi *hw; struct s3c24xx_spi *hw;
struct spi_master *master; struct spi_master *master;
struct resource *res;
int err = 0; int err = 0;
master = spi_alloc_master(&pdev->dev, sizeof(struct s3c24xx_spi)); master = spi_alloc_master(&pdev->dev, sizeof(struct s3c24xx_spi));
...@@ -536,8 +535,7 @@ static int s3c24xx_spi_probe(struct platform_device *pdev) ...@@ -536,8 +535,7 @@ static int s3c24xx_spi_probe(struct platform_device *pdev)
dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang); dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang);
/* find and map our resources */