Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1675655ybm; Tue, 21 May 2019 19:10:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJg1ME0HDmhxPKBThLEkONcpjZ13F0PxxJ54pi8wx2uGqneOAVxETmXcNghaRyozxWuTia X-Received: by 2002:a63:6a4a:: with SMTP id f71mr86135613pgc.44.1558491048535; Tue, 21 May 2019 19:10:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558491048; cv=none; d=google.com; s=arc-20160816; b=P9R7utSJXX0vGqEvzuEkJ1igeImAKn8Gjkj4/pXUXNSKxF6yyFjNciaynGrhRo4S7T kFl3cGyt6hx8eS5MG6bSKmb3S1yTmte7ExM15Kk6In9Y887mQo/2RPLtL8CtWIQh6AMK 9ATNz4UXD0sI41cf3FSBL4aJ6YfNbvgLEtAibZEChTRF0LsyUEpfg9Grc46rHIjnEPEV 93D8pNmELpk+OZu7DqueCrBV0BRBDOspjSgJBxTIPo2gXbAU+1AmygXgAsZR6+MypeyU OUApXOXRrS7Tr7kwakO31d4C00X92s6ujhiwQdtMOVIrtXeEna1gbQ2AfiCxV1Q8DwxX pCMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PW2Ksp4dF+kCYGO2bVRBw5OwUH5NVUnvQm1hs6EDl6g=; b=rkfIU96lLATeFssuI9MIvViI1uXczpUVhvI04JOKMdtKkhjlFgQK6+1oeP+IGHNfdy 7DI8jNwcIngdjkj1GPXvv1dB6qEBDQRZlYZ1xsebH0BvkvK/s+W2TU7hKw42nZ572ex9 L9JiExbhSli192ZMowLLuBxhjwAcDPM+dZz/0Blx5r8uTvGtP6p6lEKWGXKrCzmvTc9+ D202ZjYjwlF+7g78bcFhzzC8tXlnRzKmUTHHM99qGiT08YBLb7ysh+f6cPjAe4rjH3Kw QXD2LJsAtMiZWPZlc+dTP8l3ui/Xi48mLMrpfQHLfUb0J53gEnKlsJhPzBwQA7OqdD3x NfUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YENWXgYB; 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 r204si25684351pfc.263.2019.05.21.19.10.32; Tue, 21 May 2019 19:10:48 -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=YENWXgYB; 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 S1728320AbfEVCHr (ORCPT + 99 others); Tue, 21 May 2019 22:07:47 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:33161 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727208AbfEVCHq (ORCPT ); Tue, 21 May 2019 22:07:46 -0400 Received: by mail-oi1-f196.google.com with SMTP id q186so429523oia.0 for ; Tue, 21 May 2019 19:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PW2Ksp4dF+kCYGO2bVRBw5OwUH5NVUnvQm1hs6EDl6g=; b=YENWXgYBjKoO0LJUuXsbbL9ODcCAtlfjp9Zm6wsARsbNfeRLCI23TVVM3BF/uL00AM BLgVZdXe7kq0jzXclwNKvS1rTgULLOlEENmBV/Y+o/61bNq4aR4ywl/InH5pmMxoRgKG UtXhrd6Fnz0Fi0pKGBV9ETLvcd2AWAcO2iwPkx/iGFhiWPy/N7sHS56TY2e+5RkTzQqE 7GQnhX7osJRKB6smAWzymNNMQ94E2QRgPyO1WcpHNM9CU0NXQUejAv8hGQXGTOV3qc5L 5I10NNR7uYkWqWvEpZUQb6pE14tf+vHvR2c8doFRh8z1Rp+dVyi5zTfBZSVoLOPx6w8V iCTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PW2Ksp4dF+kCYGO2bVRBw5OwUH5NVUnvQm1hs6EDl6g=; b=bnnPct/GfFGAIXXrXMH7PFv0hopWdOopoVZIFS3rp0C6e1XxgTxsUi49kAUrzBeuDm J/P5TW8cQMWVdjEXgxNO5EWjDI9qth+iBP4xcuQaY+TTpUMOyw0gSVAFWqetu/ei6G1i H67KhtgDr7IR0upOuW4CQ6XKp6ojig+riefoRPkjdu5wDFC6DcakHC8S2ASq/15mNEo3 dbAgodhNhNQLoQnAFu68lytK93R9Cs8WRjUMPo5R3Sb7wkzQyDZeNRuEAa2M/+BYTzy8 aCynGAtXozT9Z3Dlkx/DFG04PDSnt1r/QC5jOKVtTs0i1pYRgDxoIR8AJDXjcXXpFrBh x/SA== X-Gm-Message-State: APjAAAU3j+oNwXrOx7A2zyTHLIy0O1Cw5qyrOBzsIHOgP6uuhYnxyiCH 0ERusOpVg2di99MkIMplHl4U1aY4ghqUp2ulmLgztQ== X-Received: by 2002:aca:d846:: with SMTP id p67mr2797618oig.6.1558490865822; Tue, 21 May 2019 19:07:45 -0700 (PDT) MIME-Version: 1.0 References: <20190522011504.19342-1-zhang.chunyan@linaro.org> <20190522011504.19342-2-zhang.chunyan@linaro.org> In-Reply-To: <20190522011504.19342-2-zhang.chunyan@linaro.org> From: Baolin Wang Date: Wed, 22 May 2019 10:07:33 +0800 Message-ID: Subject: Re: [PATCH v2 1/3] clk: sprd: Switch from of_iomap() to devm_ioremap_resource() To: Chunyan Zhang Cc: Stephen Boyd , linux-clk@vger.kernel.org, LKML , Orson Zhai , Chunyan Zhang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 May 2019 at 09:15, Chunyan Zhang wrote: > > devm_ioremap_resources() automatically requests resources and devm_ wrappers > do better error handling and unmapping of the I/O region when needed, > that would make drivers more clean and simple. > > Signed-off-by: Chunyan Zhang Reviewed-by: Baolin Wang > --- > drivers/clk/sprd/common.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > 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 > @@ -42,6 +42,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev, > void __iomem *base; > struct device_node *node = pdev->dev.of_node; > struct regmap *regmap; > + struct resource *res; > > if (of_find_property(node, "sprd,syscon", NULL)) { > regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon"); > @@ -50,7 +51,11 @@ int sprd_clk_regmap_init(struct platform_device *pdev, > return PTR_ERR(regmap); > } > } else { > - base = of_iomap(node, 0); > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + base = devm_ioremap_resource(&pdev->dev, res); > + if (IS_ERR(base)) > + return PTR_ERR(base); > + > regmap = devm_regmap_init_mmio(&pdev->dev, base, > &sprdclk_regmap_config); > if (IS_ERR_OR_NULL(regmap)) { > -- > 2.17.1 > -- Baolin Wang Best Regards