Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1640445imc; Mon, 11 Mar 2019 19:39:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5yLY9etfCmp8s0QXl4j/tIrOxSVmK7SezUV29tyTQOpVsmEaWLcYYRxRU3QoZaLuok4pY X-Received: by 2002:a65:6098:: with SMTP id t24mr24931449pgu.57.1552358375855; Mon, 11 Mar 2019 19:39:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552358375; cv=none; d=google.com; s=arc-20160816; b=IYNTGTEvY/97RPHPGpN5xN1JcFlef0LKSxTIKvARuZiHmgKC+PuqTJXwM/VqeIbd0q m/oKi8miCY6VuTpZG8obLcF3N480miAae9XT6FWQluXusZURcS6Kf0YIqyVgJ82+gwu7 KuKC9yRkbbMiRu4UnTNK3wJn+LQTbdukAVhTNoQSEfHuon6cNLEkpJP/JFyT8KBXKcCe 3NdH8dxQiUa6085iDhIW6tY9D1WKsvkC3UqvUfLkW3T/8tJQCjufonob6NOpDhFPshkZ uHreU0Mr4WZ2ZoYTJSYHdnYv1ibja5fGFGEvDhT9DEOMl2LD6LgtO14rrHbXFfbH+Aee O4RA== 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=5U9bUNAqij3VG7YLuZ3Gl5U8RjZnG9CeEaaenO2RaR0=; b=x/x0RyZlT7eHAKR15QLfnwhzu5JBFD93x1WQ8Ij7NqICb0knCbtWp3RmnArkztRA3P 1/pKNwCGFFgbyDQH/EBrWHUAXhd2T+Vs3Cj4nqXqb59vUB6R+opU3s5fIiEsVF5ln0o0 tCf4SfJj2k3GK7BDZjg/wm892V9GVt3Cmn7cLpmLhUrXaj400jdAzNAAR4yTtS/qqEMm 1/hq2fxGQF6Qfu1NLZ3RO23Ocu7rv88PcgExwlemovuAx/FHpx8sOjuFbyB3ZBbw8zFr vWk0EV9bs0yYrS2u+FU93fkSRXFfAQ+KnUEZDT2GjgZFvWrvjwSc5Qd+xQPG/X5I4ujd evjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r2gPjsM8; 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 d8si6208116pgv.53.2019.03.11.19.39.20; Mon, 11 Mar 2019 19:39:35 -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=r2gPjsM8; 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 S1726873AbfCLCi6 (ORCPT + 99 others); Mon, 11 Mar 2019 22:38:58 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:46714 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726824AbfCLCi4 (ORCPT ); Mon, 11 Mar 2019 22:38:56 -0400 Received: by mail-lj1-f196.google.com with SMTP id v16so862432ljg.13 for ; Mon, 11 Mar 2019 19:38:55 -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=5U9bUNAqij3VG7YLuZ3Gl5U8RjZnG9CeEaaenO2RaR0=; b=r2gPjsM8mvyT/fDHMyPEcAkEBC1H4/+GdOE+0omVaDRVBaqjR1vvwxKH+bWW1cUbdU gZs4o1zIW3hLD/7WaXSX2x/zDfVEPEoyhpQUoBLpTDcsusDCB1z2pse3jnZWlseBs3+C xztHfNJexMNjhDe14W4UQtFK8Emx/BVseUv7VOe5kpNL5u3muNKvDSQ68xYObjCZDFX0 aeXPBGN0nQxRCS5l+OmvIqJK1AxlE0tZF1fPQ/AwNe2YsVK3sXaFXLc61IPsuSbnE+dh fWOcLTokjwPNWz/iAOiieqjkD0TmFPbLqUMpVQwvHQDCIQYMTeE60dyliLq/hTsW7/Wd cZMg== 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=5U9bUNAqij3VG7YLuZ3Gl5U8RjZnG9CeEaaenO2RaR0=; b=cWa7/Rkbo1DGQkX4a2u47RgVYhLX7MWiSQ3SvS/4Vm5dkybDR8i7ylM1i8TQc8EqSB X2lqeIOs5QOCKfq+oqyADE+uSFgAWdwvchSVG2kdz//G2Fw9hbBJN20GTWKPDyHqy18j LPFAzq3peKUrivGH7xgbslcaKL+F9NJ8Q4ON1+D6r0X59LuKIUmZOPzSx87eJrsqaIFq 1dOT0HLIYgVM2GkjmjByAP/e5fryWPmirOnKd5kMyZwS5ym3jHGfvwTGcVN+Tqpf/R80 Nczpw4/0gY3022+Jv02YgTKsEc6UqswJIHAE9NmqAUikQk4GZjpDw/W1A6qpU7TYZuvQ Nssg== X-Gm-Message-State: APjAAAXXXQh0qhGdzryTzibRvPKxBBPsxDIefqibSHVhzn2w84ivT+zM IL1zNi5belEY++ruorYdqu9B42MK6++qE+sLtFHMIQ== X-Received: by 2002:a2e:8084:: with SMTP id i4mr17929912ljg.44.1552358334339; Mon, 11 Mar 2019 19:38:54 -0700 (PDT) MIME-Version: 1.0 References: <1552330521-4276-1-git-send-email-info@metux.net> <1552330521-4276-9-git-send-email-info@metux.net> In-Reply-To: <1552330521-4276-9-git-send-email-info@metux.net> From: Baolin Wang Date: Tue, 12 Mar 2019 10:38:43 +0800 Message-ID: Subject: Re: [PATCH 09/42] drivers: gpio: sprd: use devm_platform_ioremap_resource() To: "Enrico Weigelt, metux IT consult" Cc: LKML , Linus Walleij , Bartosz Golaszewski , andrew@aj.id.au, f.fainelli@gmail.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, hoan@os.amperecomputing.com, Orson Zhai , Chunyan Zhang , keguang.zhang@gmail.com, vz@mleia.com, matthias.bgg@gmail.com, Thierry Reding , Grygorii Strashko , ssantosh@kernel.org, khilman@kernel.org, Robert Jarzmik , Masahiro Yamada , jun.nie@linaro.org, shawnguo@kernel.org, "open list:GPIO SUBSYSTEM" , linux-mips@vger.kernel.org, linux-pwm@vger.kernel.org, linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org 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 Tue, 12 Mar 2019 at 02:55, Enrico Weigelt, metux IT consult wrote: > > Use the new helper that wraps the calls to platform_get_resource() > and devm_ioremap_resource() together. > > Signed-off-by: Enrico Weigelt, metux IT consult > --- > drivers/gpio/gpio-eic-sprd.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c > index f0223ce..c12de87 100644 > --- a/drivers/gpio/gpio-eic-sprd.c > +++ b/drivers/gpio/gpio-eic-sprd.c > @@ -567,7 +567,6 @@ static int sprd_eic_probe(struct platform_device *pdev) > const struct sprd_eic_variant_data *pdata; > struct gpio_irq_chip *irq; > struct sprd_eic *sprd_eic; > - struct resource *res; > int ret, i; > > pdata = of_device_get_match_data(&pdev->dev); > @@ -596,13 +595,9 @@ static int sprd_eic_probe(struct platform_device *pdev) > * have one bank EIC, thus base[1] and base[2] can be > * optional. > */ > - res = platform_get_resource(pdev, IORESOURCE_MEM, i); > - if (!res) > - continue; > - > - sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res); > + sprd_eic->base[i] = devm_platform_ioremap_resource(pdev, 0); This is incorrect, since we can have multiple IO resources, but you only get index 0. > if (IS_ERR(sprd_eic->base[i])) > - return PTR_ERR(sprd_eic->base[i]); > + continue; > } > > sprd_eic->chip.label = sprd_eic_label_name[sprd_eic->type]; > -- > 1.9.1 > -- Baolin Wang Best Regards