Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1759563ybd; Thu, 27 Jun 2019 00:54:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4/OXHOR/n6lextn8y0QpCirPCDHYyD5Gn8ZsguiqxQlHYumvhw3lfvs4M8PbQKUVzN/6V X-Received: by 2002:a17:902:7787:: with SMTP id o7mr2855580pll.120.1561622059351; Thu, 27 Jun 2019 00:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561622059; cv=none; d=google.com; s=arc-20160816; b=AquzLfdSEO+BVhEf9f7POuXOZS5M0P3t5fOF9upkYeHZBPALU4ou3wdOW/lY4sXSMv jjvvnuAfRJ8vgWxmgXqJpgOslE5lknCQqDjqwIMnJ1U/jOT1Ir85mD3WSkArTJJU6RMi Mi9DtNPX2I7AkshC4FegOq8cYbdCw4AcUSjMFTsaOX8SVXkLKKPqbEoB2yhxCosWKpBf JBlLuv+MZMVOMArSylEokz3g41VUnTqJumJE3GyHm+yYyQIVB5Y7CDU1tQ7ckzrt+2bj I4a1wbyyu6om7w2RZ5HrlldlEqG1I8e1+oGwYOUQC94z8RgqUv+ZmBxvVPTh3OWog3Lx MsSw== 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=VLH1G/xrhuaSchHrCbt7xaDv1QIvzTYbR4ToRYC3nAM=; b=cHYgNJUnMjzONsbUh5Qh+Qyb5fkHGw+rw3nd/xqCbXjihXj9dyQiU+KRMbQNRGblob AlJj442XEhtvMiTtVzNsVQF8imXDXfKZBiT+IzjUFJv6X/DMqRIsBzSyKf+1Ng1EjxCL LBUUU2O9jRYTKLtB3G+KCKm2EfH/02o3/+5PuCTO5z77zQ0rK4az7D6MHno78yep/xPI /Y8iD9JSXrA9tlOtF5KwWOvUTbAlOi17BKtIu/IcRUwmJW7QuvInX0Q0GN5wUKe8mum4 D5VCjT65X3PbCyxJHzfZpftiolul2krPgMgheDs5NvtPo7xPF9TppWb+ei8DW4oPQZP8 7xkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DQ8xRApR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s193si1354370pgs.232.2019.06.27.00.54.02; Thu, 27 Jun 2019 00:54:19 -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=@gmail.com header.s=20161025 header.b=DQ8xRApR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbfF0HxV (ORCPT + 99 others); Thu, 27 Jun 2019 03:53:21 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41522 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbfF0HxU (ORCPT ); Thu, 27 Jun 2019 03:53:20 -0400 Received: by mail-wr1-f66.google.com with SMTP id c2so1326099wrm.8; Thu, 27 Jun 2019 00:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VLH1G/xrhuaSchHrCbt7xaDv1QIvzTYbR4ToRYC3nAM=; b=DQ8xRApRETpcFLzwK5rKCkAIi+vGxhFXPqVccou4Utrk8ApA7v96BExWn4/4acmFTQ 7JuIWLycnRdxpKBEw4E7Ed5LJdsEg0k/iarcMDU97r1D1iDJyS6b68ZDqElHLTODU4CP e5jy5tQh782Rg1vjJrL2cQws5X+PBSmLoRsstne1qNeLEnFMHPTDijWauAAYENgROGOF hpagsUuFd35IOtOX2v5hyqv5zpspQHvLbuZ6qphGuAuKMQfaRoi66x6rRKjwCVgM5prd IvWfkLry+1GEnQL4Hx47zZVAeLGm3VCCdcYi1Vu3CqMQYJCYoYfzoJtS2neYH/yWK/Fw jkQg== 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=VLH1G/xrhuaSchHrCbt7xaDv1QIvzTYbR4ToRYC3nAM=; b=pCkPLDUVNKq7kKBJlmjVXFDyy2lhEs3gwSz4O+2iFnOi/SvIOK6oXUcCRies2qA/Hf tclO7FvS5Fud5htsN0apGrH8xpjFgk2l6upZB8GqZ3Vz2TOILJ6XB9Kb+fxP0PN46/ZH dbBat34buQQR9OF6TVjPjUrURfnhByEIZgiF2r3EmOithcVbhzqc9chwUiErAVRSZxZL Q7Tcqa88Y0ovAyTDOYEzaYsHFE918hPIEbT54JYNw21y0ThFhRcI6SzG/PR24/etDb6+ MofDnLW6WJ1kfQUvuqMzHEHFflI2pS6HGxR/MbUXoqk/4dvQ+CEnPPEeAu7+BQADsEA2 BiiA== X-Gm-Message-State: APjAAAUzL1pEoYlLFF1QwIyqTgxgD2iJWQGvZp32K7w29v7WJDLHi8T9 02dn0vs3Fu0ifb431PPcoQCIDVsRFP8VIQIHOzA= X-Received: by 2002:a5d:6389:: with SMTP id p9mr2039270wru.297.1561621998678; Thu, 27 Jun 2019 00:53:18 -0700 (PDT) MIME-Version: 1.0 References: <20190522011504.19342-1-zhang.chunyan@linaro.org> <20190522011504.19342-2-zhang.chunyan@linaro.org> <20190626181637.CFA6321726@mail.kernel.org> In-Reply-To: <20190626181637.CFA6321726@mail.kernel.org> From: Chunyan Zhang Date: Thu, 27 Jun 2019 15:52:42 +0800 Message-ID: Subject: Re: [PATCH v2 1/3] clk: sprd: Switch from of_iomap() to devm_ioremap_resource() To: Stephen Boyd Cc: Chunyan Zhang , linux-clk , Linux Kernel Mailing List , Orson Zhai , Baolin Wang 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 Thu, 27 Jun 2019 at 02:16, Stephen Boyd wrote: > > Quoting Chunyan Zhang (2019-05-21 18:15:01) > > 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 > > 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 = of_iomap(node, 0); > > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > + base = 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! Yes indeed, thanks for the information. Considering this patch was queued to your tree, I decide to use this more integrated function later :) Cheers, Chunyan > > > + return PTR_ERR(base); > > +