Received: by 10.192.165.148 with SMTP id m20csp269254imm; Fri, 20 Apr 2018 06:33:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx48/4kFzhtKRu0x0f+Dv+QxVmRYAw/2M0l3bzeEdOTtg9W7nVEWUrzBhXU5N16sbChwJOkvX X-Received: by 10.99.116.76 with SMTP id e12mr8583412pgn.270.1524231203010; Fri, 20 Apr 2018 06:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524231202; cv=none; d=google.com; s=arc-20160816; b=UaaqA/92DUoTJ34fCLziVHlaaD6EI1auLLuv+hEKG7bOxx726ilNIFA/kGp3jYKE7B YJOEMBUYwMogRydQ/0G54p9PJ6yxebMg1G21KkYt12VAL0Mori1hUywxbLIdoEsvxujS hTY1jXHjEtFWidNthoMoyjFMBifw2gbtXAZgbSyNCJ8mfgK1Gm1uDwLlO1l689s2dGvV pHdlx0/fQi8drOQIPL16UyUYP9djf2hfU4VFTsOUmVLCiIRf7Hj8GpV4RjP3Azz2WNRF lxVBlRS+1Wvs7sNMBo0ShpV8G48r71oNXmrUEgDLq6Cg8ILrmggU8EqwlxkYQhPXgKR1 7TYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=eO3laowHLK8ghYkPoNu6DZZcu6ch4GVRYPuoxr54c9s=; b=FLpcv6fCrDTiO9IQXC1dm7gxUA1rxghRbxeEU1ZQvYHl/N2rES4r+jClKJorIFztnx iKqjCQx/Opm/zsulxMwLPkwIc+dGuqmcLQaKkAbqUM+MeUMZp1Mdf6yic6YQJxIqEV1a couAsm+gSfdJR047IzPyJm7WDxfVB79PT/ehsOPmob8/Lgg/+dQpycQYALJDWAVVz0To Tl40+kZNnCzkAYu0NUivTJIhnzobvhVL1+6tnTb+1VQ21d3wv7X8KAm64TsmDRt+n7Jp BQjmcvScHSzGQ/mENhJxwi5e+lqiLH7WB4CJoXECxJV68iE9bfZSSuZ3qJrzt6YtCXTW Chzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2si4764065pgu.655.2018.04.20.06.33.08; Fri, 20 Apr 2018 06:33:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755186AbeDTN37 (ORCPT + 99 others); Fri, 20 Apr 2018 09:29:59 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:36074 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755063AbeDTN3A (ORCPT ); Fri, 20 Apr 2018 09:29:00 -0400 Received: from ayla.of.borg ([84.194.111.163]) by laurent.telenet-ops.be with bizsmtp id cdUc1x0083XaVaC01dUc9L; Fri, 20 Apr 2018 15:28:59 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1f9W5b-0000au-VR; Fri, 20 Apr 2018 15:28:35 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1f9W5b-0002f5-Tm; Fri, 20 Apr 2018 15:28:35 +0200 From: Geert Uytterhoeven To: Simon Horman , Magnus Damm , Russell King , Catalin Marinas , Will Deacon , Dan Williams , Vinod Koul , Mauro Carvalho Chehab , Sergei Shtylyov , "David S . Miller" , Greg Kroah-Hartman , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Arnd Bergmann , Kuninori Morimoto , Laurent Pinchart Cc: linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-media@vger.kernel.org, netdev@vger.kernel.org, devel@driverdev.osuosl.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/8] dmaengine: shdmac: Change platform check to CONFIG_ARCH_RENESAS Date: Fri, 20 Apr 2018 15:28:28 +0200 Message-Id: <1524230914-10175-3-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524230914-10175-1-git-send-email-geert+renesas@glider.be> References: <1524230914-10175-1-git-send-email-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 9b5ba0df4ea4f940 ("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: Geert Uytterhoeven --- drivers/dma/sh/shdmac.c | 50 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c index 516f5487cc44cf96..8fcaae482ce0949a 100644 --- a/drivers/dma/sh/shdmac.c +++ b/drivers/dma/sh/shdmac.c @@ -440,7 +440,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; @@ -451,7 +450,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) @@ -683,11 +681,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; @@ -789,33 +784,32 @@ static int sh_dmae_probe(struct platform_device *pdev) if (err) goto rst_err; -#if defined(CONFIG_CPU_SH4) || defined(CONFIG_ARCH_SHMOBILE) - chanirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); + if (IS_ENABLED(CONFIG_CPU_SH4) || IS_ENABLED(CONFIG_ARCH_RENESAS)) { + chanirq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); - if (!chanirq_res) - chanirq_res = errirq_res; - else - irqres++; + if (!chanirq_res) + chanirq_res = errirq_res; + else + irqres++; - if (chanirq_res == errirq_res || - (errirq_res->flags & IORESOURCE_BITS) == IORESOURCE_IRQ_SHAREABLE) - irqflags = IRQF_SHARED; + if (chanirq_res == errirq_res || + (errirq_res->flags & IORESOURCE_BITS) == IORESOURCE_IRQ_SHAREABLE) + irqflags = IRQF_SHARED; - errirq = errirq_res->start; + errirq = errirq_res->start; - 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; + 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 { + chanirq_res = errirq_res; } -#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)) { /* Special case - all multiplexed */ @@ -881,9 +875,7 @@ static int sh_dmae_probe(struct platform_device *pdev) 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); -- 2.7.4