summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2019-09-21 15:12:33 +0200
committerMark Brown <broonie@kernel.org>2019-10-01 13:34:58 +0200
commit6cdcb5d394413d906773f1ae2efaa86485d6d6e1 (patch)
tree1ca97321ce6a95ee50653a9d0c403d4c3316bbb8 /drivers/spi
parentspi: mediatek: Use devm_platform_ioremap_resource() in mtk_spi_probe() (diff)
downloadlinux-6cdcb5d394413d906773f1ae2efaa86485d6d6e1.tar.xz
linux-6cdcb5d394413d906773f1ae2efaa86485d6d6e1.zip
spi: mediatek: Use devm_platform_ioremap_resource() in mtk_spi_slave_probe()
Simplify this function implementation by using a known wrapper function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Link: https://lore.kernel.org/r/225b76ca-a367-4bef-d8ce-42c7af9242a5@web.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-slave-mt27xx.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c
index 61bc43b0fe57..44edaa360405 100644
--- a/drivers/spi/spi-slave-mt27xx.c
+++ b/drivers/spi/spi-slave-mt27xx.c
@@ -368,7 +368,6 @@ static int mtk_spi_slave_probe(struct platform_device *pdev)
{
struct spi_controller *ctlr;
struct mtk_spi_slave *mdata;
- struct resource *res;
int irq, ret;
ctlr = spi_alloc_slave(&pdev->dev, sizeof(*mdata));
@@ -392,17 +391,8 @@ static int mtk_spi_slave_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ctlr);
init_completion(&mdata->xfer_done);
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- ret = -ENODEV;
- dev_err(&pdev->dev, "failed to determine base address\n");
- goto err_put_ctlr;
- }
-
mdata->dev = &pdev->dev;
-
- mdata->base = devm_ioremap_resource(&pdev->dev, res);
+ mdata->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(mdata->base)) {
ret = PTR_ERR(mdata->base);
goto err_put_ctlr;