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: 135190 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5144071lji; Tue, 8 May 2018 20:24:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq14PZg43vKEOoM5tF241ew3dTf+otX5bwqIawoD3SZuKl+v6nx1+S/xGEY0VoREeW2BXBX X-Received: by 2002:a17:902:3c5:: with SMTP id d63-v6mr43291686pld.163.1525836248206; Tue, 08 May 2018 20:24:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525836248; cv=none; d=google.com; s=arc-20160816; b=fgiSxbTvaQJY/of/OK2ui8sUi739xzWgSy4ecN2DfGo+bmCh5im6LgNKxBeG2lXsvZ g4N+W2LAyElBC+FSdIaY45FHAPCVFmTL5VoppY7BpVm+1I9wQ027n9F9TcgHrmQMuL7a QWpSw0oMyNnxdvieHJXJHvZm0JTycO8VP990C/dh2JS2Xdn4N2Q8TpyV+X+gV2iuWY84 Rf6ZA0u+CjaxeOgVNWl3Wkx58gznJVo1CAX66yNIkTOZBhVzGHInsDb+pmXwFpX1ADzR jh1utDH52R3bpy8euksgyjK60H04VbbtPS6BejIQTaalfT9+0DOvsDPbR2E3FCpTGQ6u t/eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=+6MCK29zgUUl4Ax5VuLGoGsKPycwA2A68TGuIdOyK/A=; b=xnb75LeMgvLVUt5e3+jtZCSEgusbCzmg+gipHXPn5AgDyLKiz+Li1Np1Ss+j5HPDFd B2680fQZzAdcrTaEzgVlSPHhVNhC78B6RYRUD2EVElmH1tLgccARBDqyCxar1RMEPb9a ktRva+L2s3G+QAP744ciZuvHj3C7jcfsw2dBPXYcj8/6DrUhIeEnmoLv8iCmnUXI3woo wprQ/ORNjHkIIReBF4g4WjTQpMkoBmmOGkLylCqMfcaoLnbooZjQmc5XAeIL88gbIV6y MEP1tRcuFW7b3tX5vG10r1/44qBYW6a05jSzPPQjmly1n3D3hf1DaoCIKPFFgRq/2BCD 2XAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VOvPFbsz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j185-v6si20934081pgc.606.2018.05.08.20.24.07; Tue, 08 May 2018 20:24:08 -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; dkim=pass header.i=@linaro.org header.s=google header.b=VOvPFbsz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933686AbeEIDYD (ORCPT + 29 others); Tue, 8 May 2018 23:24:03 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:45450 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933605AbeEIDYC (ORCPT ); Tue, 8 May 2018 23:24:02 -0400 Received: by mail-pl0-f67.google.com with SMTP id bi12-v6so3428329plb.12 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=l/7kdbfv2j+BIG/AG7PCk+3v44cCgDC/dgwaJ4+sQNBYsZOeJ6V8PYVzGKtc8DG3GS mxzxrTdfWBN42tXSc3fpJMtgIOSjXNmNC7z0os8uobOfholgv0I9mCUGs+rOtJu4m+T7 A5GM2EnSdz2FrdQjiRAqyZFCyV5PHZ9jUL7yjmIiVSptnxL6aEDd1rvmMcfxXLZfBaGi 3F6IltiURvpcX/Ha+grDxaI5sC/aSxWz8JeJTd4bNhxPwjqOpuvxHLQuPG+iAelEs+5Y Acj6UFET4OlOuXO6SWN4R6iYEDc3ZtINcGseERix3rmvKD657RZNAkYOF2Rvjrftbdpp F6lw== X-Gm-Message-State: ALQs6tClFXwX1cvNFjFZTVWU9SlqwvwDL01eK5jtMGh0zyeAKxAGd2ey vtwiwHos96CO1ert4XP/3N/XPA== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.7.9.5 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;