netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull-request: can 2012-12-14
@ 2012-12-14 21:33 Marc Kleine-Budde
  2012-12-14 21:33 ` [PATCH] can: sja1000: fix compilation on x86 Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2012-12-14 21:33 UTC (permalink / raw)
  To: netdev; +Cc: linux-can, sfr, davem

Hello David,

here's a patch for net for the v3.8 release cycle. Randy Dunlap found a
compilation problem of the sja1000_of_platform driver on X86_32. A patch by me
fixes the problem.

regards, Marc

---

The following changes since commit 17bc14b767cf0692420c43dbe5310ae98a5a7836:

  Revert "sched: Update_cfs_shares at period edge" (2012-12-14 07:20:43 -0800)

are available in the git repository at:

  git://gitorious.org/linux-can/linux-can.git fixes-for-3.8

for you to fetch changes up to 27d5155f676598e461d9038eadf77bfebce48f30:

  can: sja1000: fix compilation on x86 (2012-12-14 22:07:10 +0100)

----------------------------------------------------------------
Marc Kleine-Budde (1):
      can: sja1000: fix compilation on x86

 drivers/net/can/sja1000/sja1000_of_platform.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



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

* [PATCH] can: sja1000: fix compilation on x86
  2012-12-14 21:33 pull-request: can 2012-12-14 Marc Kleine-Budde
@ 2012-12-14 21:33 ` Marc Kleine-Budde
  2012-12-14 21:37   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2012-12-14 21:33 UTC (permalink / raw)
  To: netdev; +Cc: linux-can, sfr, davem, Marc Kleine-Budde, Andreas Larsson

Since commit:
04df251 can: sja1000: Make sja1000_of_platform selectable and compilable on SPARC
the driver can be activated on non powerpc platform like x86 or sparc. Without
this patch the driver fails to compile on platform that don't define NO_IRQ,
like x86.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/sja1000/sja1000_of_platform.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
index 0f59170..38d37c8 100644
--- a/drivers/net/can/sja1000/sja1000_of_platform.c
+++ b/drivers/net/can/sja1000/sja1000_of_platform.c
@@ -121,7 +121,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev)
 	}
 
 	irq = irq_of_parse_and_map(np, 0);
-	if (irq == NO_IRQ) {
+	if (irq <= 0) {
 		dev_err(&ofdev->dev, "no irq found\n");
 		err = -ENODEV;
 		goto exit_unmap_mem;
-- 
1.7.10.4

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

* Re: [PATCH] can: sja1000: fix compilation on x86
  2012-12-14 21:33 ` [PATCH] can: sja1000: fix compilation on x86 Marc Kleine-Budde
@ 2012-12-14 21:37   ` David Miller
  2012-12-14 22:17     ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2012-12-14 21:37 UTC (permalink / raw)
  To: mkl; +Cc: netdev, linux-can, sfr, andreas

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Fri, 14 Dec 2012 22:33:44 +0100

> @@ -121,7 +121,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev)
>  	}
>  
>  	irq = irq_of_parse_and_map(np, 0);
> -	if (irq == NO_IRQ) {
> +	if (irq <= 0) {
>  		dev_err(&ofdev->dev, "no irq found\n");
>  		err = -ENODEV;
>  		goto exit_unmap_mem;

I don't see anything existing which says this is the proper
transformation.

There is no consistency at all for the tests of the return
value of irq_of_parse_and_map().

And if anything testing against zero is the correct thing to
do, universally.

I'm not applying this or pulling from your tree, sorry.

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

* Re: [PATCH] can: sja1000: fix compilation on x86
  2012-12-14 21:37   ` David Miller
@ 2012-12-14 22:17     ` Marc Kleine-Budde
  0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2012-12-14 22:17 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-can, sfr, andreas

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

On 12/14/2012 10:37 PM, David Miller wrote:
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Date: Fri, 14 Dec 2012 22:33:44 +0100
> 
>> @@ -121,7 +121,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev)
>>  	}
>>  
>>  	irq = irq_of_parse_and_map(np, 0);
>> -	if (irq == NO_IRQ) {
>> +	if (irq <= 0) {
>>  		dev_err(&ofdev->dev, "no irq found\n");
>>  		err = -ENODEV;
>>  		goto exit_unmap_mem;
> 
> I don't see anything existing which says this is the proper
> transformation.
> 
> There is no consistency at all for the tests of the return
> value of irq_of_parse_and_map().

Right. And the current status of NO_IRQ doesn't help much.

> And if anything testing against zero is the correct thing to
> do, universally.

I've looked at the implementation of irq_of_parse_and_map() (both the
generic and sparc one), they both return 0 on failure. Because there are
some arch that define NO_IRQ being not 0, sparc (0xffffffff) and arm
(-1), I though testing against <= 0 would be a good idea.

> I'm not applying this or pulling from your tree, sorry.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

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

end of thread, other threads:[~2012-12-14 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-14 21:33 pull-request: can 2012-12-14 Marc Kleine-Budde
2012-12-14 21:33 ` [PATCH] can: sja1000: fix compilation on x86 Marc Kleine-Budde
2012-12-14 21:37   ` David Miller
2012-12-14 22:17     ` Marc Kleine-Budde

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).