public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition
@ 2012-03-21  9:51 Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 02/11] m68k/amiga: Mark z_dev_present() __init Geert Uytterhoeven
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/include/asm/entry.h |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/include/asm/entry.h b/arch/m68k/include/asm/entry.h
index 622138d..5d8b21c 100644
--- a/arch/m68k/include/asm/entry.h
+++ b/arch/m68k/include/asm/entry.h
@@ -35,11 +35,9 @@
 #if defined(MACH_ATARI_ONLY)
 	/* block out HSYNC on the atari */
 #define ALLOWINT	(~0x400)
-#define	MAX_NOINT_IPL	3
 #else
 	/* portable version */
 #define ALLOWINT	(~0x700)
-#define	MAX_NOINT_IPL	0
 #endif /* machine compilation types */
 
 #ifdef __ASSEMBLY__
-- 
1.7.0.4

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

* [PATCH 02/11] m68k/amiga: Mark z_dev_present() __init
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 03/11] m68k/amiga: Add error checks when registering platform devices Geert Uytterhoeven
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

It's called from amiga_init_devices() only, which is __init.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/amiga/platform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c
index 7fd8b41..1b8db5c 100644
--- a/arch/m68k/amiga/platform.c
+++ b/arch/m68k/amiga/platform.c
@@ -57,7 +57,7 @@ static int __init amiga_init_bus(void)
 subsys_initcall(amiga_init_bus);
 
 
-static int z_dev_present(zorro_id id)
+static int __init z_dev_present(zorro_id id)
 {
 	unsigned int i;
 
-- 
1.7.0.4

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

* [PATCH 03/11] m68k/amiga: Add error checks when registering platform devices
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 02/11] m68k/amiga: Mark z_dev_present() __init Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 04/11] m68k/amiga: Use arch_initcall() for " Geert Uytterhoeven
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/amiga/platform.c |  122 ++++++++++++++++++++++++++++++++------------
 1 files changed, 90 insertions(+), 32 deletions(-)

diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c
index 1b8db5c..2872891 100644
--- a/arch/m68k/amiga/platform.c
+++ b/arch/m68k/amiga/platform.c
@@ -6,6 +6,7 @@
  * for more details.
  */
 
