Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1106136ybd; Wed, 26 Jun 2019 11:17:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJjw/jDKKdSACI6ZhSGzNP3mlBSR38SLCJf0W1M2k4UhD2ynVGGU2zHQhHY7Io2kM4N2KK X-Received: by 2002:a17:902:b70f:: with SMTP id d15mr6678984pls.318.1561573032370; Wed, 26 Jun 2019 11:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561573032; cv=none; d=google.com; s=arc-20160816; b=dVHwhixVMHwsPHeOp12dPJqXW2vd7Klo2USmqDmJIx0AGnDkPc47GoGn896yJTWpyR 84CXepr+ok0fiQ2YaN72IBDSDOtINwm9qEb6taMuUCmABtQqxTeFxWlQ+cUhljASJzYU 3J/XAwOjpwvj16D47AJtTgS5qqY87nkWGr/m8tyh+EAlOdIAC0NcxYSDoK+g/N4AN33q GIiYTrDgtb3m5G7FBFSAHXKbEPci1R/+chG3lbYSBEu0fqfNNwdWMrBZ9j/V1DQCmFtw ScUTT9HZxcP/e5D1185S1pkzQQ2HxPgs6Orx7YQHMCYrwSbEVgU+wwSuSRZLU4lFoDrF azHA== 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:user-agent:cc:subject :from:to:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=qIgAFUR6MCBKcmPZz8uMQSfzJEAO/Lw2S8b1Ip8QH18=; b=sVtnDJ5nlcM/2K6n02C0VVMnaAKTpGLHwQCGEdiTxhBEv2/dm/wrBGbdFJDGJAmxsV PHI04CipgbMtYkCk60Zh9O3+bH5mj4G2E2eQkNPvdWMPYVJchrIJP32ns4nO3p529Jxw mZSwDKgVd4yaGVT/DYApWghJpUUEmvhusNI1LWrCMRS5N7OQgY/5r0LayjzdkYKK3fjN cldNpBgiCIf8WZJ9PGI3msQMmGbUg/VwcB+LnjgG9lCbycsu1nXlQknFf2YybLgsSmx9 fytqEFpMz5O4Ik+iJyAhGOdJQmtR9yczVJ0yLD0ZU+giapLRV5mH6BIzBTeF64MYxyFB cmXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q4reBCx0; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 36si4124117pla.80.2019.06.26.11.16.55; Wed, 26 Jun 2019 11:17:12 -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=@kernel.org header.s=default header.b=q4reBCx0; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726617AbfFZSQj (ORCPT + 99 others); Wed, 26 Jun 2019 14:16:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:60362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbfFZSQi (ORCPT ); Wed, 26 Jun 2019 14:16:38 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CFA6321726; Wed, 26 Jun 2019 18:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561572997; bh=sab0MWfiVzl74QqPr+RXCGs4tGCyw2k4Qdv+3xOa4JE=; h=In-Reply-To:References:To:From:Subject:Cc:Date:From; b=q4reBCx0kjurRaRwQCFE39ixbHBA2Xo4uCyhZOrdRVtkOSq4ksMmBuWxBZ/ncAR+V WcKjBtg17QGOSQFwRdt62OI1c10cduhAP01gt9k9k7shRRzAZDGvfPy3uQ3aXeQJmc lXi5yN5NLGb4ob6mJix5G6MAaeGT/9Hx9/EpSPDs= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20190522011504.19342-2-zhang.chunyan@linaro.org> References: <20190522011504.19342-1-zhang.chunyan@linaro.org> <20190522011504.19342-2-zhang.chunyan@linaro.org> To: Chunyan Zhang From: Stephen Boyd Subject: Re: [PATCH v2 1/3] clk: sprd: Switch from of_iomap() to devm_ioremap_resource() Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Chunyan Zhang , Baolin Wang User-Agent: alot/0.8.1 Date: Wed, 26 Jun 2019 11:16:36 -0700 Message-Id: <20190626181637.CFA6321726@mail.kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Chunyan Zhang (2019-05-21 18:15:01) > devm_ioremap_resources() automatically requests resources and devm_ wrapp= ers > do better error handling and unmapping of the I/O region when needed, > that would make drivers more clean and simple. >=20 > Signed-off-by: Chunyan Zhang Applied to clk-next > diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c > index e038b0447206..9ce690999eaa 100644 > --- a/drivers/clk/sprd/common.c > +++ b/drivers/clk/sprd/common.c > @@ -50,7 +51,11 @@ int sprd_clk_regmap_init(struct platform_device *pdev, > return PTR_ERR(regmap); > } > } else { > - base =3D of_iomap(node, 0); > + res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); > + base =3D devm_ioremap_resource(&pdev->dev, res); > + if (IS_ERR(base)) There's also devm_platform_ioremap_resource() if you want to save even more lines! > + return PTR_ERR(base); > +