From: Baolin Wang <baolin.wang@linaro.org> To: "Enrico Weigelt, metux IT consult" <info@metux.net> Cc: LKML <linux-kernel@vger.kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <bgolaszewski@baylibre.com>, andrew@aj.id.au, f.fainelli@gmail.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, hoan@os.amperecomputing.com, Orson Zhai <orsonzhai@gmail.com>, Chunyan Zhang <zhang.lyra@gmail.com>, keguang.zhang@gmail.com, vz@mleia.com, matthias.bgg@gmail.com, Thierry Reding <thierry.reding@gmail.com>, Grygorii Strashko <grygorii.strashko@ti.com>, ssantosh@kernel.org, khilman@kernel.org, Robert Jarzmik <robert.jarzmik@free.fr>, Masahiro Yamada <yamada.masahiro@socionext.com>, jun.nie@linaro.org, shawnguo@kernel.org, "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>, linux-mips@vger.kernel.org, linux-pwm@vger.kernel.orgli Subject: Re: [PATCH 09/42] drivers: gpio: sprd: use devm_platform_ioremap_resource() Date: Tue, 12 Mar 2019 10:38:43 +0800 [thread overview] Message-ID: <CAMz4kuKC5haGbhyVJ4gQ6nMRzdaxJnd3SmeCSM-096p7TAp8cA@mail.gmail.com> (raw) In-Reply-To: <1552330521-4276-9-git-send-email-info@metux.net> On Tue, 12 Mar 2019 at 02:55, Enrico Weigelt, metux IT consult <info@metux.net> 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 <info@metux.net> > --- > 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
WARNING: multiple messages have this Message-ID (diff)
From: Baolin Wang <baolin.wang@linaro.org> To: "Enrico Weigelt, metux IT consult" <info@metux.net> Cc: LKML <linux-kernel@vger.kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <bgolaszewski@baylibre.com>, andrew@aj.id.au, f.fainelli@gmail.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, hoan@os.amperecomputing.com, Orson Zhai <orsonzhai@gmail.com>, Chunyan Zhang <zhang.lyra@gmail.com>, keguang.zhang@gmail.com, vz@mleia.com, matthias.bgg@gmail.com, Thierry Reding <thierry.reding@gmail.com>, Grygorii Strashko <grygorii.strashko@ti.com>, ssantosh@kernel.org, khilman@kernel.org, Robert Jarzmik <robert.jarzmik@free.fr>, Masahiro Yamada <yamada.masahiro@socionext.com>, jun.nie@linaro.org, shawnguo@kernel.org, "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>, linux-mips@vger.kernel.org, linux-pwm@vger.kernel.org, linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH 09/42] drivers: gpio: sprd: use devm_platform_ioremap_resource() Date: Tue, 12 Mar 2019 10:38:43 +0800 [thread overview] Message-ID: <CAMz4kuKC5haGbhyVJ4gQ6nMRzdaxJnd3SmeCSM-096p7TAp8cA@mail.gmail.com> (raw) In-Reply-To: <1552330521-4276-9-git-send-email-info@metux.net> On Tue, 12 Mar 2019 at 02:55, Enrico Weigelt, metux IT consult <info@metux.net> 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 <info@metux.net> > --- > 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
next prev parent reply other threads:[~2019-03-12 2:38 UTC|newest] Thread overview: 167+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-03-11 18:54 [PATCH 01/42] drivers: gpio: 74xx-mmio: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-03-11 18:54 ` [PATCH 02/42] drivers: gpio: amdpt: " Enrico Weigelt, metux IT consult 2019-04-02 8:06 ` Linus Walleij 2019-04-02 8:06 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 03/42] drivers: gpio: amdpt: drop unneeded deref of &pdev->dev Enrico Weigelt, metux IT consult 2019-03-12 11:21 ` Thierry Reding 2019-04-02 8:54 ` Linus Walleij 2019-04-02 8:54 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 04/42] drivers: gpio: aspeed: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-04-02 8:55 ` Linus Walleij 2019-04-02 8:55 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 05/42] drivers: gpio: bcm-kona: " Enrico Weigelt, metux IT consult 2019-03-11 18:59 ` Florian Fainelli 2019-03-15 8:19 ` Uwe Kleine-König 2019-04-02 8:57 ` Linus Walleij 2019-04-02 8:57 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 06/42] drivers: gpio: cadence: " Enrico Weigelt, metux IT consult 2019-04-02 9:00 ` Linus Walleij 2019-04-02 9:00 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 07/42] drivers: gpio: clps711x: " Enrico Weigelt, metux IT consult 2019-04-02 9:01 ` Linus Walleij 2019-04-02 9:01 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 08/42] drivers: gpio: dwap: " Enrico Weigelt, metux IT consult 2019-04-02 9:02 ` Linus Walleij 2019-04-02 9:02 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 09/42] drivers: gpio: sprd: " Enrico Weigelt, metux IT consult 2019-03-12 2:38 ` Baolin Wang [this message] 2019-03-12 2:38 ` Baolin Wang 2019-03-12 8:08 ` Enrico Weigelt, metux IT consult 2019-03-12 8:08 ` Enrico Weigelt, metux IT consult 2019-04-02 9:20 ` Linus Walleij 2019-04-02 9:20 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 10/42] drivers: gpio: ep93xx: devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-03-12 11:23 ` Thierry Reding 2019-04-03 2:27 ` Linus Walleij 2019-04-03 2:27 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 11/42] drivers: gpio: ftgpio010: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-04-03 2:28 ` Linus Walleij 2019-04-03 2:28 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 12/42] drivers: gpio: grgpio: " Enrico Weigelt, metux IT consult 2019-03-12 11:23 ` Thierry Reding 2019-04-03 2:29 ` Linus Walleij 2019-04-03 2:29 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 13/42] drivers: gpio: hlwd: " Enrico Weigelt, metux IT consult 2019-04-03 2:30 ` Linus Walleij 2019-04-03 2:30 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 14/42] drivers: gpio: iop: " Enrico Weigelt, metux IT consult 2019-04-03 2:31 ` Linus Walleij 2019-04-03 2:31 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 15/42] drivers: gpio: janz-ttl: " Enrico Weigelt, metux IT consult 2019-04-03 2:32 ` Linus Walleij 2019-04-03 2:32 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 16/42] drivers: gpio: janz-ttl: drop unneccessary temp variable dev Enrico Weigelt, metux IT consult 2019-03-12 9:17 ` Ben Dooks 2019-03-12 9:33 ` Enrico Weigelt, metux IT consult 2019-03-12 11:26 ` Thierry Reding 2019-03-12 15:00 ` Enrico Weigelt, metux IT consult 2019-04-03 2:34 ` Linus Walleij 2019-04-03 2:34 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 17/42] drivers: gpio: loongon1: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-04-03 2:34 ` Linus Walleij 2019-04-03 2:34 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 18/42] drivers: gpio: lpc18xx: " Enrico Weigelt, metux IT consult 2019-03-11 19:58 ` Vladimir Zapolskiy 2019-04-03 2:36 ` Linus Walleij 2019-04-03 2:36 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 19/42] drivers: gpio: mb86s7x: " Enrico Weigelt, metux IT consult 2019-04-03 2:37 ` Linus Walleij 2019-04-03 2:37 ` Linus Walleij 2019-03-11 18:54 ` [PATCH 20/42] drivers: gpio: mt7621: " Enrico Weigelt, metux IT consult 2019-03-12 11:14 ` Matthias Brugger 2019-04-03 2:59 ` Linus Walleij 2019-04-03 2:59 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 21/42] drivers: gpio: mvebu: " Enrico Weigelt, metux IT consult 2019-04-03 3:03 ` Linus Walleij 2019-04-03 3:03 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 22/42] drivers: gpio: mxc: " Enrico Weigelt, metux IT consult 2019-04-03 3:04 ` Linus Walleij 2019-04-03 3:04 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 23/42] drivers: gpio: " Enrico Weigelt, metux IT consult 2019-03-11 19:01 ` Florian Fainelli 2019-03-11 19:48 ` [PATCH] drivers: gpio: octeon: " Enrico Weigelt, metux IT consult 2019-03-12 13:45 ` Bartosz Golaszewski 2019-03-12 15:11 ` Enrico Weigelt, metux IT consult 2019-04-03 3:30 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 24/42] drivers: gpio: " Enrico Weigelt, metux IT consult 2019-03-11 19:01 ` Florian Fainelli 2019-03-11 19:50 ` [PATCH] drivers: gpio: omap: " Enrico Weigelt, metux IT consult 2019-03-14 10:43 ` Grygorii Strashko 2019-03-14 10:43 ` Grygorii Strashko 2019-04-03 3:07 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 25/42] drivers: gpio: pxa: " Enrico Weigelt, metux IT consult 2019-04-03 3:31 ` Linus Walleij 2019-04-03 3:31 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 26/42] drivers: gpio: rcar: pendantic formatting Enrico Weigelt, metux IT consult 2019-03-12 11:28 ` Thierry Reding 2019-03-12 19:03 ` Geert Uytterhoeven 2019-03-12 19:03 ` Geert Uytterhoeven 2019-04-03 3:32 ` Linus Walleij 2019-04-03 3:32 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 27/42] drivers: gpio: rcar: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-03-12 19:01 ` Geert Uytterhoeven 2019-03-12 19:01 ` Geert Uytterhoeven 2019-04-03 3:34 ` Linus Walleij 2019-04-03 3:34 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 28/42] drivers: gpio: spear-spics: " Enrico Weigelt, metux IT consult 2019-04-03 3:35 ` Linus Walleij 2019-04-03 3:35 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 29/42] drivers: gpio: sprd: " Enrico Weigelt, metux IT consult 2019-03-12 2:40 ` Baolin Wang 2019-03-12 2:40 ` Baolin Wang 2019-04-02 9:04 ` Linus Walleij 2019-04-02 9:04 ` Linus Walleij 2019-04-02 9:10 ` Baolin Wang 2019-04-02 9:10 ` Baolin Wang 2019-04-02 9:18 ` Linus Walleij 2019-04-02 9:18 ` Linus Walleij 2019-04-02 9:20 ` Baolin Wang 2019-04-02 9:20 ` Baolin Wang 2019-03-11 18:55 ` [PATCH 30/42] drivers: gpio: sta2x11: " Enrico Weigelt, metux IT consult 2019-04-03 3:42 ` Linus Walleij 2019-04-03 3:42 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 31/42] drivers: gpio: stp-xway: " Enrico Weigelt, metux IT consult 2019-04-03 3:43 ` Linus Walleij 2019-04-03 3:43 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 32/42] drivers: gpio: tb10x: " Enrico Weigelt, metux IT consult 2019-04-03 3:44 ` Linus Walleij 2019-04-03 3:44 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 33/42] drivers: gpio: tegra: " Enrico Weigelt, metux IT consult 2019-03-12 11:30 ` Thierry Reding 2019-04-03 3:46 ` Linus Walleij 2019-04-03 3:46 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 34/42] drivers: gpio: timberdale: " Enrico Weigelt, metux IT consult 2019-04-03 3:47 ` Linus Walleij 2019-04-03 3:47 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 35/42] drivers: gpio: ts4800: " Enrico Weigelt, metux IT consult 2019-04-03 3:48 ` Linus Walleij 2019-04-03 3:48 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 36/42] drivers: gpio: uniphier: " Enrico Weigelt, metux IT consult 2019-03-12 9:37 ` Masahiro Yamada 2019-03-12 9:37 ` Masahiro Yamada 2019-04-03 3:49 ` Linus Walleij 2019-04-03 3:49 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 37/42] drivers: gpio: vf610: " Enrico Weigelt, metux IT consult 2019-04-03 3:50 ` Linus Walleij 2019-04-03 3:50 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 38/42] drivers: gpio: vr41xx: " Enrico Weigelt, metux IT consult 2019-03-12 11:37 ` Thierry Reding 2019-03-12 15:42 ` Enrico Weigelt, metux IT consult 2019-03-12 16:02 ` Florian Fainelli 2019-04-03 3:51 ` Linus Walleij 2019-04-03 3:51 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 39/42] drivers: gpio: xgene-sb: " Enrico Weigelt, metux IT consult 2019-04-03 3:52 ` Linus Walleij 2019-04-03 3:52 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 40/42] drivers: gpio: zx: " Enrico Weigelt, metux IT consult 2019-04-03 3:53 ` Linus Walleij 2019-04-03 3:53 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 41/42] drivers: gpio: xlp: devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-04-03 3:54 ` Linus Walleij 2019-04-03 3:54 ` Linus Walleij 2019-03-11 18:55 ` [PATCH 42/42] drivers: gpio: use devm_platform_ioremap_resource() Enrico Weigelt, metux IT consult 2019-03-12 11:38 ` Thierry Reding 2019-04-03 3:57 ` Linus Walleij 2019-04-03 3:57 ` Linus Walleij 2019-04-02 8:03 ` [PATCH 01/42] drivers: gpio: 74xx-mmio: " Linus Walleij 2019-04-02 8:03 ` Linus Walleij
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CAMz4kuKC5haGbhyVJ4gQ6nMRzdaxJnd3SmeCSM-096p7TAp8cA@mail.gmail.com \ --to=baolin.wang@linaro.org \ --cc=andrew@aj.id.au \ --cc=bcm-kernel-feedback-list@broadcom.com \ --cc=bgolaszewski@baylibre.com \ --cc=f.fainelli@gmail.com \ --cc=grygorii.strashko@ti.com \ --cc=hoan@os.amperecomputing.com \ --cc=info@metux.net \ --cc=jun.nie@linaro.org \ --cc=keguang.zhang@gmail.com \ --cc=khilman@kernel.org \ --cc=linus.walleij@linaro.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mips@vger.kernel.org \ --cc=linux-pwm@vger.kernel.orgli \ --cc=matthias.bgg@gmail.com \ --cc=orsonzhai@gmail.com \ --cc=robert.jarzmik@free.fr \ --cc=sbranden@broadcom.com \ --cc=shawnguo@kernel.org \ --cc=ssantosh@kernel.org \ --cc=thierry.reding@gmail.com \ --cc=vz@mleia.com \ --cc=yamada.masahiro@socionext.com \ --cc=zhang.lyra@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.