Commit 0ef9944d authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Vinod Koul
Browse files

dmaengine: shdmac: Change platform check to CONFIG_ARCH_RENESAS



Since commit 9b5ba0df ("ARM: shmobile: Introduce ARCH_RENESAS")
is CONFIG_ARCH_RENESAS a more appropriate platform check than the legacy
CONFIG_ARCH_SHMOBILE, hence use the former.

Renesas SuperH SH-Mobile SoCs are still covered by the CONFIG_CPU_SH4
check, just like before support for Renesas ARM SoCs was added.

Instead of blindly changing all the #ifdefs, switch the main code block
in sh_dmae_probe() to IS_ENABLED(), as this allows to remove all the
remaining #ifdefs.

This will allow to drop ARCH_SHMOBILE on ARM in the near future.

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 60cc43fc
Loading
Loading
Loading
Loading
+21 −29
Original line number Diff line number Diff line
@@ -443,7 +443,6 @@ static bool sh_dmae_reset(struct sh_dmae_device *shdev)
	return ret;
}

#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
static irqreturn_t sh_dmae_err(int irq, void *data)
{
	struct sh_dmae_device *shdev = data;
@@ -454,7 +453,6 @@ static irqreturn_t sh_dmae_err(int irq, void *data)
	sh_dmae_reset(shdev);
	return IRQ_HANDLED;
}
#endif

static bool sh_dmae_desc_completed(struct shdma_chan *schan,
				   struct shdma_desc *sdesc)
@@ -686,11 +684,8 @@ static int sh_dmae_probe(struct platform_device *pdev)
	const struct sh_dmae_pdata *pdata;
	unsigned long chan_flag[SH_DMAE_MAX_CHANNELS] = {};
	int chan_irq[SH_DMAE_MAX_CHANNELS];
#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
	unsigned long irqflags = 0;
	int errirq;
#endif
	int err, i, irq_cnt = 0, irqres = 0, irq_cap = 0;
	int err, errirq, i, irq_cnt = 0, irqres = 0, irq_cap = 0;
	struct sh_dmae_device *shdev;
	struct dma_device *dma_dev;
	struct resource *chan, *dmars, *errirq_res, *chanirq_res;
@@ -792,7 +787,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
	if (err)
		goto rst_err;

#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
	if (IS_ENABLED(CONFIG_CPU_SH4) || IS_ENABLED(CONFIG_ARCH_RENESAS)) {
		chanirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 1);

		if (!chanirq_res)
@@ -806,18 +801,17 @@ static int sh_dmae_probe(struct platform_device *pdev)

		errirq = errirq_res->start;

	err = devm_request_irq(&pdev->dev, errirq, sh_dmae_err, irqflags,
			       "DMAC Address Error", shdev);
		err = devm_request_irq(&pdev->dev, errirq, sh_dmae_err,
				       irqflags, "DMAC Address Error", shdev);
		if (err) {
			dev_err(&pdev->dev,
				"DMA failed requesting irq #%d, error %d\n",
				errirq, err);
			goto eirq_err;
		}

#else
	} else {
		chanirq_res = errirq_res;
#endif /* CONFIG_CPU_SH4 || CONFIG_ARCH_SHMOBILE */
	}

	if (chanirq_res->start == chanirq_res->end &&
	    !platform_get_resource(pdev, IORESOURCE_IRQ, 1)) {
@@ -884,9 +878,7 @@ edmadevreg:
chan_probe_err:
	sh_dmae_chan_remove(shdev);

#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE)
eirq_err:
#endif
rst_err:
	spin_lock_irq(&sh_dmae_lock);
	list_del_rcu(&shdev->node);