From patchwork Wed May 9 03:23:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10388047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D99C360153 for ; Wed, 9 May 2018 03:24:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C329828F88 for ; Wed, 9 May 2018 03:24:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4AA428FA8; Wed, 9 May 2018 03:24:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A378228F88 for ; Wed, 9 May 2018 03:24:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933629AbeEIDYD (ORCPT ); Tue, 8 May 2018 23:24:03 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:43535 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932579AbeEIDYC (ORCPT ); Tue, 8 May 2018 23:24:02 -0400 Received: by mail-pl0-f66.google.com with SMTP id a39-v6so3438891pla.10 for ; Tue, 08 May 2018 20:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=+6MCK29zgUUl4Ax5VuLGoGsKPycwA2A68TGuIdOyK/A=; b=VOvPFbszUQYdEkf/jr3bBaMDuMBUJHyUqUDBovzQL+N8UmCOLvTPwu2AdyyVoWKYEC iHhk7ihzTZ1q6/9HJflV08PT0x/CZA5q304Hxdj4z+F8jVaPgr8jkOj1o1zHLvGBSTVK gtjai73UDMDIRjzsjvTamEi6LHtimBSdMxkjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+6MCK29zgUUl4Ax5VuLGoGsKPycwA2A68TGuIdOyK/A=; b=XrD9iIW9hZmyTqc4OJwcIDLmiGnu6T4qsczc3UdHSpowHGAgK/skHN5GpwQeD4Dz6j NJYaTO6mYtDEUjs+guYfDVwfO9BYDiy4a6RgVQiBPvh65jg2LpeWyyjAiuojzzCVxZuW QFDuiJDxSmb2cN17LATFQQC7o0o1Sf4zen2ymASnaGdnsd6OIR12UW5yj57BNW9unCX9 HHgjBHfdwoVS6aKKfUPEhunKV7SjMCCJRRcCcFSHT3KAUGVd/3ER3zy5pohFAXvZwnY2 hwxZmdVBYNptZ9m1F4WLrzVTw7ww3CbTyrg2Hgabrz98bZmIhe0+mj/fn+Hgsu21nClp RZ9g== X-Gm-Message-State: ALQs6tAYuS4r8PNDep7J5apGkR7lZkSir8R+d3ngw9fIGomrKwTbfgGj P2sfnZ8sI86ZRaKDILBNH3plmg== X-Google-Smtp-Source: AB8JxZrL6VJhoj+fAPZ5hAazPXxKH32rKQ+M67w2opSJShLy0ev/cHsnnKjyb7stOWcA0er/EEeVqA== X-Received: by 2002:a17:902:822:: with SMTP id 31-v6mr44525639plk.172.1525836241704; Tue, 08 May 2018 20:24:01 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id b5-v6sm5150028pgc.16.2018.05.08.20.23.58 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 May 2018 20:24:01 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vinod.koul@intel.com Cc: broonie@kernel.org, lars@metafoo.de, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dmaengine: sprd: Use devm_ioremap_resource() to map memory Date: Wed, 9 May 2018 11:23:50 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of checking the return value of platform_get_resource(), we can use devm_ioremap_resource() which has the NULL pointer check and the momery region requesting. Suggested-by: Lars-Peter Clausen Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index dba7a17..e715d07 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -807,10 +807,7 @@ static int sprd_dma_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; - sdev->glb_base = devm_ioremap_nocache(&pdev->dev, res->start, - resource_size(res)); + sdev->glb_base = devm_ioremap_resource(&pdev->dev, res); if (!sdev->glb_base) return -ENOMEM;