+#include <linux/err.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/zorro.h>
@@ -46,11 +47,18 @@ static const struct resource zorro_resources[] __initconst = {
 
 static int __init amiga_init_bus(void)
 {
+	struct platform_device *pdev;
+	unsigned int n;
+
 	if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
 		return -ENODEV;
 
-	platform_device_register_simple("amiga-zorro", -1, zorro_resources,
-					AMIGAHW_PRESENT(ZORRO3) ? 4 : 2);
+	n = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
+	pdev = platform_device_register_simple("amiga-zorro", -1,
+					       zorro_resources, n);
+	if (IS_ERR(pdev))
+		return PTR_ERR(pdev);
+
 	return 0;
 }
 
@@ -126,70 +134,120 @@ static const struct resource amiga_rtc_resource __initconst = {
 static int __init amiga_init_devices(void)
 {
 	struct platform_device *pdev;
+	int error;
 
 	if (!MACH_IS_AMIGA)
 		return -ENODEV;
 
 	/* video hardware */
-	if (AMIGAHW_PRESENT(AMI_VIDEO))
-		platform_device_register_simple("amiga-video", -1, NULL, 0);
+	if (AMIGAHW_PRESENT(AMI_VIDEO)) {
+		pdev = platform_device_register_simple("amiga-video", -1, NULL,
+						       0);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
 
 	/* sound hardware */
-	if (AMIGAHW_PRESENT(AMI_AUDIO))
-		platform_device_register_simple("amiga-audio", -1, NULL, 0);
+	if (AMIGAHW_PRESENT(AMI_AUDIO)) {
+		pdev = platform_device_register_simple("amiga-audio", -1, NULL,
+						       0);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
 
 	/* storage interfaces */
-	if (AMIGAHW_PRESENT(AMI_FLOPPY))
-		platform_device_register_simple("amiga-floppy", -1, NULL, 0);
+	if (AMIGAHW_PRESENT(AMI_FLOPPY)) {
+		pdev = platform_device_register_simple("amiga-floppy", -1,
+						       NULL, 0);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
-	if (AMIGAHW_PRESENT(A3000_SCSI))
-		platform_device_register_simple("amiga-a3000-scsi", -1,
-						&a3000_scsi_resource, 1);
+	if (AMIGAHW_PRESENT(A3000_SCSI)) {
+		pdev = platform_device_register_simple("amiga-a3000-scsi", -1,
+						       &a3000_scsi_resource, 1);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
-	if (AMIGAHW_PRESENT(A4000_SCSI))
-		platform_device_register_simple("amiga-a4000t-scsi", -1,
-						&a4000t_scsi_resource, 1);
+	if (AMIGAHW_PRESENT(A4000_SCSI)) {
+		pdev = platform_device_register_simple("amiga-a4000t-scsi", -1,
+						       &a4000t_scsi_resource,
+						       1);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
 	if (AMIGAHW_PRESENT(A1200_IDE) ||
 	    z_dev_present(ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE)) {
 		pdev = platform_device_register_simple("amiga-gayle-ide", -1,
 						       &a1200_ide_resource, 1);
-		platform_device_add_data(pdev, &a1200_ide_pdata,
-					 sizeof(a1200_ide_pdata));
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+		error = platform_device_add_data(pdev, &a1200_ide_pdata,
+						 sizeof(a1200_ide_pdata));
+		if (error)
+			return error;
 	}
 
 	if (AMIGAHW_PRESENT(A4000_IDE)) {
 		pdev = platform_device_register_simple("amiga-gayle-ide", -1,
 						       &a4000_ide_resource, 1);
-		platform_device_add_data(pdev, &a4000_ide_pdata,
-					 sizeof(a4000_ide_pdata));
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+		error = platform_device_add_data(pdev, &a4000_ide_pdata,
+						 sizeof(a4000_ide_pdata));
+		if (error)
+			return error;
 	}
 
 
 	/* other I/O hardware */
-	if (AMIGAHW_PRESENT(AMI_KEYBOARD))
-		platform_device_register_simple("amiga-keyboard", -1, NULL, 0);
+	if (AMIGAHW_PRESENT(AMI_KEYBOARD)) {
+		pdev = platform_device_register_simple("amiga-keyboard", -1,
+						       NULL, 0);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
-	if (AMIGAHW_PRESENT(AMI_MOUSE))
-		platform_device_register_simple("amiga-mouse", -1, NULL, 0);
+	if (AMIGAHW_PRESENT(AMI_MOUSE)) {
+		pdev = platform_device_register_simple("amiga-mouse", -1, NULL,
+						       0);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
-	if (AMIGAHW_PRESENT(AMI_SERIAL))
-		platform_device_register_simple("amiga-serial", -1, NULL, 0);
+	if (AMIGAHW_PRESENT(AMI_SERIAL)) {
+		pdev = platform_device_register_simple("amiga-serial", -1,
+						       NULL, 0);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
-	if (AMIGAHW_PRESENT(AMI_PARALLEL))
-		platform_device_register_simple("amiga-parallel", -1, NULL, 0);
+	if (AMIGAHW_PRESENT(AMI_PARALLEL)) {
+		pdev = platform_device_register_simple("amiga-parallel", -1,
+						       NULL, 0);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
 
 	/* real time clocks */
-	if (AMIGAHW_PRESENT(A2000_CLK))
-		platform_device_register_simple("rtc-msm6242", -1,
-						&amiga_rtc_resource, 1);
+	if (AMIGAHW_PRESENT(A2000_CLK)) {
+		pdev = platform_device_register_simple("rtc-msm6242", -1,
+						       &amiga_rtc_resource, 1);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
-	if (AMIGAHW_PRESENT(A3000_CLK))
-		platform_device_register_simple("rtc-rp5c01", -1,
-						&amiga_rtc_resource, 1);
+	if (AMIGAHW_PRESENT(A3000_CLK)) {
+		pdev = platform_device_register_simple("rtc-rp5c01", -1,
+						       &amiga_rtc_resource, 1);
+		if (IS_ERR(pdev))
+			return PTR_ERR(pdev);
+	}
 
 	return 0;
 }
-- 
1.7.0.4

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

* [PATCH 04/11] m68k/amiga: Use arch_initcall() for registering platform devices
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 02/11] m68k/amiga: Mark z_dev_present() __init Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 03/11] m68k/amiga: Add error checks when registering platform devices Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 05/11] m68k/atari: Add missing platform check before " Geert Uytterhoeven
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

module_init() maps to device_initcall(), opening the possibility of
race conditions between platform_driver_probe() and registering platform
devices.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/amiga/platform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c
index 2872891..80076d3 100644
--- a/arch/m68k/amiga/platform.c
+++ b/arch/m68k/amiga/platform.c
@@ -252,4 +252,4 @@ static int __init amiga_init_devices(void)
 	return 0;
 }
 
-device_initcall(amiga_init_devices);
+arch_initcall(amiga_init_devices);
-- 
1.7.0.4

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

* [PATCH 05/11] m68k/atari: Add missing platform check before registering platform devices
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2012-03-21  9:51 ` [PATCH 04/11] m68k/amiga: Use arch_initcall() for " Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 06/11] m68k/atari: Change VME irq numbers from unsigned long to unsigned int Geert Uytterhoeven
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven

On multi-platform kernels, the Atari platform devices should be registered
when running on Atari only. Else it may crash later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/atari/config.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
index af78731..35fb81d 100644
--- a/arch/m68k/atari/config.c
+++ b/arch/m68k/atari/config.c
@@ -693,6 +693,9 @@ static struct platform_device *atari_platform_devices[] __initdata = {
 
 int __init atari_platform_init(void)
 {
+	if (!MACH_IS_ATARI)
+		return -ENODEV;
+
 	return platform_add_devices(atari_platform_devices, ARRAY_SIZE(atari_platform_devices));
 }
 
-- 
1.7.0.4

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

* [PATCH 06/11] m68k/atari: Change VME irq numbers from unsigned long to unsigned int
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2012-03-21  9:51 ` [PATCH 05/11] m68k/atari: Add missing platform check before " Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 07/11] m68k/mac: Add missing platform check before registering platform devices Geert Uytterhoeven
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven, netdev

Device interrupts numbers were changed to unsigned int in 1997, the year
IRQ_MACHSPEC was killed as well.

Also kill a related cast while we're at it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: netdev@vger.kernel.org
---
 arch/m68k/atari/ataints.c             |    4 ++--
 arch/m68k/include/asm/atariints.h     |    4 ++--
 drivers/net/ethernet/amd/atarilance.c |   11 ++++-------
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index 8048e1b..54807d5 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -207,7 +207,7 @@ void __init atari_init_IRQ(void)
  * hardware with a programmable int vector (probably a VME board).
  */
 
-unsigned long atari_register_vme_int(void)
+unsigned int atari_register_vme_int(void)
 {
 	int i;
 
@@ -224,7 +224,7 @@ unsigned long atari_register_vme_int(void)
 EXPORT_SYMBOL(atari_register_vme_int);
 
 
-void atari_unregister_vme_int(unsigned long irq)
+void atari_unregister_vme_int(unsigned int irq)
 {
 	if (irq >= VME_SOURCE_BASE && irq < VME_SOURCE_BASE + VME_MAX_SOURCES) {
 		irq -= VME_SOURCE_BASE;
diff --git a/arch/m68k/include/asm/atariints.h b/arch/m68k/include/asm/atariints.h
index 656bbbf..5fc13bd 100644
--- a/arch/m68k/include/asm/atariints.h
+++ b/arch/m68k/include/asm/atariints.h
@@ -198,7 +198,7 @@ static inline int atari_irq_pending( unsigned irq )
 	return( get_mfp_bit( irq, MFP_PENDING ) );
 }
 
-unsigned long atari_register_vme_int( void );
-void atari_unregister_vme_int( unsigned long );
+unsigned int atari_register_vme_int(void);
+void atari_unregister_vme_int(unsigned int);
 
 #endif /* linux/atariints.h */
diff --git a/drivers/net/ethernet/amd/atarilance.c b/drivers/net/ethernet/amd/atarilance.c
index 15bfa28..20a4f6d 100644
--- a/drivers/net/ethernet/amd/atarilance.c
+++ b/drivers/net/ethernet/amd/atarilance.c
@@ -558,21 +558,18 @@ static unsigned long __init lance_probe1( struct net_device *dev,
 			printk( "Lance: request for irq %d failed\n", IRQ_AUTO_5 );
 			return 0;
 		}
-		dev->irq = (unsigned short)IRQ_AUTO_5;
+		dev->irq = IRQ_AUTO_5;
 	}
 	else {
-		/* For VME-RieblCards, request a free VME int;
-		 * (This must be unsigned long, since dev->irq is short and the
-		 * IRQ_MACHSPEC bit would be cut off...)
-		 */
-		unsigned long irq = atari_register_vme_int();
+		/* For VME-RieblCards, request a free VME int */
+		unsigned int irq = atari_register_vme_int();
 		if (!irq) {
 			printk( "Lance: request for VME interrupt failed\n" );
 			return 0;
 		}
 		if (request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO,
 		            "Riebl-VME Ethernet", dev)) {
-			printk( "Lance: request for irq %ld failed\n", irq );
+			printk( "Lance: request for irq %u failed\n", irq );
 			return 0;
 		}
 		dev->irq = irq;
-- 
1.7.0.4

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

* [PATCH 07/11] m68k/mac: Add missing platform check before registering platform devices
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2012-03-21  9:51 ` [PATCH 06/11] m68k/atari: Change VME irq numbers from unsigned long to unsigned int Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 08/11] input/amijoy: Add missing platform check Geert Uytterhoeven
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven, stable

On multi-platform kernels, the Mac platform devices should be registered
when running on Mac only. Else it may crash later.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: stable@vger.kernel.org
---
 arch/m68k/mac/config.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index f60ff5f..da3b8d8 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -981,6 +981,9 @@ int __init mac_platform_init(void)
 {
 	u8 *swim_base;
 
+	if (!MACH_IS_MAC)
+		return -ENODEV;
+
 	/*
 	 * Serial devices
 	 */
-- 
1.7.0.4

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

* [PATCH 08/11] input/amijoy: Add missing platform check
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
                   ` (5 preceding siblings ...)
  2012-03-21  9:51 ` [PATCH 07/11] m68k/mac: Add missing platform check before registering platform devices Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 09/11] net/ariadne: Improve debug prints Geert Uytterhoeven
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven, Dmitry Torokhov, linux-input

On multi-platform kernels, the Amiga joystick driver may be initialized
when running on Amiga only. Else it may crash later.
Fortunately this driver is almost always compiled as a module (to avoid
conflicts with the mouse driver), so it needs an explicit insmod to
trigger a crash.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
---
 drivers/input/joystick/amijoy.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index 0bc8620..3aa93bf 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/drivers/input/joystick/amijoy.c
@@ -108,6 +108,9 @@ static int __init amijoy_init(void)
 	int i, j;
 	int err;
 
+	if (!MACH_IS_AMIGA)
+		return -ENODEV;
+
 	for (i = 0; i < 2; i++) {
 		if (!amijoy[i])
 			continue;
-- 
1.7.0.4

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

* [PATCH 09/11] net/ariadne: Improve debug prints
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
                   ` (6 preceding siblings ...)
  2012-03-21  9:51 ` [PATCH 08/11] input/amijoy: Add missing platform check Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 10/11] scsi/atari: Revive "atascsi=" setup option Geert Uytterhoeven
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k; +Cc: linux-kernel, Geert Uytterhoeven, David S. Miller, netdev

Remove casts and use proper printf()-style format specifiers instead.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
 drivers/net/ethernet/amd/ariadne.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/amd/ariadne.c b/drivers/net/ethernet/amd/ariadne.c
index eb18e1f..2e7a1c5 100644
--- a/drivers/net/ethernet/amd/ariadne.c
+++ b/drivers/net/ethernet/amd/ariadne.c
@@ -213,10 +213,10 @@ static int ariadne_rx(struct net_device *dev)
 						(const void *)priv->rx_buff[entry],
 						pkt_len);
 			skb->protocol = eth_type_trans(skb, dev);
-			netdev_dbg(dev, "RX pkt type 0x%04x from %pM to %pM data 0x%08x len %d\n",
+			netdev_dbg(dev, "RX pkt type 0x%04x from %pM to %pM data %p len %u\n",
 				   ((u_short *)skb->data)[6],
 				   skb->data + 6, skb->data,
-				   (int)skb->data, (int)skb->len);
+				   skb->data, skb->len);
 
 			netif_rx(skb);
 			dev->stats.rx_packets++;
@@ -566,10 +566,10 @@ static netdev_tx_t ariadne_start_xmit(struct sk_buff *skb,
 
 	/* Fill in a Tx ring entry */
 
-	netdev_dbg(dev, "TX pkt type 0x%04x from %pM to %pM data 0x%08x len %d\n",
+	netdev_dbg(dev, "TX pkt type 0x%04x from %pM to %pM data %p len %u\n",
 		   ((u_short *)skb->data)[6],
 		   skb->data + 6, skb->data,
-		   (int)skb->data, (int)skb->len);
+		   skb->data, skb->len);
 
 	local_irq_save(flags);
 
-- 
1.7.0.4

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

* [PATCH 10/11] scsi/atari: Revive "atascsi=" setup option
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
                   ` (7 preceding siblings ...)
  2012-03-21  9:51 ` [PATCH 09/11] net/ariadne: Improve debug prints Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
  2012-03-21  9:51 ` [PATCH 11/11] scsi/atari: Make more functions static Geert Uytterhoeven
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k
  Cc: linux-kernel, Geert Uytterhoeven, Michael Schmitz,
	James E.J. Bottomley, linux-scsi

It was documented in Documentation/m68k/kernel-options.txt and
Documentation/scsi/scsi-parameters.txt, but the implementation was
missing.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@googlemail.com>
Cc: James E.J. Bottomley <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/atari_scsi.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index 04a154f..3102ce5 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -734,17 +734,21 @@ int atari_scsi_release(struct Scsi_Host *sh)
 	return 1;
 }
 
-void __init atari_scsi_setup(char *str, int *ints)
+#ifndef MODULE
+static int __init atari_scsi_setup(char *str)
 {
 	/* Format of atascsi parameter is:
 	 *   atascsi=<can_queue>,<cmd_per_lun>,<sg_tablesize>,<hostid>,<use_tags>
 	 * Defaults depend on TT or Falcon, hostid determined at run time.
 	 * Negative values mean don't change.
 	 */
+	int ints[6];
+
+	get_options(str, ARRAY_SIZE(ints), ints);
 
 	if (ints[0] < 1) {
 		printk("atari_scsi_setup: no arguments!\n");
-		return;
+		return 0;
 	}
 
 	if (ints[0] >= 1) {
@@ -777,8 +781,13 @@ void __init atari_scsi_setup(char *str, int *ints)
 			setup_use_tagged_queuing = !!ints[5];
 	}
 #endif
+
+	return 1;
 }
 
+__setup("atascsi=", atari_scsi_setup);
+#endif /* !MODULE */
+
 int atari_scsi_bus_reset(Scsi_Cmnd *cmd)
 {
 	int rv;
-- 
1.7.0.4

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

* [PATCH 11/11] scsi/atari: Make more functions static
  2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
                   ` (8 preceding siblings ...)
  2012-03-21  9:51 ` [PATCH 10/11] scsi/atari: Revive "atascsi=" setup option Geert Uytterhoeven
@ 2012-03-21  9:51 ` Geert Uytterhoeven
       [not found] ` <1332323515-7314-9-git-send-email-geert@linux-m68k.org>
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-21  9:51 UTC (permalink / raw)
  To: linux-m68k
  Cc: linux-kernel, Geert Uytterhoeven, Michael Schmitz,
	James E.J. Bottomley, linux-scsi

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@googlemail.com>
Cc: James E.J. Bottomley <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
---
 drivers/scsi/atari_scsi.c |   13 +++++++------
 drivers/scsi/atari_scsi.h |    5 -----
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index 3102ce5..df740cb 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -572,7 +572,7 @@ static void falcon_get_lock(void)
 }
 
 
-int __init atari_scsi_detect(struct scsi_host_template *host)
+static int __init atari_scsi_detect(struct scsi_host_template *host)
 {
 	static int called = 0;
 	struct Scsi_Host *instance;
@@ -724,7 +724,7 @@ int __init atari_scsi_detect(struct scsi_host_template *host)
 	return 1;
 }
 
-int atari_scsi_release(struct Scsi_Host *sh)
+static int atari_scsi_release(struct Scsi_Host *sh)
 {
 	if (IS_A_TT())
 		free_irq(IRQ_TT_MFP_SCSI, sh);
@@ -788,7 +788,7 @@ static int __init atari_scsi_setup(char *str)
 __setup("atascsi=", atari_scsi_setup);
 #endif /* !MODULE */
 
-int atari_scsi_bus_reset(Scsi_Cmnd *cmd)
+static int atari_scsi_bus_reset(Scsi_Cmnd *cmd)
 {
 	int rv;
 	struct NCR5380_hostdata *hostdata =
@@ -861,7 +861,7 @@ static void __init atari_scsi_reset_boot(void)
 #endif
 
 
-const char *atari_scsi_info(struct Scsi_Host *host)
+static const char *atari_scsi_info(struct Scsi_Host *host)
 {
 	/* atari_scsi_detect() is verbose enough... */
 	static const char string[] = "Atari native SCSI";
@@ -871,8 +871,9 @@ const char *atari_scsi_info(struct Scsi_Host *host)
 
 #if defined(REAL_DMA)
 
-unsigned long atari_scsi_dma_setup(struct Scsi_Host *instance, void *data,
-				   unsigned long count, int dir)
+static unsigned long atari_scsi_dma_setup(struct Scsi_Host *instance,
+					  void *data, unsigned long count,
+					  int dir)
 {
 	unsigned long addr = virt_to_phys(data);
 
diff --git a/drivers/scsi/atari_scsi.h b/drivers/scsi/atari_scsi.h
index efadb8d..bd52df7 100644
--- a/drivers/scsi/atari_scsi.h
+++ b/drivers/scsi/atari_scsi.h
@@ -18,11 +18,6 @@
 /* (I_HAVE_OVERRUNS stuff removed) */
 
 #ifndef ASM
-int atari_scsi_detect (struct scsi_host_template *);
-const char *atari_scsi_info (struct Scsi_Host *);
-int atari_scsi_reset (Scsi_Cmnd *, unsigned int);
-int atari_scsi_release (struct Scsi_Host *);
-
 /* The values for CMD_PER_LUN and CAN_QUEUE are somehow arbitrary. Higher
  * values should work, too; try it! (but cmd_per_lun costs memory!) */
 
-- 
1.7.0.4

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

* Re: [PATCH 09/11] net/ariadne: Improve debug prints
       [not found] ` <1332323515-7314-9-git-send-email-geert@linux-m68k.org>
@ 2012-03-22  2:16   ` David Miller
  0 siblings, 0 replies; 16+ messages in thread
From: David Miller @ 2012-03-22  2:16 UTC (permalink / raw)
  To: geert; +Cc: linux-m68k, linux-kernel, netdev

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 21 Mar 2012 10:51:53 +0100

> Remove casts and use proper printf()-style format specifiers instead.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

You can merge these in via the m68k tree if you want.

Acked-by: David S. Miller <davem@davemloft.net>

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

* Re: [PATCH 05/11] m68k/atari: Add missing platform check before registering platform devices
       [not found] ` <1332323515-7314-5-git-send-email-geert@linux-m68k.org>
@ 2012-03-25  3:46   ` Michael Schmitz
       [not found]   ` <4F6E950E.30809@gmail.com>
  1 sibling, 0 replies; 16+ messages in thread
From: Michael Schmitz @ 2012-03-25  3:46 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, linux-kernel

Geert,
> On multi-platform kernels, the Atari platform devices should be registered
> when running on Atari only. Else it may crash later.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  arch/m68k/atari/config.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
> index af78731..35fb81d 100644
> --- a/arch/m68k/atari/config.c
> +++ b/arch/m68k/atari/config.c
> @@ -693,6 +693,9 @@ static struct platform_device *atari_platform_devices[] __initdata = {
>  
>  int __init atari_platform_init(void)
>  {
> +	if (!MACH_IS_ATARI)
> +		return -ENODEV;
> +
>  	return platform_add_devices(atari_platform_devices, ARRAY_SIZE(atari_platform_devices));
>  }
>  
>   

How about this instead - probe for the EtherNAT config register, and 
register devices only if found?

(may apply with a bit of fuzz)

Otherwise, Acked-by: Michael Schmitz <schmitz@debian.org>.

--- arch/m68k/atari/config.c.org    2012-03-25 16:02:12.000000000 +1300
+++ arch/m68k/atari/config.c    2012-03-25 13:37:21.000000000 +1300
@@ -753,7 +753,19 @@
 
 int __init atari_platform_init(void)
 {
-    return platform_add_devices(atari_platform_devices, 
ARRAY_SIZE(atari_platform_devices));
+    if (MACH_IS_ATARI) {
+        u8 ethernat_cr;
+        unsigned long enatc_phys = 0x80000023;
+        unsigned char *enatc_virt;
+       
+        enatc_virt = (unsigned char *)ioremap(enatc_phys, 0xf);
+        if (hwreg_present(enatc_virt)) {
+            iounmap(enatc_virt);
+            return platform_add_devices(atari_platform_devices, 
ARRAY_SIZE(atari_platform_devices));
+        }
+        iounmap(enatc_virt);
+    }
+    return -ENODEV;   
 }
 
 arch_initcall(atari_platform_init);

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

* Re: [PATCH 05/11] m68k/atari: Add missing platform check before registering platform devices
       [not found]   ` <4F6E950E.30809@gmail.com>
@ 2012-03-25  8:01     ` Geert Uytterhoeven
  2012-03-25 18:53       ` Michael Schmitz
  0 siblings, 1 reply; 16+ messages in thread
From: Geert Uytterhoeven @ 2012-03-25  8:01 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: linux-m68k, linux-kernel

Hi Michael,

On Sun, Mar 25, 2012 at 05:46, Michael Schmitz
<schmitzmic@googlemail.com> wrote:
>> On multi-platform kernels, the Atari platform devices should be registered
>> when running on Atari only. Else it may crash later.
>>
>> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> ---
>>  arch/m68k/atari/config.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/m68k/atari/config.c b/arch/m68k/atari/config.c
>> index af78731..35fb81d 100644
>> --- a/arch/m68k/atari/config.c
>> +++ b/arch/m68k/atari/config.c
>> @@ -693,6 +693,9 @@ static struct platform_device
>> *atari_platform_devices[] __initdata = {
>>  int __init atari_platform_init(void)
>>  {
>> +       if (!MACH_IS_ATARI)
>> +               return -ENODEV;
>> +
>>        return platform_add_devices(atari_platform_devices,
>> ARRAY_SIZE(atari_platform_devices));
>>  }
>>
>
>
> How about this instead - probe for the EtherNAT config register, and
> register devices only if found?

That's even better, but logically, it's an extra change on top, so I'd like
to keep it separate.

> (may apply with a bit of fuzz)
>
> Otherwise, Acked-by: Michael Schmitz <schmitz@debian.org>.
>
> --- arch/m68k/atari/config.c.org    2012-03-25 16:02:12.000000000 +1300
> +++ arch/m68k/atari/config.c    2012-03-25 13:37:21.000000000 +1300
> @@ -753,7 +753,19 @@
>
> int __init atari_platform_init(void)
> {
> -    return platform_add_devices(atari_platform_devices,
> ARRAY_SIZE(atari_platform_devices));
> +    if (MACH_IS_ATARI) {

I prefer the "if (!MACH_IS_ATARI) return -ENODEV;" at the top, as it
  - means less code to change if more platform devices are added,
  - means less source code to keep on your mental stack when reading the code,
  - decreases indentation for the rest of the function.

> +        u8 ethernat_cr;
> +        unsigned long enatc_phys = 0x80000023;
> +        unsigned char *enatc_virt;
> +       +        enatc_virt = (unsigned char *)ioremap(enatc_phys, 0xf);
> +        if (hwreg_present(enatc_virt)) {
> +            iounmap(enatc_virt);
> +            return platform_add_devices(atari_platform_devices,
> ARRAY_SIZE(atari_platform_devices));
> +        }
> +        iounmap(enatc_virt);
> +    }
> +    return -ENODEV;   }
>
> arch_initcall(atari_platform_init);

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 05/11] m68k/atari: Add missing platform check before registering platform devices
  2012-03-25  8:01     ` Geert Uytterhoeven
@ 2012-03-25 18:53       ` Michael Schmitz
  0 siblings, 0 replies; 16+ messages in thread
From: Michael Schmitz @ 2012-03-25 18:53 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, linux-kernel

Hi Geert,


>> How about this instead - probe for the EtherNAT config register, and
>> register devices only if found?
>
> That's even better, but logically, it's an extra change on top, so I'd like
> to keep it separate.

OK, I'll resend as soon as I've pulled your latest changes.

>> +    if (MACH_IS_ATARI) {
>
> I prefer the "if (!MACH_IS_ATARI) return -ENODEV;" at the top, as it
>  - means less code to change if more platform devices are added,
>  - means less source code to keep on your mental stack when reading the code,
>  - decreases indentation for the rest of the function.

OK; do you want the tests and platform calls conditional on config
options (we only need to have the platform data available if there's a
driver or module built to use it)?

Cheers,

  Michael

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

* Re: [PATCH 08/11] input/amijoy: Add missing platform check
       [not found] ` <1332323515-7314-8-git-send-email-geert@linux-m68k.org>
@ 2012-03-26  6:29   ` Dmitry Torokhov
  0 siblings, 0 replies; 16+ messages in thread
From: Dmitry Torokhov @ 2012-03-26  6:29 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, linux-kernel, linux-input

On Wed, Mar 21, 2012 at 10:51:52AM +0100, Geert Uytterhoeven wrote:
> On multi-platform kernels, the Amiga joystick driver may be initialized
> when running on Amiga only. Else it may crash later.
> Fortunately this driver is almost always compiled as a module (to avoid
> conflicts with the mouse driver), so it needs an explicit insmod to
> trigger a crash.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input@vger.kernel.org

Applied, thanks Geert.

> ---
>  drivers/input/joystick/amijoy.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
> index 0bc8620..3aa93bf 100644
> --- a/drivers/input/joystick/amijoy.c
> +++ b/drivers/input/joystick/amijoy.c
> @@ -108,6 +108,9 @@ static int __init amijoy_init(void)
>  	int i, j;
>  	int err;
>  
> +	if (!MACH_IS_AMIGA)
> +		return -ENODEV;
> +
>  	for (i = 0; i < 2; i++) {
>  		if (!amijoy[i])
>  			continue;
> -- 
> 1.7.0.4
> 

-- 
Dmitry

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

end of thread, other threads:[~2012-03-26  6:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-21  9:51 [PATCH 01/11] m68k: Remove unused MAX_NOINT_IPL definition Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 02/11] m68k/amiga: Mark z_dev_present() __init Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 03/11] m68k/amiga: Add error checks when registering platform devices Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 04/11] m68k/amiga: Use arch_initcall() for " Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 05/11] m68k/atari: Add missing platform check before " Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 06/11] m68k/atari: Change VME irq numbers from unsigned long to unsigned int Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 07/11] m68k/mac: Add missing platform check before registering platform devices Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 08/11] input/amijoy: Add missing platform check Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 09/11] net/ariadne: Improve debug prints Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 10/11] scsi/atari: Revive "atascsi=" setup option Geert Uytterhoeven
2012-03-21  9:51 ` [PATCH 11/11] scsi/atari: Make more functions static Geert Uytterhoeven
     [not found] ` <1332323515-7314-9-git-send-email-geert@linux-m68k.org>
2012-03-22  2:16   ` [PATCH 09/11] net/ariadne: Improve debug prints David Miller
     [not found] ` <1332323515-7314-5-git-send-email-geert@linux-m68k.org>
2012-03-25  3:46   ` [PATCH 05/11] m68k/atari: Add missing platform check before registering platform devices Michael Schmitz
     [not found]   ` <4F6E950E.30809@gmail.com>
2012-03-25  8:01     ` Geert Uytterhoeven
2012-03-25 18:53       ` Michael Schmitz
     [not found] ` <1332323515-7314-8-git-send-email-geert@linux-m68k.org>
2012-03-26  6:29   ` [PATCH 08/11] input/amijoy: Add missing platform check Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox