netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 20/33] net: Convert to devm_ioremap_resource()
       [not found] <1358762966-20791-1-git-send-email-thierry.reding@avionic-design.de>
@ 2013-01-21 10:09 ` Thierry Reding
  2013-01-21 20:29   ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Thierry Reding @ 2013-01-21 10:09 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Dmitry Torokhov, Arnd Bergmann, Wolfram Sang,
	David S. Miller, netdev

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
 drivers/net/can/grcan.c                               | 8 ++++----
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 9 ++++-----
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index 17fbc7a..4c3a7dd 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -26,6 +26,7 @@
  * Contributors: Andreas Larsson <andreas@gaisler.com>
  */
 
+#include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
@@ -1683,10 +1684,9 @@ static int grcan_probe(struct platform_device *ofdev)
 	}
 
 	res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-	base = devm_request_and_ioremap(&ofdev->dev, res);
-	if (!base) {
-		dev_err(&ofdev->dev, "couldn't map IO resource\n");
-		err = -EADDRNOTAVAIL;
+	base = devm_ioremap_resource(&ofdev->dev, res);
+	if (IS_ERR(base)) {
+		err = PTR_ERR(base);
 		goto exit_error;
 	}
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index b43d68b..a3431aa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -22,6 +22,7 @@
   Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
 *******************************************************************************/
 
+#include <linux/err.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/of.h>
@@ -88,11 +89,9 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
 	if (!res)
 		return -ENODEV;
 
-	addr = devm_request_and_ioremap(dev, res);
-	if (!addr) {
-		pr_err("%s: ERROR: memory mapping failed", __func__);
-		return -ENOMEM;
-	}
+	addr = devm_ioremap_resource(dev, res);
+	if (IS_ERR(addr))
+		return PTR_ERR(addr);
 
 	if (pdev->dev.of_node) {
 		plat_dat = devm_kzalloc(&pdev->dev,
-- 
1.8.1.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 20/33] net: Convert to devm_ioremap_resource()
  2013-01-21 10:09 ` [PATCH 20/33] net: Convert to devm_ioremap_resource() Thierry Reding
@ 2013-01-21 20:29   ` David Miller
  2013-01-22  6:56     ` Thierry Reding
  0 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2013-01-21 20:29 UTC (permalink / raw)
  To: thierry.reding
  Cc: linux-kernel, gregkh, dmitry.torokhov, arnd, w.sang, netdev

From: Thierry Reding <thierry.reding@avionic-design.de>
Date: Mon, 21 Jan 2013 11:09:13 +0100

> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
> 
> devm_ioremap_resource() provides its own error messages so all explicit
> error messages can be removed from the failure code paths.
> 
> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

This won't compile if I apply it.

You really have to be clear when you submit patches like this.

Since you only CC:'d the networking developers for this one
patch, there is _ZERO_ context for us to work with to understand
what's going on.

You have to also CC: us on the other relevant changes and your
"[PATCH 00/33]" posting that explains what is happening.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 20/33] net: Convert to devm_ioremap_resource()
  2013-01-21 20:29   ` David Miller
@ 2013-01-22  6:56     ` Thierry Reding
  2013-01-22 13:03       ` Arnd Bergmann
  2013-01-22 18:58       ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Thierry Reding @ 2013-01-22  6:56 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, gregkh, dmitry.torokhov, arnd, w.sang, netdev

[-- Attachment #1: Type: text/plain, Size: 1497 bytes --]

On Mon, Jan 21, 2013 at 03:29:13PM -0500, David Miller wrote:
> From: Thierry Reding <thierry.reding@avionic-design.de>
> Date: Mon, 21 Jan 2013 11:09:13 +0100
> 
> > Convert all uses of devm_request_and_ioremap() to the newly introduced
> > devm_ioremap_resource() which provides more consistent error handling.
> > 
> > devm_ioremap_resource() provides its own error messages so all explicit
> > error messages can be removed from the failure code paths.
> > 
> > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
> 
> This won't compile if I apply it.
> 
> You really have to be clear when you submit patches like this.
> 
> Since you only CC:'d the networking developers for this one
> patch, there is _ZERO_ context for us to work with to understand
> what's going on.
> 
> You have to also CC: us on the other relevant changes and your
> "[PATCH 00/33]" posting that explains what is happening.

I planned to do so initially, but that yielded a Cc list of 156 people
and mailing lists, which I thought wasn't going to go down so well
either. In general I like Cc'ing everyone concerned on all patches of
the series, specifically for reasons of context. Some people have been
annoyed when I did so. Still, for small series where only a few dozen
people are concerned that seems to me to be the best way. But 156 email
addresses is a different story.

Either you add to many people or you don't add enough. Where do we draw
the line?

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 20/33] net: Convert to devm_ioremap_resource()
  2013-01-22  6:56     ` Thierry Reding
@ 2013-01-22 13:03       ` Arnd Bergmann
  2013-01-22 13:09         ` Thierry Reding
  2013-01-22 19:08         ` David Miller
  2013-01-22 18:58       ` David Miller
  1 sibling, 2 replies; 8+ messages in thread
From: Arnd Bergmann @ 2013-01-22 13:03 UTC (permalink / raw)
  To: Thierry Reding
  Cc: David Miller, linux-kernel, gregkh, dmitry.torokhov, w.sang,
	netdev

On Tuesday 22 January 2013, Thierry Reding wrote:
> I planned to do so initially, but that yielded a Cc list of 156 people
> and mailing lists, which I thought wasn't going to go down so well
> either. In general I like Cc'ing everyone concerned on all patches of
> the series, specifically for reasons of context. Some people have been
> annoyed when I did so. Still, for small series where only a few dozen
> people are concerned that seems to me to be the best way. But 156 email
> addresses is a different story.
> 
> Either you add to many people or you don't add enough. Where do we draw
> the line?

I've had the same problem a couple of times. The best compromise seems
to be to Cc only the top-level subsystem maintainers and mailing lists
on the first email.

	Arnd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 20/33] net: Convert to devm_ioremap_resource()
  2013-01-22 13:03       ` Arnd Bergmann
@ 2013-01-22 13:09         ` Thierry Reding
  2013-01-22 13:17           ` Arnd Bergmann
  2013-01-22 19:08         ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Thierry Reding @ 2013-01-22 13:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David Miller, linux-kernel, gregkh, dmitry.torokhov, w.sang,
	netdev

[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]

On Tue, Jan 22, 2013 at 01:03:06PM +0000, Arnd Bergmann wrote:
> On Tuesday 22 January 2013, Thierry Reding wrote:
> > I planned to do so initially, but that yielded a Cc list of 156 people
> > and mailing lists, which I thought wasn't going to go down so well
> > either. In general I like Cc'ing everyone concerned on all patches of
> > the series, specifically for reasons of context. Some people have been
> > annoyed when I did so. Still, for small series where only a few dozen
> > people are concerned that seems to me to be the best way. But 156 email
> > addresses is a different story.
> > 
> > Either you add to many people or you don't add enough. Where do we draw
> > the line?
> 
> I've had the same problem a couple of times. The best compromise seems
> to be to Cc only the top-level subsystem maintainers and mailing lists
> on the first email.

Even that would have been about 50 addresses IIRC. But perhaps that's
still the best compromise to avoid any confusion.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 20/33] net: Convert to devm_ioremap_resource()
  2013-01-22 13:09         ` Thierry Reding
@ 2013-01-22 13:17           ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2013-01-22 13:17 UTC (permalink / raw)
  To: Thierry Reding
  Cc: David Miller, linux-kernel, gregkh, dmitry.torokhov, w.sang,
	netdev

On Tuesday 22 January 2013, Thierry Reding wrote:
> > I've had the same problem a couple of times. The best compromise seems
> > to be to Cc only the top-level subsystem maintainers and mailing lists
> > on the first email.
> 
> Even that would have been about 50 addresses IIRC. But perhaps that's
> still the best compromise to avoid any confusion.

Be careful though that the Cc list must not exceed 1024 characters or
it will get rejected by some of the mailing list servers.

	Arnd

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 20/33] net: Convert to devm_ioremap_resource()
  2013-01-22  6:56     ` Thierry Reding
  2013-01-22 13:03       ` Arnd Bergmann
@ 2013-01-22 18:58       ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2013-01-22 18:58 UTC (permalink / raw)
  To: thierry.reding
  Cc: linux-kernel, gregkh, dmitry.torokhov, arnd, w.sang, netdev

From: Thierry Reding <thierry.reding@avionic-design.de>
Date: Tue, 22 Jan 2013 07:56:29 +0100

> I planned to do so initially, but that yielded a Cc list of 156 people
> and mailing lists,

Just use mailing lists, the individuals are subscribed to the subsystem
lists that cover what they maintain.

Yes, CC:'ing 156 "people" is stupid.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 20/33] net: Convert to devm_ioremap_resource()
  2013-01-22 13:03       ` Arnd Bergmann
  2013-01-22 13:09         ` Thierry Reding
@ 2013-01-22 19:08         ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2013-01-22 19:08 UTC (permalink / raw)
  To: arnd; +Cc: thierry.reding, linux-kernel, gregkh, dmitry.torokhov, w.sang,
	netdev

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 22 Jan 2013 13:03:06 +0000

> On Tuesday 22 January 2013, Thierry Reding wrote:
>> I planned to do so initially, but that yielded a Cc list of 156 people
>> and mailing lists, which I thought wasn't going to go down so well
>> either. In general I like Cc'ing everyone concerned on all patches of
>> the series, specifically for reasons of context. Some people have been
>> annoyed when I did so. Still, for small series where only a few dozen
>> people are concerned that seems to me to be the best way. But 156 email
>> addresses is a different story.
>> 
>> Either you add to many people or you don't add enough. Where do we draw
>> the line?
> 
> I've had the same problem a couple of times. The best compromise seems
> to be to Cc only the top-level subsystem maintainers and mailing lists
> on the first email.

CC:'ing individuals is pointless, CC: only the subsystem lists in
question, the maintainers had better be reading those lists.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-22 19:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1358762966-20791-1-git-send-email-thierry.reding@avionic-design.de>
2013-01-21 10:09 ` [PATCH 20/33] net: Convert to devm_ioremap_resource() Thierry Reding
2013-01-21 20:29   ` David Miller
2013-01-22  6:56     ` Thierry Reding
2013-01-22 13:03       ` Arnd Bergmann
2013-01-22 13:09         ` Thierry Reding
2013-01-22 13:17           ` Arnd Bergmann
2013-01-22 19:08         ` David Miller
2013-01-22 18:58       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).