All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/12] ARM: OMAP: resolve some warnings
@ 2012-04-11  0:35 ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel, balbi

This is the latest version of the OMAP warnings cleanup series.
This version fixes most of the warnings with arch/arm/mach-omap1,
arch/arm/mach-omap2, and arch/arm/plat-omap.  It also fixes some
bugs discovered in the process.

Boot-tested on 5912OSK, N800, 35xx BeagleBoard, 37xx EVM,
and 4430 Pandaboard.  Build-tested on the configs listed below,
which are available from git://git.pwsan.com/omap_kconfigs.

This series is also available from git://git.pwsan.com/linux-2.6
in the branch 'sparse_cppcheck_cleanup_3.5'.

Felipe, one of the patches in this branch touches
drivers/usb/host/ohci-omap.c - could you ack it for me if you are
okay with the change?


- Paul

---

object size (delta in bytes from v3.4-rc2):
 text 	 data 	  bss 	total 	kernel
  -84 	  +24 	    0 	  -60 	5912osk_testconfig/vmlinux
 -100 	   -8 	    0 	 -108 	n800_multi_omap2xxx/vmlinux
  -68 	   -8 	    0 	  -76 	n800_testconfig/vmlinux
 -224 	  +56 	  -32 	 -200 	omap1_defconfig/vmlinux
 -148 	  +32 	    0 	 -116 	omap2_4_testconfig/vmlinux
 -212 	    0 	    0 	 -212 	omap2plus_defconfig/vmlinux
 -148 	    0 	    0 	 -148 	omap2plus_no_pm/vmlinux
 -152 	    0 	    0 	 -152 	omap3_4_testconfig/vmlinux
 -100 	   -8 	    0 	 -108 	omap3_testconfig/vmlinux
 -188 	  -24 	  -64 	 -276 	omap4_testconfig/vmlinux

Paul Walmsley (12):
      ARM: OMAP2+: declare file-local functions as static
      ARM: OMAP: add includes for missing prototypes
      ARM: OMAP1: OCPI: move to mach-omap1/
      ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
      ARM: OMAP2+: GPMC: resolve type-conversion warning from sparse
      ARM: OMAP: fix 'using plain integer as NULL pointer' sparse warnings
      ARM: OMAP: OCM RAM: use memset_io() when clearing SRAM
      ARM: OMAP: DMA: use constant array maximum, drop some LCD DMA code
      ARM: OMAP: USB: remove unnecessary sideways include
      ARM: OMAP1: board files: deduplicate and clean some NAND-related code
      ARM: OMAP1: DMTIMER: fix broken timer clock source selection
      ARM: OMAP2+: clean up some cppcheck warnings


 arch/arm/mach-omap1/Makefile                 |   13 ++++++---
 arch/arm/mach-omap1/ams-delta-fiq.c          |    2 +
 arch/arm/mach-omap1/board-fsample.c          |   16 +----------
 arch/arm/mach-omap1/board-h2.c               |   17 +----------
 arch/arm/mach-omap1/board-h3.c               |   16 +----------
 arch/arm/mach-omap1/board-nand.c             |   39 ++++++++++++++++++++++++++
 arch/arm/mach-omap1/board-palmz71.c          |    4 +--
 arch/arm/mach-omap1/board-perseus2.c         |   16 +----------
 arch/arm/mach-omap1/clock.c                  |    3 +-
 arch/arm/mach-omap1/common.h                 |   11 +++++++
 arch/arm/mach-omap1/fpga.c                   |    2 +
 arch/arm/mach-omap1/id.c                     |    2 +
 arch/arm/mach-omap1/io.c                     |    3 +-
 arch/arm/mach-omap1/irq.c                    |    2 +
 arch/arm/mach-omap1/lcd_dma.c                |    7 +----
 arch/arm/mach-omap1/ocpi.c                   |    7 +++--
 arch/arm/mach-omap1/pm.c                     |    9 +++---
 arch/arm/mach-omap1/reset.c                  |    2 +
 arch/arm/mach-omap1/timer.c                  |    7 ++---
 arch/arm/mach-omap1/usb.c                    |    3 ++
 arch/arm/mach-omap2/am35xx-emac.c            |   37 +++++++++++--------------
 arch/arm/mach-omap2/board-omap3evm.c         |    8 +++--
 arch/arm/mach-omap2/board-omap4panda.c       |    8 +++--
 arch/arm/mach-omap2/board-rx51-peripherals.c |    4 +--
 arch/arm/mach-omap2/board-zoom-display.c     |    1 +
 arch/arm/mach-omap2/common.h                 |    2 -
 arch/arm/mach-omap2/devices.c                |    7 ++---
 arch/arm/mach-omap2/gpio.c                   |    2 +
 arch/arm/mach-omap2/gpmc-onenand.c           |    3 +-
 arch/arm/mach-omap2/gpmc.c                   |    3 +-
 arch/arm/mach-omap2/hwspinlock.c             |    2 +
 arch/arm/mach-omap2/io.c                     |    1 +
 arch/arm/mach-omap2/irq.c                    |    3 +-
 arch/arm/mach-omap2/mux.c                    |    2 +
 arch/arm/mach-omap2/omap-secure.c            |    1 +
 arch/arm/mach-omap2/omap-wakeupgen.c         |    2 +
 arch/arm/mach-omap2/pm24xx.c                 |    3 --
 arch/arm/mach-omap2/pm34xx.c                 |   10 ++-----
 arch/arm/mach-omap2/prm_common.c             |    4 ++-
 arch/arm/mach-omap2/serial.c                 |    2 +
 arch/arm/mach-omap2/usb-tusb6010.c           |    2 +
 arch/arm/plat-omap/Makefile                  |    3 --
 arch/arm/plat-omap/common.c                  |    1 +
 arch/arm/plat-omap/dma.c                     |   13 +++++++--
 arch/arm/plat-omap/dmtimer.c                 |    3 +-
 arch/arm/plat-omap/include/plat/board.h      |    2 +
 arch/arm/plat-omap/include/plat/common.h     |    2 +
 arch/arm/plat-omap/include/plat/dma.h        |    1 +
 arch/arm/plat-omap/include/plat/dmtimer.h    |    4 +--
 arch/arm/plat-omap/omap_device.c             |    2 -
 arch/arm/plat-omap/sram.c                    |    4 +--
 arch/arm/plat-omap/usb.c                     |    4 ---
 drivers/usb/host/ohci-omap.c                 |    5 ++-
 53 files changed, 165 insertions(+), 167 deletions(-)
 create mode 100644 arch/arm/mach-omap1/board-nand.c
 rename arch/arm/{plat-omap/ocpi.c => mach-omap1/ocpi.c} (93%)



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

* [PATCH v4 00/12] ARM: OMAP: resolve some warnings
@ 2012-04-11  0:35 ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

This is the latest version of the OMAP warnings cleanup series.
This version fixes most of the warnings with arch/arm/mach-omap1,
arch/arm/mach-omap2, and arch/arm/plat-omap.  It also fixes some
bugs discovered in the process.

Boot-tested on 5912OSK, N800, 35xx BeagleBoard, 37xx EVM,
and 4430 Pandaboard.  Build-tested on the configs listed below,
which are available from git://git.pwsan.com/omap_kconfigs.

This series is also available from git://git.pwsan.com/linux-2.6
in the branch 'sparse_cppcheck_cleanup_3.5'.

Felipe, one of the patches in this branch touches
drivers/usb/host/ohci-omap.c - could you ack it for me if you are
okay with the change?


- Paul

---

object size (delta in bytes from v3.4-rc2):
 text 	 data 	  bss 	total 	kernel
  -84 	  +24 	    0 	  -60 	5912osk_testconfig/vmlinux
 -100 	   -8 	    0 	 -108 	n800_multi_omap2xxx/vmlinux
  -68 	   -8 	    0 	  -76 	n800_testconfig/vmlinux
 -224 	  +56 	  -32 	 -200 	omap1_defconfig/vmlinux
 -148 	  +32 	    0 	 -116 	omap2_4_testconfig/vmlinux
 -212 	    0 	    0 	 -212 	omap2plus_defconfig/vmlinux
 -148 	    0 	    0 	 -148 	omap2plus_no_pm/vmlinux
 -152 	    0 	    0 	 -152 	omap3_4_testconfig/vmlinux
 -100 	   -8 	    0 	 -108 	omap3_testconfig/vmlinux
 -188 	  -24 	  -64 	 -276 	omap4_testconfig/vmlinux

Paul Walmsley (12):
      ARM: OMAP2+: declare file-local functions as static
      ARM: OMAP: add includes for missing prototypes
      ARM: OMAP1: OCPI: move to mach-omap1/
      ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
      ARM: OMAP2+: GPMC: resolve type-conversion warning from sparse
      ARM: OMAP: fix 'using plain integer as NULL pointer' sparse warnings
      ARM: OMAP: OCM RAM: use memset_io() when clearing SRAM
      ARM: OMAP: DMA: use constant array maximum, drop some LCD DMA code
      ARM: OMAP: USB: remove unnecessary sideways include
      ARM: OMAP1: board files: deduplicate and clean some NAND-related code
      ARM: OMAP1: DMTIMER: fix broken timer clock source selection
      ARM: OMAP2+: clean up some cppcheck warnings


 arch/arm/mach-omap1/Makefile                 |   13 ++++++---
 arch/arm/mach-omap1/ams-delta-fiq.c          |    2 +
 arch/arm/mach-omap1/board-fsample.c          |   16 +----------
 arch/arm/mach-omap1/board-h2.c               |   17 +----------
 arch/arm/mach-omap1/board-h3.c               |   16 +----------
 arch/arm/mach-omap1/board-nand.c             |   39 ++++++++++++++++++++++++++
 arch/arm/mach-omap1/board-palmz71.c          |    4 +--
 arch/arm/mach-omap1/board-perseus2.c         |   16 +----------
 arch/arm/mach-omap1/clock.c                  |    3 +-
 arch/arm/mach-omap1/common.h                 |   11 +++++++
 arch/arm/mach-omap1/fpga.c                   |    2 +
 arch/arm/mach-omap1/id.c                     |    2 +
 arch/arm/mach-omap1/io.c                     |    3 +-
 arch/arm/mach-omap1/irq.c                    |    2 +
 arch/arm/mach-omap1/lcd_dma.c                |    7 +----
 arch/arm/mach-omap1/ocpi.c                   |    7 +++--
 arch/arm/mach-omap1/pm.c                     |    9 +++---
 arch/arm/mach-omap1/reset.c                  |    2 +
 arch/arm/mach-omap1/timer.c                  |    7 ++---
 arch/arm/mach-omap1/usb.c                    |    3 ++
 arch/arm/mach-omap2/am35xx-emac.c            |   37 +++++++++++--------------
 arch/arm/mach-omap2/board-omap3evm.c         |    8 +++--
 arch/arm/mach-omap2/board-omap4panda.c       |    8 +++--
 arch/arm/mach-omap2/board-rx51-peripherals.c |    4 +--
 arch/arm/mach-omap2/board-zoom-display.c     |    1 +
 arch/arm/mach-omap2/common.h                 |    2 -
 arch/arm/mach-omap2/devices.c                |    7 ++---
 arch/arm/mach-omap2/gpio.c                   |    2 +
 arch/arm/mach-omap2/gpmc-onenand.c           |    3 +-
 arch/arm/mach-omap2/gpmc.c                   |    3 +-
 arch/arm/mach-omap2/hwspinlock.c             |    2 +
 arch/arm/mach-omap2/io.c                     |    1 +
 arch/arm/mach-omap2/irq.c                    |    3 +-
 arch/arm/mach-omap2/mux.c                    |    2 +
 arch/arm/mach-omap2/omap-secure.c            |    1 +
 arch/arm/mach-omap2/omap-wakeupgen.c         |    2 +
 arch/arm/mach-omap2/pm24xx.c                 |    3 --
 arch/arm/mach-omap2/pm34xx.c                 |   10 ++-----
 arch/arm/mach-omap2/prm_common.c             |    4 ++-
 arch/arm/mach-omap2/serial.c                 |    2 +
 arch/arm/mach-omap2/usb-tusb6010.c           |    2 +
 arch/arm/plat-omap/Makefile                  |    3 --
 arch/arm/plat-omap/common.c                  |    1 +
 arch/arm/plat-omap/dma.c                     |   13 +++++++--
 arch/arm/plat-omap/dmtimer.c                 |    3 +-
 arch/arm/plat-omap/include/plat/board.h      |    2 +
 arch/arm/plat-omap/include/plat/common.h     |    2 +
 arch/arm/plat-omap/include/plat/dma.h        |    1 +
 arch/arm/plat-omap/include/plat/dmtimer.h    |    4 +--
 arch/arm/plat-omap/omap_device.c             |    2 -
 arch/arm/plat-omap/sram.c                    |    4 +--
 arch/arm/plat-omap/usb.c                     |    4 ---
 drivers/usb/host/ohci-omap.c                 |    5 ++-
 53 files changed, 165 insertions(+), 167 deletions(-)
 create mode 100644 arch/arm/mach-omap1/board-nand.c
 rename arch/arm/{plat-omap/ocpi.c => mach-omap1/ocpi.c} (93%)

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

* [PATCH v4 01/12] ARM: OMAP2+: declare file-local functions as static
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel; +Cc: Govindraj R, Santosh Shilimkar, David Anders

Several function declarations used only in the files in which they're
declared should include the static keyboard, but don't:

    arch/arm/mach-omap2/serial.c:248:6: warning: symbol 'cmdline_find_option' was not declared. Should it be static?
    arch/arm/mach-omap2/omap-wakeupgen.c:259:6: warning: symbol 'irq_sar_clear' was not declared. Should it be static?
    arch/arm/mach-omap2/board-rx51-peripherals.c:878:27: warning: symbol 'rx51_vibra_data' was not declared. Should it be static?
    arch/arm/mach-omap2/board-rx51-peripherals.c:882:27: warning: symbol 'rx51_audio_data' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:201:29: warning: symbol 'omap_panda_wlan_data' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:393:24: warning: symbol 'omap4_panda_dvi_device' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:403:12: warning: symbol 'omap4_panda_dvi_init' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:464:6: warning: symbol 'omap4_panda_display_init' was not declared. Should it be static?
    arch/arm/mach-omap2/hsmmc.c:434:6: warning: symbol 'omap_init_hsmmc' was not declared. Should it be static?
    arch/arm/mach-omap2/hwspinlock.c:31:12: warning: symbol 'hwspinlocks_init' was not declared. Should it be static?
    arch/arm/mach-omap1/timer.c:58:12: warning: symbol 'omap1_dm_timer_init' was not declared. Should it be static?
    arch/arm/mach-omap1/fpga.c:90:6: warning: symbol 'innovator_fpga_IRQ_demux' was not declared. Should it be static?

Mark all of these as static.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Govindraj R <govindraj.raja@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: David Anders <x0132446@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap1/fpga.c                   |    2 +-
 arch/arm/mach-omap1/timer.c                  |    3 +--
 arch/arm/mach-omap2/board-omap4panda.c       |    8 ++++----
 arch/arm/mach-omap2/board-rx51-peripherals.c |    4 ++--
 arch/arm/mach-omap2/hwspinlock.c             |    2 +-
 arch/arm/mach-omap2/omap-wakeupgen.c         |    2 +-
 arch/arm/mach-omap2/serial.c                 |    2 +-
 7 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 76c67b3..29ec50f 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -87,7 +87,7 @@ static void fpga_mask_ack_irq(struct irq_data *d)
 	fpga_ack_irq(d);
 }
 
-void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)
+static void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)
 {
 	u32 stat;
 	int fpga_irq;
diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 6e90665..5536e04 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -54,8 +54,7 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
 	return 0;
 }
 
-
-int __init omap1_dm_timer_init(void)
+static int __init omap1_dm_timer_init(void)
 {
 	int i;
 	int ret;
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index d8c0e89..f864065 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -230,7 +230,7 @@ static struct platform_device omap_vwlan_device = {
 	},
 };
 
-struct wl12xx_platform_data omap_panda_wlan_data  __initdata = {
+static struct wl12xx_platform_data omap_panda_wlan_data  __initdata = {
 	/* PANDA ref clock is 38.4 MHz */
 	.board_ref_clock = 2,
 };
@@ -439,7 +439,7 @@ static struct panel_dvi_platform_data omap4_dvi_panel = {
 	.i2c_bus_num = 3,
 };
 
-struct omap_dss_device omap4_panda_dvi_device = {
+static struct omap_dss_device omap4_panda_dvi_device = {
 	.type			= OMAP_DISPLAY_TYPE_DPI,
 	.name			= "dvi",
 	.driver_name		= "dvi",
@@ -449,7 +449,7 @@ struct omap_dss_device omap4_panda_dvi_device = {
 	.channel		= OMAP_DSS_CHANNEL_LCD2,
 };
 
-int __init omap4_panda_dvi_init(void)
+static int __init omap4_panda_dvi_init(void)
 {
 	int r;
 
@@ -510,7 +510,7 @@ static struct omap_dss_board_info omap4_panda_dss_data = {
 	.default_device	= &omap4_panda_dvi_device,
 };
 
-void __init omap4_panda_display_init(void)
+static void __init omap4_panda_display_init(void)
 {
 	int r;
 
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index d87ee06..ae957c9 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -872,11 +872,11 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
 	.resource_config = twl4030_rconfig,
 };
 
-struct twl4030_vibra_data rx51_vibra_data __initdata = {
+static struct twl4030_vibra_data rx51_vibra_data __initdata = {
 	.coexist	= 0,
 };
 
-struct twl4030_audio_data rx51_audio_data __initdata = {
+static struct twl4030_audio_data rx51_audio_data __initdata = {
 	.audio_mclk	= 26000000,
 	.vibra		= &rx51_vibra_data,
 };
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
index 454dfce..8763c85 100644
--- a/arch/arm/mach-omap2/hwspinlock.c
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -28,7 +28,7 @@ static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata = {
 	.base_id = 0,
 };
 
-int __init hwspinlocks_init(void)
+static int __init hwspinlocks_init(void)
 {
 	int retval = 0;
 	struct omap_hwmod *oh;
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 42cd7fb..d811c77 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -259,7 +259,7 @@ static void irq_save_context(void)
 /*
  * Clear WakeupGen SAR backup status.
  */
-void irq_sar_clear(void)
+static void irq_sar_clear(void)
 {
 	u32 val;
 	val = __raw_readl(sar_base + SAR_BACKUP_STATUS_OFFSET);
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0cdd359..8d22e29d 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -243,7 +243,7 @@ static void omap_serial_fill_default_pads(struct omap_board_data *bdata)
 static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
 #endif
 
-char *cmdline_find_option(char *str)
+static char *cmdline_find_option(char *str)
 {
 	extern char *saved_command_line;
 



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

* [PATCH v4 01/12] ARM: OMAP2+: declare file-local functions as static
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

Several function declarations used only in the files in which they're
declared should include the static keyboard, but don't:

    arch/arm/mach-omap2/serial.c:248:6: warning: symbol 'cmdline_find_option' was not declared. Should it be static?
    arch/arm/mach-omap2/omap-wakeupgen.c:259:6: warning: symbol 'irq_sar_clear' was not declared. Should it be static?
    arch/arm/mach-omap2/board-rx51-peripherals.c:878:27: warning: symbol 'rx51_vibra_data' was not declared. Should it be static?
    arch/arm/mach-omap2/board-rx51-peripherals.c:882:27: warning: symbol 'rx51_audio_data' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:201:29: warning: symbol 'omap_panda_wlan_data' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:393:24: warning: symbol 'omap4_panda_dvi_device' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:403:12: warning: symbol 'omap4_panda_dvi_init' was not declared. Should it be static?
    arch/arm/mach-omap2/board-omap4panda.c:464:6: warning: symbol 'omap4_panda_display_init' was not declared. Should it be static?
    arch/arm/mach-omap2/hsmmc.c:434:6: warning: symbol 'omap_init_hsmmc' was not declared. Should it be static?
    arch/arm/mach-omap2/hwspinlock.c:31:12: warning: symbol 'hwspinlocks_init' was not declared. Should it be static?
    arch/arm/mach-omap1/timer.c:58:12: warning: symbol 'omap1_dm_timer_init' was not declared. Should it be static?
    arch/arm/mach-omap1/fpga.c:90:6: warning: symbol 'innovator_fpga_IRQ_demux' was not declared. Should it be static?

Mark all of these as static.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Govindraj R <govindraj.raja@ti.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: David Anders <x0132446@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap1/fpga.c                   |    2 +-
 arch/arm/mach-omap1/timer.c                  |    3 +--
 arch/arm/mach-omap2/board-omap4panda.c       |    8 ++++----
 arch/arm/mach-omap2/board-rx51-peripherals.c |    4 ++--
 arch/arm/mach-omap2/hwspinlock.c             |    2 +-
 arch/arm/mach-omap2/omap-wakeupgen.c         |    2 +-
 arch/arm/mach-omap2/serial.c                 |    2 +-
 7 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c
index 76c67b3..29ec50f 100644
--- a/arch/arm/mach-omap1/fpga.c
+++ b/arch/arm/mach-omap1/fpga.c
@@ -87,7 +87,7 @@ static void fpga_mask_ack_irq(struct irq_data *d)
 	fpga_ack_irq(d);
 }
 
-void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)
+static void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc)
 {
 	u32 stat;
 	int fpga_irq;
diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 6e90665..5536e04 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -54,8 +54,7 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
 	return 0;
 }
 
-
-int __init omap1_dm_timer_init(void)
+static int __init omap1_dm_timer_init(void)
 {
 	int i;
 	int ret;
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index d8c0e89..f864065 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -230,7 +230,7 @@ static struct platform_device omap_vwlan_device = {
 	},
 };
 
-struct wl12xx_platform_data omap_panda_wlan_data  __initdata = {
+static struct wl12xx_platform_data omap_panda_wlan_data  __initdata = {
 	/* PANDA ref clock is 38.4 MHz */
 	.board_ref_clock = 2,
 };
@@ -439,7 +439,7 @@ static struct panel_dvi_platform_data omap4_dvi_panel = {
 	.i2c_bus_num = 3,
 };
 
-struct omap_dss_device omap4_panda_dvi_device = {
+static struct omap_dss_device omap4_panda_dvi_device = {
 	.type			= OMAP_DISPLAY_TYPE_DPI,
 	.name			= "dvi",
 	.driver_name		= "dvi",
@@ -449,7 +449,7 @@ struct omap_dss_device omap4_panda_dvi_device = {
 	.channel		= OMAP_DSS_CHANNEL_LCD2,
 };
 
-int __init omap4_panda_dvi_init(void)
+static int __init omap4_panda_dvi_init(void)
 {
 	int r;
 
@@ -510,7 +510,7 @@ static struct omap_dss_board_info omap4_panda_dss_data = {
 	.default_device	= &omap4_panda_dvi_device,
 };
 
-void __init omap4_panda_display_init(void)
+static void __init omap4_panda_display_init(void)
 {
 	int r;
 
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index d87ee06..ae957c9 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -872,11 +872,11 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {
 	.resource_config = twl4030_rconfig,
 };
 
-struct twl4030_vibra_data rx51_vibra_data __initdata = {
+static struct twl4030_vibra_data rx51_vibra_data __initdata = {
 	.coexist	= 0,
 };
 
-struct twl4030_audio_data rx51_audio_data __initdata = {
+static struct twl4030_audio_data rx51_audio_data __initdata = {
 	.audio_mclk	= 26000000,
 	.vibra		= &rx51_vibra_data,
 };
diff --git a/arch/arm/mach-omap2/hwspinlock.c b/arch/arm/mach-omap2/hwspinlock.c
index 454dfce..8763c85 100644
--- a/arch/arm/mach-omap2/hwspinlock.c
+++ b/arch/arm/mach-omap2/hwspinlock.c
@@ -28,7 +28,7 @@ static struct hwspinlock_pdata omap_hwspinlock_pdata __initdata = {
 	.base_id = 0,
 };
 
-int __init hwspinlocks_init(void)
+static int __init hwspinlocks_init(void)
 {
 	int retval = 0;
 	struct omap_hwmod *oh;
diff --git a/arch/arm/mach-omap2/omap-wakeupgen.c b/arch/arm/mach-omap2/omap-wakeupgen.c
index 42cd7fb..d811c77 100644
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -259,7 +259,7 @@ static void irq_save_context(void)
 /*
  * Clear WakeupGen SAR backup status.
  */
-void irq_sar_clear(void)
+static void irq_sar_clear(void)
 {
 	u32 val;
 	val = __raw_readl(sar_base + SAR_BACKUP_STATUS_OFFSET);
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0cdd359..8d22e29d 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -243,7 +243,7 @@ static void omap_serial_fill_default_pads(struct omap_board_data *bdata)
 static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
 #endif
 
-char *cmdline_find_option(char *str)
+static char *cmdline_find_option(char *str)
 {
 	extern char *saved_command_line;
 

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

* [PATCH v4 02/12] ARM: OMAP: add includes for missing prototypes
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel; +Cc: Senthilvadivu Guruswamy, Santosh Shilimkar

Several C files in arch/arm/mach-omap* and arch/arm/plat-omap declare
functions that are used by other files, but don't include the header
file where the prototype is declared.  This results in the following
warnings from sparse:

    arch/arm/mach-omap2/irq.c:114:5: warning: symbol 'omap_irq_pending' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:186:13: warning: symbol 'omap2_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:191:13: warning: symbol 'omap3_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:196:13: warning: symbol 'ti81xx_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:233:39: warning: symbol 'omap2_intc_handle_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:242:6: warning: symbol 'omap_intc_save_context' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:265:6: warning: symbol 'omap_intc_restore_context' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:291:6: warning: symbol 'omap3_intc_suspend' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:297:6: warning: symbol 'omap3_intc_prepare_idle' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:306:6: warning: symbol 'omap3_intc_resume_idle' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:312:39: warning: symbol 'omap3_intc_handle_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/omap-secure.c:59:12: warning: symbol 'omap_secure_ram_reserve_memblock' was not declared. Should it be static?
    arch/arm/mach-omap2/board-zoom-display.c:133:13: warning: symbol 'zoom_display_init' was not declared. Should it be static?
    arch/arm/plat-omap/common.c:73:13: warning: symbol 'omap_init_consistent_dma_size' was not declared. Should it be static?
    arch/arm/mach-omap1/irq.c:61:5: warning: symbol 'omap_irq_flags' was not declared. Should it be static?
    arch/arm/mach-omap1/irq.c:179:13: warning: symbol 'omap1_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap1/reset.c:11:6: warning: symbol 'omap1_restart' was not declared. Should it be static?

Fix by including the appropriate header files.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Senthilvadivu Guruswamy <svadivu@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap1/common.h             |    5 ++++-
 arch/arm/mach-omap1/id.c                 |    2 ++
 arch/arm/mach-omap1/io.c                 |    3 +--
 arch/arm/mach-omap1/irq.c                |    2 ++
 arch/arm/mach-omap1/reset.c              |    2 ++
 arch/arm/mach-omap2/board-zoom-display.c |    1 +
 arch/arm/mach-omap2/common.h             |    2 --
 arch/arm/mach-omap2/io.c                 |    1 +
 arch/arm/mach-omap2/irq.c                |    1 +
 arch/arm/mach-omap2/omap-secure.c        |    1 +
 arch/arm/plat-omap/common.c              |    1 +
 arch/arm/plat-omap/include/plat/common.h |    2 ++
 arch/arm/plat-omap/include/plat/dma.h    |    1 +
 13 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index af658ad..ef656ff 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -56,8 +56,11 @@ void omap1_init_early(void);
 void omap1_init_irq(void);
 void omap1_restart(char, const char *);
 
+extern void __init omap_check_revision(void);
+
 extern struct sys_timer omap1_timer;
 extern bool omap_32k_timer_init(void);
-extern void __init omap_init_consistent_dma_size(void);
+
+extern u32 omap_irq_flags;
 
 #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index 2b28e1d..a1b846a 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -21,6 +21,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 #define OMAP_DIE_ID_0		0xfffe1800
 #define OMAP_DIE_ID_1		0xfffe1804
 #define OMAP_PRODUCTION_ID_0	0xfffe2000
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index d969a72..71ce017 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -18,13 +18,12 @@
 
 #include <plat/mux.h>
 #include <plat/tc.h>
+#include <plat/dma.h>
 
 #include "iomap.h"
 #include "common.h"
 #include "clock.h"
 
-extern void omap_check_revision(void);
-
 /*
  * The machine specific code may provide the extra mapping besides the
  * default mapping provided here.
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 4448114..6995fb6 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -49,6 +49,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 #define IRQ_BANK(irq) ((irq) >> 5)
 #define IRQ_BIT(irq)  ((irq) & 0x1f)
 
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
index f255b15..b177091 100644
--- a/arch/arm/mach-omap1/reset.c
+++ b/arch/arm/mach-omap1/reset.c
@@ -8,6 +8,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 void omap1_restart(char mode, const char *cmd)
 {
 	/*
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index a43a765..28187f1 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -16,6 +16,7 @@
 #include <linux/spi/spi.h>
 #include <plat/mcspi.h>
 #include <video/omapdss.h>
+#include <mach/board-zoom.h>
 
 #define LCD_PANEL_RESET_GPIO_PROD	96
 #define LCD_PANEL_RESET_GPIO_PILOT	55
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 57da7f4..0e95efc 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -134,8 +134,6 @@ void omap4_map_io(void);
 void ti81xx_map_io(void);
 void omap_barriers_init(void);
 
-extern void __init omap_init_consistent_dma_size(void);
-
 /**
  * omap_test_timeout - busy-loop, testing a condition
  * @cond: condition to test until it evaluates to true
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 065bd76..2d5a576 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -31,6 +31,7 @@
 #include <plat/omap-pm.h>
 #include <plat/omap_hwmod.h>
 #include <plat/multi.h>
+#include <plat/dma.h>
 
 #include "iomap.h"
 #include "voltage.h"
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 65f0d257..14fbc78 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -25,6 +25,7 @@
 #include <mach/hardware.h>
 
 #include "iomap.h"
+#include "common.h"
 
 /* selected INTC register offsets */
 
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
index d8f8ef4..d9ae4a5 100644
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -18,6 +18,7 @@
 #include <asm/cacheflush.h>
 #include <asm/memblock.h>
 
+#include <plat/omap-secure.h>
 #include <mach/omap-secure.h>
 
 static phys_addr_t omap_secure_memblock_base;
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index f1e46ea..0a9b9a9 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -20,6 +20,7 @@
 #include <plat/board.h>
 #include <plat/vram.h>
 #include <plat/dsp.h>
+#include <plat/dma.h>
 
 #include <plat/omap-secure.h>
 
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index b4d7ec3..a557b84 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -32,6 +32,8 @@
 
 extern int __init omap_init_clocksource_32k(void);
 
+extern void __init omap_check_revision(void);
+
 extern void omap_reserve(void);
 extern int omap_dss_reset(struct omap_hwmod *);
 
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index dc562a5..42afb4c 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -442,6 +442,7 @@ struct omap_system_dma_plat_info {
 	u32 (*dma_read)(int reg, int lch);
 };
 
+extern void __init omap_init_consistent_dma_size(void);
 extern void omap_set_dma_priority(int lch, int dst_port, int priority);
 extern int omap_request_dma(int dev_id, const char *dev_name,
 			void (*callback)(int lch, u16 ch_status, void *data),



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

* [PATCH v4 02/12] ARM: OMAP: add includes for missing prototypes
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

Several C files in arch/arm/mach-omap* and arch/arm/plat-omap declare
functions that are used by other files, but don't include the header
file where the prototype is declared.  This results in the following
warnings from sparse:

    arch/arm/mach-omap2/irq.c:114:5: warning: symbol 'omap_irq_pending' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:186:13: warning: symbol 'omap2_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:191:13: warning: symbol 'omap3_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:196:13: warning: symbol 'ti81xx_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:233:39: warning: symbol 'omap2_intc_handle_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:242:6: warning: symbol 'omap_intc_save_context' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:265:6: warning: symbol 'omap_intc_restore_context' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:291:6: warning: symbol 'omap3_intc_suspend' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:297:6: warning: symbol 'omap3_intc_prepare_idle' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:306:6: warning: symbol 'omap3_intc_resume_idle' was not declared. Should it be static?
    arch/arm/mach-omap2/irq.c:312:39: warning: symbol 'omap3_intc_handle_irq' was not declared. Should it be static?
    arch/arm/mach-omap2/omap-secure.c:59:12: warning: symbol 'omap_secure_ram_reserve_memblock' was not declared. Should it be static?
    arch/arm/mach-omap2/board-zoom-display.c:133:13: warning: symbol 'zoom_display_init' was not declared. Should it be static?
    arch/arm/plat-omap/common.c:73:13: warning: symbol 'omap_init_consistent_dma_size' was not declared. Should it be static?
    arch/arm/mach-omap1/irq.c:61:5: warning: symbol 'omap_irq_flags' was not declared. Should it be static?
    arch/arm/mach-omap1/irq.c:179:13: warning: symbol 'omap1_init_irq' was not declared. Should it be static?
    arch/arm/mach-omap1/reset.c:11:6: warning: symbol 'omap1_restart' was not declared. Should it be static?

Fix by including the appropriate header files.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Senthilvadivu Guruswamy <svadivu@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 arch/arm/mach-omap1/common.h             |    5 ++++-
 arch/arm/mach-omap1/id.c                 |    2 ++
 arch/arm/mach-omap1/io.c                 |    3 +--
 arch/arm/mach-omap1/irq.c                |    2 ++
 arch/arm/mach-omap1/reset.c              |    2 ++
 arch/arm/mach-omap2/board-zoom-display.c |    1 +
 arch/arm/mach-omap2/common.h             |    2 --
 arch/arm/mach-omap2/io.c                 |    1 +
 arch/arm/mach-omap2/irq.c                |    1 +
 arch/arm/mach-omap2/omap-secure.c        |    1 +
 arch/arm/plat-omap/common.c              |    1 +
 arch/arm/plat-omap/include/plat/common.h |    2 ++
 arch/arm/plat-omap/include/plat/dma.h    |    1 +
 13 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index af658ad..ef656ff 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -56,8 +56,11 @@ void omap1_init_early(void);
 void omap1_init_irq(void);
 void omap1_restart(char, const char *);
 
+extern void __init omap_check_revision(void);
+
 extern struct sys_timer omap1_timer;
 extern bool omap_32k_timer_init(void);
-extern void __init omap_init_consistent_dma_size(void);
+
+extern u32 omap_irq_flags;
 
 #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c
index 2b28e1d..a1b846a 100644
--- a/arch/arm/mach-omap1/id.c
+++ b/arch/arm/mach-omap1/id.c
@@ -21,6 +21,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 #define OMAP_DIE_ID_0		0xfffe1800
 #define OMAP_DIE_ID_1		0xfffe1804
 #define OMAP_PRODUCTION_ID_0	0xfffe2000
diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c
index d969a72..71ce017 100644
--- a/arch/arm/mach-omap1/io.c
+++ b/arch/arm/mach-omap1/io.c
@@ -18,13 +18,12 @@
 
 #include <plat/mux.h>
 #include <plat/tc.h>
+#include <plat/dma.h>
 
 #include "iomap.h"
 #include "common.h"
 #include "clock.h"
 
-extern void omap_check_revision(void);
-
 /*
  * The machine specific code may provide the extra mapping besides the
  * default mapping provided here.
diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c
index 4448114..6995fb6 100644
--- a/arch/arm/mach-omap1/irq.c
+++ b/arch/arm/mach-omap1/irq.c
@@ -49,6 +49,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 #define IRQ_BANK(irq) ((irq) >> 5)
 #define IRQ_BIT(irq)  ((irq) & 0x1f)
 
diff --git a/arch/arm/mach-omap1/reset.c b/arch/arm/mach-omap1/reset.c
index f255b15..b177091 100644
--- a/arch/arm/mach-omap1/reset.c
+++ b/arch/arm/mach-omap1/reset.c
@@ -8,6 +8,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 void omap1_restart(char mode, const char *cmd)
 {
 	/*
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index a43a765..28187f1 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -16,6 +16,7 @@
 #include <linux/spi/spi.h>
 #include <plat/mcspi.h>
 #include <video/omapdss.h>
+#include <mach/board-zoom.h>
 
 #define LCD_PANEL_RESET_GPIO_PROD	96
 #define LCD_PANEL_RESET_GPIO_PILOT	55
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
index 57da7f4..0e95efc 100644
--- a/arch/arm/mach-omap2/common.h
+++ b/arch/arm/mach-omap2/common.h
@@ -134,8 +134,6 @@ void omap4_map_io(void);
 void ti81xx_map_io(void);
 void omap_barriers_init(void);
 
-extern void __init omap_init_consistent_dma_size(void);
-
 /**
  * omap_test_timeout - busy-loop, testing a condition
  * @cond: condition to test until it evaluates to true
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 065bd76..2d5a576 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -31,6 +31,7 @@
 #include <plat/omap-pm.h>
 #include <plat/omap_hwmod.h>
 #include <plat/multi.h>
+#include <plat/dma.h>
 
 #include "iomap.h"
 #include "voltage.h"
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 65f0d257..14fbc78 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -25,6 +25,7 @@
 #include <mach/hardware.h>
 
 #include "iomap.h"
+#include "common.h"
 
 /* selected INTC register offsets */
 
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c
index d8f8ef4..d9ae4a5 100644
--- a/arch/arm/mach-omap2/omap-secure.c
+++ b/arch/arm/mach-omap2/omap-secure.c
@@ -18,6 +18,7 @@
 #include <asm/cacheflush.h>
 #include <asm/memblock.h>
 
+#include <plat/omap-secure.h>
 #include <mach/omap-secure.h>
 
 static phys_addr_t omap_secure_memblock_base;
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index f1e46ea..0a9b9a9 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -20,6 +20,7 @@
 #include <plat/board.h>
 #include <plat/vram.h>
 #include <plat/dsp.h>
+#include <plat/dma.h>
 
 #include <plat/omap-secure.h>
 
diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h
index b4d7ec3..a557b84 100644
--- a/arch/arm/plat-omap/include/plat/common.h
+++ b/arch/arm/plat-omap/include/plat/common.h
@@ -32,6 +32,8 @@
 
 extern int __init omap_init_clocksource_32k(void);
 
+extern void __init omap_check_revision(void);
+
 extern void omap_reserve(void);
 extern int omap_dss_reset(struct omap_hwmod *);
 
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index dc562a5..42afb4c 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -442,6 +442,7 @@ struct omap_system_dma_plat_info {
 	u32 (*dma_read)(int reg, int lch);
 };
 
+extern void __init omap_init_consistent_dma_size(void);
 extern void omap_set_dma_priority(int lch, int dst_port, int priority);
 extern int omap_request_dma(int dev_id, const char *dev_name,
 			void (*callback)(int lch, u16 ch_status, void *data),

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

* [PATCH v4 03/12] ARM: OMAP1: OCPI: move to mach-omap1/
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel; +Cc: Tony Lindgren

Move the OMAP1 OCPI "bus" code to arch/arm/mach-omap1, since it is
only used on OMAP1 devices.  In the long term, it probably makes sense
to move the OCPI bus code to somewhere under drivers/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/Makefile |    3 +++
 arch/arm/mach-omap1/common.h |    2 ++
 arch/arm/mach-omap1/ocpi.c   |    7 +++++--
 arch/arm/plat-omap/Makefile  |    3 ---
 4 files changed, 10 insertions(+), 5 deletions(-)
 rename arch/arm/{plat-omap/ocpi.c => mach-omap1/ocpi.c} (93%)

diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 9923f92..20d65af 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -12,6 +12,9 @@ endif
 
 obj-$(CONFIG_OMAP_32K_TIMER)	+= timer32k.o
 
+# OCPI interconnect support for 1710, 1610 and 5912
+obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
+
 # Power Management
 obj-$(CONFIG_PM) += pm.o sleep.o
 
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index ef656ff..a90b9d7 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -63,4 +63,6 @@ extern bool omap_32k_timer_init(void);
 
 extern u32 omap_irq_flags;
 
+extern int ocpi_enable(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/plat-omap/ocpi.c b/arch/arm/mach-omap1/ocpi.c
similarity index 93%
rename from arch/arm/plat-omap/ocpi.c
rename to arch/arm/mach-omap1/ocpi.c
index ebe0c73..238170c 100644
--- a/arch/arm/plat-omap/ocpi.c
+++ b/arch/arm/mach-omap1/ocpi.c
@@ -4,6 +4,7 @@
  * Minimal OCP bus support for omap16xx
  *
  * Copyright (C) 2003 - 2005 Nokia Corporation
+ * Copyright (C) 2012 Texas Instruments, Inc.
  * Written by Tony Lindgren <tony@atomide.com>
  *
  * Modified for clock framework by Paul Mundt <paul.mundt@nokia.com>.
@@ -35,6 +36,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 #define OCPI_BASE		0xfffec320
 #define OCPI_FAULT		(OCPI_BASE + 0x00)
 #define OCPI_CMD_FAULT		(OCPI_BASE + 0x04)
@@ -64,7 +67,7 @@ int ocpi_enable(void)
 	/* Enable access for OHCI in OCPI */
 	val = omap_readl(OCPI_PROT);
 	val &= ~0xff;
-	//val &= (1 << 0);	/* Allow access only to EMIFS */
+	/* val &= (1 << 0);	 Allow access only to EMIFS */
 	omap_writel(val, OCPI_PROT);
 
 	val = omap_readl(OCPI_SEC);
@@ -86,7 +89,7 @@ static int __init omap_ocpi_init(void)
 
 	clk_enable(ocpi_ck);
 	ocpi_enable();
-	printk("OMAP OCPI interconnect driver loaded\n");
+	pr_info("OMAP OCPI interconnect driver loaded\n");
 
 	return 0;
 }
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index c0fe275..ed8605f 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -9,9 +9,6 @@ obj-m :=
 obj-n :=
 obj-  :=
 
-# OCPI interconnect support for 1710, 1610 and 5912
-obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
-
 # omap_device support (OMAP2+ only at the moment)
 obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
 obj-$(CONFIG_ARCH_OMAP3) += omap_device.o



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

* [PATCH v4 03/12] ARM: OMAP1: OCPI: move to mach-omap1/
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

Move the OMAP1 OCPI "bus" code to arch/arm/mach-omap1, since it is
only used on OMAP1 devices.  In the long term, it probably makes sense
to move the OCPI bus code to somewhere under drivers/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap1/Makefile |    3 +++
 arch/arm/mach-omap1/common.h |    2 ++
 arch/arm/mach-omap1/ocpi.c   |    7 +++++--
 arch/arm/plat-omap/Makefile  |    3 ---
 4 files changed, 10 insertions(+), 5 deletions(-)
 rename arch/arm/{plat-omap/ocpi.c => mach-omap1/ocpi.c} (93%)

diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 9923f92..20d65af 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -12,6 +12,9 @@ endif
 
 obj-$(CONFIG_OMAP_32K_TIMER)	+= timer32k.o
 
+# OCPI interconnect support for 1710, 1610 and 5912
+obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
+
 # Power Management
 obj-$(CONFIG_PM) += pm.o sleep.o
 
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index ef656ff..a90b9d7 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -63,4 +63,6 @@ extern bool omap_32k_timer_init(void);
 
 extern u32 omap_irq_flags;
 
+extern int ocpi_enable(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP1_COMMON_H */
diff --git a/arch/arm/plat-omap/ocpi.c b/arch/arm/mach-omap1/ocpi.c
similarity index 93%
rename from arch/arm/plat-omap/ocpi.c
rename to arch/arm/mach-omap1/ocpi.c
index ebe0c73..238170c 100644
--- a/arch/arm/plat-omap/ocpi.c
+++ b/arch/arm/mach-omap1/ocpi.c
@@ -4,6 +4,7 @@
  * Minimal OCP bus support for omap16xx
  *
  * Copyright (C) 2003 - 2005 Nokia Corporation
+ * Copyright (C) 2012 Texas Instruments, Inc.
  * Written by Tony Lindgren <tony@atomide.com>
  *
  * Modified for clock framework by Paul Mundt <paul.mundt@nokia.com>.
@@ -35,6 +36,8 @@
 
 #include <mach/hardware.h>
 
+#include "common.h"
+
 #define OCPI_BASE		0xfffec320
 #define OCPI_FAULT		(OCPI_BASE + 0x00)
 #define OCPI_CMD_FAULT		(OCPI_BASE + 0x04)
@@ -64,7 +67,7 @@ int ocpi_enable(void)
 	/* Enable access for OHCI in OCPI */
 	val = omap_readl(OCPI_PROT);
 	val &= ~0xff;
-	//val &= (1 << 0);	/* Allow access only to EMIFS */
+	/* val &= (1 << 0);	 Allow access only to EMIFS */
 	omap_writel(val, OCPI_PROT);
 
 	val = omap_readl(OCPI_SEC);
@@ -86,7 +89,7 @@ static int __init omap_ocpi_init(void)
 
 	clk_enable(ocpi_ck);
 	ocpi_enable();
-	printk("OMAP OCPI interconnect driver loaded\n");
+	pr_info("OMAP OCPI interconnect driver loaded\n");
 
 	return 0;
 }
diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
index c0fe275..ed8605f 100644
--- a/arch/arm/plat-omap/Makefile
+++ b/arch/arm/plat-omap/Makefile
@@ -9,9 +9,6 @@ obj-m :=
 obj-n :=
 obj-  :=
 
-# OCPI interconnect support for 1710, 1610 and 5912
-obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
-
 # omap_device support (OMAP2+ only@the moment)
 obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
 obj-$(CONFIG_ARCH_OMAP3) += omap_device.o

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

* [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel
  Cc: Roland Stigge, linux-usb, Felipe Balbi, Anand Gadiyar

The OMAP1 OHCI driver needs to enable the OCPI IP block before it can
work.  Previously, the driver was simply calling a symbol defined in
the OMAP platform code, but this is incorrect: drivers should be fully
decoupled from platform and architecture code.

So instead, modify the driver to call through a platform_data function
pointer instead.  We skip any DT aspect, since OMAP1 is not scheduled
to be converted to DT in the near future.

This resolves the following sparse warning:

It also gets rid of a cpu_is_omap16xx() call in a driver.

In the long term, it probably makes sense to move the OCPI bus code to
somewhere under drivers/.  This should avoid the whole platform_data/DT
issue with this function.

Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Roland Stigge <stigge@antcom.de>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Anand Gadiyar <gadiyar@ti.com>
---
 arch/arm/mach-omap1/usb.c               |    3 +++
 arch/arm/plat-omap/include/plat/board.h |    2 ++
 drivers/usb/host/ohci-omap.c            |    5 +++--
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index 19de03b..e61afd9 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -29,6 +29,8 @@
 #include <plat/mux.h>
 #include <plat/usb.h>
 
+#include "common.h"
+
 /* These routines should handle the standard chip-specific modes
  * for usb0/1/2 ports, covering basic mux and transceiver setup.
  *
@@ -138,6 +140,7 @@ static inline void ohci_device_init(struct omap_usb_config *pdata)
 	if (cpu_is_omap7xx())
 		ohci_resources[1].start = INT_7XX_USB_HHC_1;
 	pdata->ohci_device = &ohci_device;
+	pdata->ocpi_enable = &ocpi_enable;
 }
 
 #else
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index d5eb4c8..4814c5b 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -91,6 +91,8 @@ struct omap_usb_config {
 	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
 	u32 (*usb1_init)(unsigned nwires);
 	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
+
+	int (*ocpi_enable)(void);
 };
 
 struct omap_lcd_config {
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 96451e4..71229cb 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -205,8 +205,9 @@ static int ohci_omap_init(struct usb_hcd *hcd)
 	need_transceiver = need_transceiver
 			|| machine_is_omap_h2() || machine_is_omap_h3();
 
-	if (cpu_is_omap16xx())
-		ocpi_enable();
+	/* XXX OMAP16xx only */
+	if (config->ocpi_enable)
+		config->ocpi_enable();
 
 #ifdef	CONFIG_USB_OTG
 	if (need_transceiver) {



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

* [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

The OMAP1 OHCI driver needs to enable the OCPI IP block before it can
work.  Previously, the driver was simply calling a symbol defined in
the OMAP platform code, but this is incorrect: drivers should be fully
decoupled from platform and architecture code.

So instead, modify the driver to call through a platform_data function
pointer instead.  We skip any DT aspect, since OMAP1 is not scheduled
to be converted to DT in the near future.

This resolves the following sparse warning:

It also gets rid of a cpu_is_omap16xx() call in a driver.

In the long term, it probably makes sense to move the OCPI bus code to
somewhere under drivers/.  This should avoid the whole platform_data/DT
issue with this function.

Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Roland Stigge <stigge@antcom.de>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Anand Gadiyar <gadiyar@ti.com>
---
 arch/arm/mach-omap1/usb.c               |    3 +++
 arch/arm/plat-omap/include/plat/board.h |    2 ++
 drivers/usb/host/ohci-omap.c            |    5 +++--
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index 19de03b..e61afd9 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -29,6 +29,8 @@
 #include <plat/mux.h>
 #include <plat/usb.h>
 
+#include "common.h"
+
 /* These routines should handle the standard chip-specific modes
  * for usb0/1/2 ports, covering basic mux and transceiver setup.
  *
@@ -138,6 +140,7 @@ static inline void ohci_device_init(struct omap_usb_config *pdata)
 	if (cpu_is_omap7xx())
 		ohci_resources[1].start = INT_7XX_USB_HHC_1;
 	pdata->ohci_device = &ohci_device;
+	pdata->ocpi_enable = &ocpi_enable;
 }
 
 #else
diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
index d5eb4c8..4814c5b 100644
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -91,6 +91,8 @@ struct omap_usb_config {
 	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
 	u32 (*usb1_init)(unsigned nwires);
 	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
+
+	int (*ocpi_enable)(void);
 };
 
 struct omap_lcd_config {
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 96451e4..71229cb 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -205,8 +205,9 @@ static int ohci_omap_init(struct usb_hcd *hcd)
 	need_transceiver = need_transceiver
 			|| machine_is_omap_h2() || machine_is_omap_h3();
 
-	if (cpu_is_omap16xx())
-		ocpi_enable();
+	/* XXX OMAP16xx only */
+	if (config->ocpi_enable)
+		config->ocpi_enable();
 
 #ifdef	CONFIG_USB_OTG
 	if (need_transceiver) {

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

* [PATCH v4 05/12] ARM: OMAP2+: GPMC: resolve type-conversion warning from sparse
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel

arch/arm/mach-omap2/gpmc.c passes a return value from ioremap() as the
fifth argument to request_irq() without casting it.  This causes
sparse to generate the following warning:

arch/arm/mach-omap2/gpmc.c:759:63: warning: incorrect type in argument 5 (different address spaces)
arch/arm/mach-omap2/gpmc.c:759:63:    expected void *dev
arch/arm/mach-omap2/gpmc.c:759:63:    got void [noderef] <asn:2>*static [toplevel] [assigned] gpmc_base

It turns out that it's not necessary to pass this.  gpmc_base is a
file-scoped static variable, the ISR is located in the same file ... and
the ISR doesn't even touch the passed-in variable.  So, just replace it with
NULL in request_irq().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/gpmc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 00d5108..580e684 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -755,8 +755,7 @@ static int __init gpmc_init(void)
 		irq++;
 	}
 
-	ret = request_irq(gpmc_irq,
-			gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base);
+	ret = request_irq(gpmc_irq, gpmc_handle_irq, IRQF_SHARED, "gpmc", NULL);
 	if (ret)
 		pr_err("gpmc: irq-%d could not claim: err %d\n",
 						gpmc_irq, ret);



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

* [PATCH v4 05/12] ARM: OMAP2+: GPMC: resolve type-conversion warning from sparse
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

arch/arm/mach-omap2/gpmc.c passes a return value from ioremap() as the
fifth argument to request_irq() without casting it.  This causes
sparse to generate the following warning:

arch/arm/mach-omap2/gpmc.c:759:63: warning: incorrect type in argument 5 (different address spaces)
arch/arm/mach-omap2/gpmc.c:759:63:    expected void *dev
arch/arm/mach-omap2/gpmc.c:759:63:    got void [noderef] <asn:2>*static [toplevel] [assigned] gpmc_base

It turns out that it's not necessary to pass this.  gpmc_base is a
file-scoped static variable, the ISR is located in the same file ... and
the ISR doesn't even touch the passed-in variable.  So, just replace it with
NULL in request_irq().

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap2/gpmc.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 00d5108..580e684 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -755,8 +755,7 @@ static int __init gpmc_init(void)
 		irq++;
 	}
 
-	ret = request_irq(gpmc_irq,
-			gpmc_handle_irq, IRQF_SHARED, "gpmc", gpmc_base);
+	ret = request_irq(gpmc_irq, gpmc_handle_irq, IRQF_SHARED, "gpmc", NULL);
 	if (ret)
 		pr_err("gpmc: irq-%d could not claim: err %d\n",
 						gpmc_irq, ret);

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

* [PATCH v4 06/12] ARM: OMAP: fix 'using plain integer as NULL pointer' sparse warnings
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel

sparse warns when 0 is passed to a function expecting a pointer argument.
Resolve these warnings by replacing the 0 with NULL.

arch/arm/plat-omap/include/plat/dmtimer.h:319:34: warning: Using plain integer as NULL pointer
arch/arm/plat-omap/include/plat/dmtimer.h:324:35: warning: Using plain integer as NULL pointer
arch/arm/mach-omap2/irq.c:294:22: warning: Using plain integer as NULL pointer
arch/arm/mach-omap1/board-palmz71.c:292:50: warning: Using plain integer as NULL pointer
arch/arm/mach-omap1/board-palmz71.c:295:73: warning: Using plain integer as NULL pointer
arch/arm/mach-omap1/ams-delta-fiq.c:105:63: warning: Using plain integer as NULL pointer

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap1/ams-delta-fiq.c       |    2 +-
 arch/arm/mach-omap1/board-palmz71.c       |    4 ++--
 arch/arm/mach-omap2/irq.c                 |    2 +-
 arch/arm/plat-omap/include/plat/dmtimer.h |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c
index fcce7ff..31197bd 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq.c
+++ b/arch/arm/mach-omap1/ams-delta-fiq.c
@@ -102,7 +102,7 @@ void __init ams_delta_init_fiq(void)
 	}
 
 	retval = request_irq(INT_DEFERRED_FIQ, deferred_fiq,
-			IRQ_TYPE_EDGE_RISING, "deferred_fiq", 0);
+			IRQ_TYPE_EDGE_RISING, "deferred_fiq", NULL);
 	if (retval < 0) {
 		pr_err("Failed to get deferred_fiq IRQ, ret=%d\n", retval);
 		release_fiq(&fh);
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index a2c5abc..61ed4f0 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -289,10 +289,10 @@ palmz71_gpio_setup(int early)
 		gpio_direction_input(PALMZ71_USBDETECT_GPIO);
 		if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
 				palmz71_powercable, IRQF_SAMPLE_RANDOM,
-				"palmz71-cable", 0))
+				"palmz71-cable", NULL))
 			printk(KERN_ERR
 					"IRQ request for power cable failed!\n");
-		palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0);
+		palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), NULL);
 	}
 }
 
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 14fbc78..80f3ced 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -335,7 +335,7 @@ void omap_intc_restore_context(void)
 void omap3_intc_suspend(void)
 {
 	/* A pending interrupt would prevent OMAP from entering suspend */
-	omap_ack_irq(0);
+	omap_ack_irq(NULL);
 }
 
 void omap3_intc_prepare_idle(void)
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 9418f00..230ff91 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -316,12 +316,12 @@ static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
 				OMAP_TIMER_V1_SYS_STAT_OFFSET;
 		timer->irq_stat = timer->io_base + OMAP_TIMER_V1_STAT_OFFSET;
 		timer->irq_ena = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
-		timer->irq_dis = 0;
+		timer->irq_dis = NULL;
 		timer->pend = timer->io_base + _OMAP_TIMER_WRITE_PEND_OFFSET;
 		timer->func_base = timer->io_base;
 	} else {
 		timer->revision = 2;
-		timer->sys_stat = 0;
+		timer->sys_stat = NULL;
 		timer->irq_stat = timer->io_base + OMAP_TIMER_V2_IRQSTATUS;
 		timer->irq_ena = timer->io_base + OMAP_TIMER_V2_IRQENABLE_SET;
 		timer->irq_dis = timer->io_base + OMAP_TIMER_V2_IRQENABLE_CLR;



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

* [PATCH v4 06/12] ARM: OMAP: fix 'using plain integer as NULL pointer' sparse warnings
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

sparse warns when 0 is passed to a function expecting a pointer argument.
Resolve these warnings by replacing the 0 with NULL.

arch/arm/plat-omap/include/plat/dmtimer.h:319:34: warning: Using plain integer as NULL pointer
arch/arm/plat-omap/include/plat/dmtimer.h:324:35: warning: Using plain integer as NULL pointer
arch/arm/mach-omap2/irq.c:294:22: warning: Using plain integer as NULL pointer
arch/arm/mach-omap1/board-palmz71.c:292:50: warning: Using plain integer as NULL pointer
arch/arm/mach-omap1/board-palmz71.c:295:73: warning: Using plain integer as NULL pointer
arch/arm/mach-omap1/ams-delta-fiq.c:105:63: warning: Using plain integer as NULL pointer

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap1/ams-delta-fiq.c       |    2 +-
 arch/arm/mach-omap1/board-palmz71.c       |    4 ++--
 arch/arm/mach-omap2/irq.c                 |    2 +-
 arch/arm/plat-omap/include/plat/dmtimer.h |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c
index fcce7ff..31197bd 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq.c
+++ b/arch/arm/mach-omap1/ams-delta-fiq.c
@@ -102,7 +102,7 @@ void __init ams_delta_init_fiq(void)
 	}
 
 	retval = request_irq(INT_DEFERRED_FIQ, deferred_fiq,
-			IRQ_TYPE_EDGE_RISING, "deferred_fiq", 0);
+			IRQ_TYPE_EDGE_RISING, "deferred_fiq", NULL);
 	if (retval < 0) {
 		pr_err("Failed to get deferred_fiq IRQ, ret=%d\n", retval);
 		release_fiq(&fh);
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index a2c5abc..61ed4f0 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -289,10 +289,10 @@ palmz71_gpio_setup(int early)
 		gpio_direction_input(PALMZ71_USBDETECT_GPIO);
 		if (request_irq(gpio_to_irq(PALMZ71_USBDETECT_GPIO),
 				palmz71_powercable, IRQF_SAMPLE_RANDOM,
-				"palmz71-cable", 0))
+				"palmz71-cable", NULL))
 			printk(KERN_ERR
 					"IRQ request for power cable failed!\n");
-		palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), 0);
+		palmz71_powercable(gpio_to_irq(PALMZ71_USBDETECT_GPIO), NULL);
 	}
 }
 
diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c
index 14fbc78..80f3ced 100644
--- a/arch/arm/mach-omap2/irq.c
+++ b/arch/arm/mach-omap2/irq.c
@@ -335,7 +335,7 @@ void omap_intc_restore_context(void)
 void omap3_intc_suspend(void)
 {
 	/* A pending interrupt would prevent OMAP from entering suspend */
-	omap_ack_irq(0);
+	omap_ack_irq(NULL);
 }
 
 void omap3_intc_prepare_idle(void)
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 9418f00..230ff91 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -316,12 +316,12 @@ static inline void __omap_dm_timer_init_regs(struct omap_dm_timer *timer)
 				OMAP_TIMER_V1_SYS_STAT_OFFSET;
 		timer->irq_stat = timer->io_base + OMAP_TIMER_V1_STAT_OFFSET;
 		timer->irq_ena = timer->io_base + OMAP_TIMER_V1_INT_EN_OFFSET;
-		timer->irq_dis = 0;
+		timer->irq_dis = NULL;
 		timer->pend = timer->io_base + _OMAP_TIMER_WRITE_PEND_OFFSET;
 		timer->func_base = timer->io_base;
 	} else {
 		timer->revision = 2;
-		timer->sys_stat = 0;
+		timer->sys_stat = NULL;
 		timer->irq_stat = timer->io_base + OMAP_TIMER_V2_IRQSTATUS;
 		timer->irq_ena = timer->io_base + OMAP_TIMER_V2_IRQENABLE_SET;
 		timer->irq_dis = timer->io_base + OMAP_TIMER_V2_IRQENABLE_CLR;

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

* [PATCH v4 07/12] ARM: OMAP: OCM RAM: use memset_io() when clearing SRAM
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel

We currently treat the OCM RAM memory as memory that hangs off an
I/O bus, so use memset_io() to clear it rather than memset().
This also takes care of this sparse warning:

arch/arm/plat-omap/sram.c:199:9: warning: cast removes address space of expression

There is still one SRAM-related sparse warning, but it appears that
fixing it correctly will take some time and thought.

N.B., at some point, the OCM RAM IP block interface code should probably
be reimplemented as an MTD device or something similar under drivers/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/plat-omap/sram.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index eec98af..6beb79c 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -196,8 +196,8 @@ static void __init omap_map_sram(void)
 	 * Looks like we need to preserve some bootloader code at the
 	 * beginning of SRAM for jumping to flash for reboot to work...
 	 */
-	memset((void *)omap_sram_base + SRAM_BOOTLOADER_SZ, 0,
-	       omap_sram_size - SRAM_BOOTLOADER_SZ);
+	memset_io(omap_sram_base + SRAM_BOOTLOADER_SZ, 0,
+		  omap_sram_size - SRAM_BOOTLOADER_SZ);
 }
 
 /*



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

* [PATCH v4 07/12] ARM: OMAP: OCM RAM: use memset_io() when clearing SRAM
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

We currently treat the OCM RAM memory as memory that hangs off an
I/O bus, so use memset_io() to clear it rather than memset().
This also takes care of this sparse warning:

arch/arm/plat-omap/sram.c:199:9: warning: cast removes address space of expression

There is still one SRAM-related sparse warning, but it appears that
fixing it correctly will take some time and thought.

N.B., at some point, the OCM RAM IP block interface code should probably
be reimplemented as an MTD device or something similar under drivers/.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/plat-omap/sram.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index eec98af..6beb79c 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -196,8 +196,8 @@ static void __init omap_map_sram(void)
 	 * Looks like we need to preserve some bootloader code at the
 	 * beginning of SRAM for jumping to flash for reboot to work...
 	 */
-	memset((void *)omap_sram_base + SRAM_BOOTLOADER_SZ, 0,
-	       omap_sram_size - SRAM_BOOTLOADER_SZ);
+	memset_io(omap_sram_base + SRAM_BOOTLOADER_SZ, 0,
+		  omap_sram_size - SRAM_BOOTLOADER_SZ);
 }
 
 /*

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

* [PATCH v4 08/12] ARM: OMAP: DMA: use constant array maximum, drop some LCD DMA code
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel

gcc can apparently handle stack-allocated arrays that use a dynamic
variable as the array maximum.  Rather than using a mutable quantity,
simply use a constant maximum possible size.  To me, code clarity is
improved; and it also avoids the following sparse warnings:

arch/arm/plat-omap/dma.c:886:40: error: bad constant expression
arch/arm/plat-omap/dma.c:892:17: error: cannot size expression
arch/arm/plat-omap/dma.c:970:40: error: bad constant expression
arch/arm/plat-omap/dma.c:972:17: error: cannot size expression

Also drop some dead code from the OMAP1 LCD DMA code:

arch/arm/mach-omap1/lcd_dma.c:80:6: warning: symbol 'omap_set_lcd_dma_src_port' was not declared. Should it be static?

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap1/lcd_dma.c |    5 -----
 arch/arm/plat-omap/dma.c      |   13 +++++++++++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index 86ace9a..9237576 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -77,11 +77,6 @@ void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
 }
 EXPORT_SYMBOL(omap_set_lcd_dma_b1);
 
-void omap_set_lcd_dma_src_port(int port)
-{
-	lcd_dma.src_port = port;
-}
-
 void omap_set_lcd_dma_ext_controller(int external)
 {
 	lcd_dma.ext_ctrl = external;
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index ecdb3da..612227e 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -41,6 +41,15 @@
 
 #include <plat/tc.h>
 
+/*
+ * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA
+ * channels that an instance of the SDMA IP block can support.  Used
+ * to size arrays.  (The actual maximum on a particular SoC may be less
+ * than this -- for example, OMAP1 SDMA instances only support 17 logical
+ * DMA channels.)
+ */
+#define MAX_LOGICAL_DMA_CH_COUNT		32
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -883,7 +892,7 @@ void omap_start_dma(int lch)
 
 	if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
 		int next_lch, cur_lch;
-		char dma_chan_link_map[dma_lch_count];
+		char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
 
 		dma_chan_link_map[lch] = 1;
 		/* Set the link register of the first channel */
@@ -967,7 +976,7 @@ void omap_stop_dma(int lch)
 
 	if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
 		int next_lch, cur_lch = lch;
-		char dma_chan_link_map[dma_lch_count];
+		char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
 
 		memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
 		do {



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

* [PATCH v4 08/12] ARM: OMAP: DMA: use constant array maximum, drop some LCD DMA code
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

gcc can apparently handle stack-allocated arrays that use a dynamic
variable as the array maximum.  Rather than using a mutable quantity,
simply use a constant maximum possible size.  To me, code clarity is
improved; and it also avoids the following sparse warnings:

arch/arm/plat-omap/dma.c:886:40: error: bad constant expression
arch/arm/plat-omap/dma.c:892:17: error: cannot size expression
arch/arm/plat-omap/dma.c:970:40: error: bad constant expression
arch/arm/plat-omap/dma.c:972:17: error: cannot size expression

Also drop some dead code from the OMAP1 LCD DMA code:

arch/arm/mach-omap1/lcd_dma.c:80:6: warning: symbol 'omap_set_lcd_dma_src_port' was not declared. Should it be static?

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/mach-omap1/lcd_dma.c |    5 -----
 arch/arm/plat-omap/dma.c      |   13 +++++++++++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index 86ace9a..9237576 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -77,11 +77,6 @@ void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
 }
 EXPORT_SYMBOL(omap_set_lcd_dma_b1);
 
-void omap_set_lcd_dma_src_port(int port)
-{
-	lcd_dma.src_port = port;
-}
-
 void omap_set_lcd_dma_ext_controller(int external)
 {
 	lcd_dma.ext_ctrl = external;
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index ecdb3da..612227e 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -41,6 +41,15 @@
 
 #include <plat/tc.h>
 
+/*
+ * MAX_LOGICAL_DMA_CH_COUNT: the maximum number of logical DMA
+ * channels that an instance of the SDMA IP block can support.  Used
+ * to size arrays.  (The actual maximum on a particular SoC may be less
+ * than this -- for example, OMAP1 SDMA instances only support 17 logical
+ * DMA channels.)
+ */
+#define MAX_LOGICAL_DMA_CH_COUNT		32
+
 #undef DEBUG
 
 #ifndef CONFIG_ARCH_OMAP1
@@ -883,7 +892,7 @@ void omap_start_dma(int lch)
 
 	if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
 		int next_lch, cur_lch;
-		char dma_chan_link_map[dma_lch_count];
+		char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
 
 		dma_chan_link_map[lch] = 1;
 		/* Set the link register of the first channel */
@@ -967,7 +976,7 @@ void omap_stop_dma(int lch)
 
 	if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
 		int next_lch, cur_lch = lch;
-		char dma_chan_link_map[dma_lch_count];
+		char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
 
 		memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
 		do {

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

* [PATCH v4 09/12] ARM: OMAP: USB: remove unnecessary sideways include
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel

Remove the include of mach-omap2/common.h from plat-omap/usb.c.  It
appears to be unneeded.  Removing it also resolves the sparse warning:

arch/arm/plat-omap/../mach-omap2/common.h:183:12: warning: symbol 'omap_intc_of_init' was not declared. Should it be static?

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/plat-omap/usb.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index d2bbfd1..ab62388 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -31,8 +31,6 @@
 
 #include <mach/hardware.h>
 
-#include "../mach-omap2/common.h"
-
 #ifdef	CONFIG_ARCH_OMAP_OTG
 
 void __init



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

* [PATCH v4 09/12] ARM: OMAP: USB: remove unnecessary sideways include
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

Remove the include of mach-omap2/common.h from plat-omap/usb.c.  It
appears to be unneeded.  Removing it also resolves the sparse warning:

arch/arm/plat-omap/../mach-omap2/common.h:183:12: warning: symbol 'omap_intc_of_init' was not declared. Should it be static?

Signed-off-by: Paul Walmsley <paul@pwsan.com>
---
 arch/arm/plat-omap/usb.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index d2bbfd1..ab62388 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -31,8 +31,6 @@
 
 #include <mach/hardware.h>
 
-#include "../mach-omap2/common.h"
-
 #ifdef	CONFIG_ARCH_OMAP_OTG
 
 void __init

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

* [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:35   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel
  Cc: Imre Deak, Brian Swetland, Kevin Hilman, Kevin Hilman, Greg Lonnon

The H2, H3, Perseus2, and FSample board files all contain the same
duplicated code to handle NAND commands.  That code is missing
some casts around conversions from unsigned long to void __iomem *.

Consolidate the duplicated code into a new file,
arch/arm/mach-omap1/board-nand.c.  Resolve the sparse warnings by
adding appropriate casts:

arch/arm/mach-omap1/board-h2.c:193:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-h2.c:193:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-h2.c:193:9:    got unsigned long
arch/arm/mach-omap1/board-perseus2.c:157:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-perseus2.c:157:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-perseus2.c:157:9:    got unsigned long
arch/arm/mach-omap1/board-fsample.c:199:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-fsample.c:199:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-fsample.c:199:9:    got unsigned long
arch/arm/mach-omap1/board-h3.c:195:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-h3.c:195:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-h3.c:195:9:    got unsigned long

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Brian Swetland <swetland@google.com>
Cc: Imre Deak <imre.deak@nokia.com>
Cc: Greg Lonnon <glonnon@ridgerun.com>
Cc: Kevin Hilman <kjh@hilman.org>
Cc: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap1/Makefile         |   10 +++++----
 arch/arm/mach-omap1/board-fsample.c  |   16 +-------------
 arch/arm/mach-omap1/board-h2.c       |   17 +--------------
 arch/arm/mach-omap1/board-h3.c       |   16 +-------------
 arch/arm/mach-omap1/board-nand.c     |   39 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap1/board-perseus2.c |   16 +-------------
 arch/arm/mach-omap1/common.h         |    4 +++
 7 files changed, 53 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/mach-omap1/board-nand.c

diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 20d65af..398e9e5 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -31,13 +31,15 @@ usb-fs-$(CONFIG_USB)			:= usb.o
 obj-y					+= $(usb-fs-m) $(usb-fs-y)
 
 # Specific board support
-obj-$(CONFIG_MACH_OMAP_H2)		+= board-h2.o board-h2-mmc.o
+obj-$(CONFIG_MACH_OMAP_H2)		+= board-h2.o board-h2-mmc.o \
+					   board-nand.o
 obj-$(CONFIG_MACH_OMAP_INNOVATOR)	+= board-innovator.o
 obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o
-obj-$(CONFIG_MACH_OMAP_PERSEUS2)	+= board-perseus2.o
-obj-$(CONFIG_MACH_OMAP_FSAMPLE)		+= board-fsample.o
+obj-$(CONFIG_MACH_OMAP_PERSEUS2)	+= board-perseus2.o board-nand.o
+obj-$(CONFIG_MACH_OMAP_FSAMPLE)		+= board-fsample.o board-nand.o
 obj-$(CONFIG_MACH_OMAP_OSK)		+= board-osk.o
-obj-$(CONFIG_MACH_OMAP_H3)		+= board-h3.o board-h3-mmc.o
+obj-$(CONFIG_MACH_OMAP_H3)		+= board-h3.o board-h3-mmc.o \
+					   board-nand.o
 obj-$(CONFIG_MACH_VOICEBLUE)		+= board-voiceblue.o
 obj-$(CONFIG_MACH_OMAP_PALMTE)		+= board-palmte.o
 obj-$(CONFIG_MACH_OMAP_PALMZ71)		+= board-palmz71.o
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 80bd43c..4a4afb3 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -185,20 +185,6 @@ static struct platform_device nor_device = {
 	.resource	= &nor_resource,
 };
 
-static void nand_cmd_ctl(struct mtd_info *mtd, int cmd,	unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define FSAMPLE_NAND_RB_GPIO_PIN	62
 
 static int nand_dev_ready(struct mtd_info *mtd)
@@ -216,7 +202,7 @@ static struct platform_nand_data nand_data = {
 		.part_probe_types	= part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= nand_dev_ready,
 	},
 };
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 553a2e5..057ec13 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -179,20 +179,6 @@ static struct mtd_partition h2_nand_partitions[] = {
 	},
 };
 
-static void h2_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define H2_NAND_RB_GPIO_PIN	62
 
 static int h2_nand_dev_ready(struct mtd_info *mtd)
@@ -212,9 +198,8 @@ static struct platform_nand_data h2_nand_platdata = {
 		.part_probe_types	= h2_part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= h2_nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= h2_nand_dev_ready,
-
 	},
 };
 
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 4c19f4c..f6ddf87 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -181,20 +181,6 @@ static struct mtd_partition nand_partitions[] = {
 	},
 };
 
-static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define H3_NAND_RB_GPIO_PIN	10
 
 static int nand_dev_ready(struct mtd_info *mtd)
@@ -214,7 +200,7 @@ static struct platform_nand_data nand_platdata = {
 		.part_probe_types	= part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= nand_dev_ready,
 
 	},
diff --git a/arch/arm/mach-omap1/board-nand.c b/arch/arm/mach-omap1/board-nand.c
new file mode 100644
index 0000000..dfa8aab
--- /dev/null
+++ b/arch/arm/mach-omap1/board-nand.c
@@ -0,0 +1,39 @@
+/*
+ * linux/arch/arm/mach-omap1/board-nand.c
+ *
+ * Common OMAP1 board NAND code
+ *
+ * Copyright (C) 2004, 2012 Texas Instruments, Inc.
+ * Copyright (C) 2002 MontaVista Software, Inc.
+ * Copyright (C) 2001 RidgeRun, Inc.
+ * Author: RidgeRun, Inc.
+ *         Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+
+#include "common.h"
+
+void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+{
+	struct nand_chip *this = mtd->priv;
+	unsigned long mask;
+
+	if (cmd == NAND_CMD_NONE)
+		return;
+
+	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
+	if (ctrl & NAND_ALE)
+		mask |= 0x04;
+
+	mask |= (unsigned long)this->IO_ADDR_W;
+
+	writeb(cmd, (void __iomem *)mask);
+}
+
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 76d4ee0..a2c8889 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -143,20 +143,6 @@ static struct platform_device nor_device = {
 	.resource	= &nor_resource,
 };
 
-static void nand_cmd_ctl(struct mtd_info *mtd, int cmd,	unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define P2_NAND_RB_GPIO_PIN	62
 
 static int nand_dev_ready(struct mtd_info *mtd)
@@ -174,7 +160,7 @@ static struct platform_nand_data nand_data = {
 		.part_probe_types	= part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= nand_dev_ready,
 	},
 };
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index a90b9d7..8cc616e 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -27,6 +27,7 @@
 #define __ARCH_ARM_MACH_OMAP1_COMMON_H
 
 #include <plat/common.h>
+#include <linux/mtd/mtd.h>
 
 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
 void omap7xx_map_io(void);
@@ -58,6 +59,9 @@ void omap1_restart(char, const char *);
 
 extern void __init omap_check_revision(void);
 
+extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
+			       unsigned int ctrl);
+
 extern struct sys_timer omap1_timer;
 extern bool omap_32k_timer_init(void);
 



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

* [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code
@ 2012-04-11  0:35   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:35 UTC (permalink / raw)
  To: linux-arm-kernel

The H2, H3, Perseus2, and FSample board files all contain the same
duplicated code to handle NAND commands.  That code is missing
some casts around conversions from unsigned long to void __iomem *.

Consolidate the duplicated code into a new file,
arch/arm/mach-omap1/board-nand.c.  Resolve the sparse warnings by
adding appropriate casts:

arch/arm/mach-omap1/board-h2.c:193:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-h2.c:193:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-h2.c:193:9:    got unsigned long
arch/arm/mach-omap1/board-perseus2.c:157:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-perseus2.c:157:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-perseus2.c:157:9:    got unsigned long
arch/arm/mach-omap1/board-fsample.c:199:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-fsample.c:199:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-fsample.c:199:9:    got unsigned long
arch/arm/mach-omap1/board-h3.c:195:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/board-h3.c:195:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/board-h3.c:195:9:    got unsigned long

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Brian Swetland <swetland@google.com>
Cc: Imre Deak <imre.deak@nokia.com>
Cc: Greg Lonnon <glonnon@ridgerun.com>
Cc: Kevin Hilman <kjh@hilman.org>
Cc: Kevin Hilman <khilman@ti.com>
---
 arch/arm/mach-omap1/Makefile         |   10 +++++----
 arch/arm/mach-omap1/board-fsample.c  |   16 +-------------
 arch/arm/mach-omap1/board-h2.c       |   17 +--------------
 arch/arm/mach-omap1/board-h3.c       |   16 +-------------
 arch/arm/mach-omap1/board-nand.c     |   39 ++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap1/board-perseus2.c |   16 +-------------
 arch/arm/mach-omap1/common.h         |    4 +++
 7 files changed, 53 insertions(+), 65 deletions(-)
 create mode 100644 arch/arm/mach-omap1/board-nand.c

diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
index 20d65af..398e9e5 100644
--- a/arch/arm/mach-omap1/Makefile
+++ b/arch/arm/mach-omap1/Makefile
@@ -31,13 +31,15 @@ usb-fs-$(CONFIG_USB)			:= usb.o
 obj-y					+= $(usb-fs-m) $(usb-fs-y)
 
 # Specific board support
-obj-$(CONFIG_MACH_OMAP_H2)		+= board-h2.o board-h2-mmc.o
+obj-$(CONFIG_MACH_OMAP_H2)		+= board-h2.o board-h2-mmc.o \
+					   board-nand.o
 obj-$(CONFIG_MACH_OMAP_INNOVATOR)	+= board-innovator.o
 obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o
-obj-$(CONFIG_MACH_OMAP_PERSEUS2)	+= board-perseus2.o
-obj-$(CONFIG_MACH_OMAP_FSAMPLE)		+= board-fsample.o
+obj-$(CONFIG_MACH_OMAP_PERSEUS2)	+= board-perseus2.o board-nand.o
+obj-$(CONFIG_MACH_OMAP_FSAMPLE)		+= board-fsample.o board-nand.o
 obj-$(CONFIG_MACH_OMAP_OSK)		+= board-osk.o
-obj-$(CONFIG_MACH_OMAP_H3)		+= board-h3.o board-h3-mmc.o
+obj-$(CONFIG_MACH_OMAP_H3)		+= board-h3.o board-h3-mmc.o \
+					   board-nand.o
 obj-$(CONFIG_MACH_VOICEBLUE)		+= board-voiceblue.o
 obj-$(CONFIG_MACH_OMAP_PALMTE)		+= board-palmte.o
 obj-$(CONFIG_MACH_OMAP_PALMZ71)		+= board-palmz71.o
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index 80bd43c..4a4afb3 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -185,20 +185,6 @@ static struct platform_device nor_device = {
 	.resource	= &nor_resource,
 };
 
-static void nand_cmd_ctl(struct mtd_info *mtd, int cmd,	unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define FSAMPLE_NAND_RB_GPIO_PIN	62
 
 static int nand_dev_ready(struct mtd_info *mtd)
@@ -216,7 +202,7 @@ static struct platform_nand_data nand_data = {
 		.part_probe_types	= part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= nand_dev_ready,
 	},
 };
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 553a2e5..057ec13 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -179,20 +179,6 @@ static struct mtd_partition h2_nand_partitions[] = {
 	},
 };
 
-static void h2_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define H2_NAND_RB_GPIO_PIN	62
 
 static int h2_nand_dev_ready(struct mtd_info *mtd)
@@ -212,9 +198,8 @@ static struct platform_nand_data h2_nand_platdata = {
 		.part_probe_types	= h2_part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= h2_nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= h2_nand_dev_ready,
-
 	},
 };
 
diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c
index 4c19f4c..f6ddf87 100644
--- a/arch/arm/mach-omap1/board-h3.c
+++ b/arch/arm/mach-omap1/board-h3.c
@@ -181,20 +181,6 @@ static struct mtd_partition nand_partitions[] = {
 	},
 };
 
-static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define H3_NAND_RB_GPIO_PIN	10
 
 static int nand_dev_ready(struct mtd_info *mtd)
@@ -214,7 +200,7 @@ static struct platform_nand_data nand_platdata = {
 		.part_probe_types	= part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= nand_dev_ready,
 
 	},
diff --git a/arch/arm/mach-omap1/board-nand.c b/arch/arm/mach-omap1/board-nand.c
new file mode 100644
index 0000000..dfa8aab
--- /dev/null
+++ b/arch/arm/mach-omap1/board-nand.c
@@ -0,0 +1,39 @@
+/*
+ * linux/arch/arm/mach-omap1/board-nand.c
+ *
+ * Common OMAP1 board NAND code
+ *
+ * Copyright (C) 2004, 2012 Texas Instruments, Inc.
+ * Copyright (C) 2002 MontaVista Software, Inc.
+ * Copyright (C) 2001 RidgeRun, Inc.
+ * Author: RidgeRun, Inc.
+ *         Greg Lonnon (glonnon at ridgerun.com) or info at ridgerun.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include <linux/kernel.h>
+#include <linux/io.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
+
+#include "common.h"
+
+void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+{
+	struct nand_chip *this = mtd->priv;
+	unsigned long mask;
+
+	if (cmd == NAND_CMD_NONE)
+		return;
+
+	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
+	if (ctrl & NAND_ALE)
+		mask |= 0x04;
+
+	mask |= (unsigned long)this->IO_ADDR_W;
+
+	writeb(cmd, (void __iomem *)mask);
+}
+
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 76d4ee0..a2c8889 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -143,20 +143,6 @@ static struct platform_device nor_device = {
 	.resource	= &nor_resource,
 };
 
-static void nand_cmd_ctl(struct mtd_info *mtd, int cmd,	unsigned int ctrl)
-{
-	struct nand_chip *this = mtd->priv;
-	unsigned long mask;
-
-	if (cmd == NAND_CMD_NONE)
-		return;
-
-	mask = (ctrl & NAND_CLE) ? 0x02 : 0;
-	if (ctrl & NAND_ALE)
-		mask |= 0x04;
-	writeb(cmd, (unsigned long)this->IO_ADDR_W | mask);
-}
-
 #define P2_NAND_RB_GPIO_PIN	62
 
 static int nand_dev_ready(struct mtd_info *mtd)
@@ -174,7 +160,7 @@ static struct platform_nand_data nand_data = {
 		.part_probe_types	= part_probes,
 	},
 	.ctrl	= {
-		.cmd_ctrl	= nand_cmd_ctl,
+		.cmd_ctrl	= omap1_nand_cmd_ctl,
 		.dev_ready	= nand_dev_ready,
 	},
 };
diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h
index a90b9d7..8cc616e 100644
--- a/arch/arm/mach-omap1/common.h
+++ b/arch/arm/mach-omap1/common.h
@@ -27,6 +27,7 @@
 #define __ARCH_ARM_MACH_OMAP1_COMMON_H
 
 #include <plat/common.h>
+#include <linux/mtd/mtd.h>
 
 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
 void omap7xx_map_io(void);
@@ -58,6 +59,9 @@ void omap1_restart(char, const char *);
 
 extern void __init omap_check_revision(void);
 
+extern void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd,
+			       unsigned int ctrl);
+
 extern struct sys_timer omap1_timer;
 extern bool omap_32k_timer_init(void);
 

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

* [PATCH v4 11/12] ARM: OMAP1: DMTIMER: fix broken timer clock source selection
  2012-04-11  0:35 ` Paul Walmsley
@ 2012-04-11  0:36   ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:36 UTC (permalink / raw)
  To: linux-omap, linux-arm-kernel; +Cc: Tarun Kanti DebBarma

DMTIMER source selection on OMAP1 is broken.  omap1_dm_timer_set_src()
tries to use __raw_{read,write}l() to read from and write to physical
addresses, but those functions take virtual addresses.

sparse caught this:

arch/arm/mach-omap1/timer.c:50:13: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/timer.c:50:13:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/timer.c:50:13:    got unsigned int
arch/arm/mach-omap1/timer.c:52:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/timer.c:52:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/timer.c:52:9:    got unsigned int

Fix by using omap_{read,writel}(), just like the other users of the
MOD_CONF_CTRL_1 register in the OMAP1 codebase.  Of course, in the long term,
removing omap_{read,write}l() is the appropriate thing to do; but
this will take some work to do this cleanly.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
---
 arch/arm/mach-omap1/timer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 5536e04..64c65bc 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
 	int n = (pdev->id - 1) << 1;
 	u32 l;
 
-	l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
+	l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
 	l |= source << n;
-	__raw_writel(l, MOD_CONF_CTRL_1);
+	omap_writel(l, MOD_CONF_CTRL_1);
 
 	return 0;
 }



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

* [PATCH v4 11/12] ARM: OMAP1: DMTIMER: fix broken timer clock source selection
@ 2012-04-11  0:36   ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11  0:36 UTC (permalink / raw)
  To: linux-arm-kernel

DMTIMER source selection on OMAP1 is broken.  omap1_dm_timer_set_src()
tries to use __raw_{read,write}l() to read from and write to physical
addresses, but those functions take virtual addresses.

sparse caught this:

arch/arm/mach-omap1/timer.c:50:13: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/timer.c:50:13:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/timer.c:50:13:    got unsigned int
arch/arm/mach-omap1/timer.c:52:9: warning: incorrect type in argument 1 (different base types)
arch/arm/mach-omap1/timer.c:52:9:    expected void const volatile [noderef] <asn:2>*<noident>
arch/arm/mach-omap1/timer.c:52:9:    got unsigned int

Fix by using omap_{read,writel}(), just like the other users of the
MOD_CONF_CTRL_1 register in the OMAP1 codebase.  Of course, in the long term,
removing omap_{read,write}l() is the appropriate thing to do; but
this will take some work to do this cleanly.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>
---
 arch/arm/mach-omap1/timer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 5536e04..64c65bc 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
 	int n = (pdev->id - 1) << 1;
 	u32 l;
 
-	l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
+	l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
 	l |= source << n;
-	__raw_writel(l, MOD_CONF_CTRL_1);
+	omap_writel(l, MOD_CONF_CTRL_1);
 
 	return 0;
 }

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

* Re: [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
  2012-04-11  0:35   ` Paul Walmsley
@ 2012-04-11  7:49     ` Roland Stigge
  -1 siblings, 0 replies; 44+ messages in thread
From: Roland Stigge @ 2012-04-11  7:49 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: linux-omap, linux-arm-kernel, linux-usb, Felipe Balbi, Anand Gadiyar

On 04/11/2012 02:35 AM, Paul Walmsley wrote:
> Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
> for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?

I'd rather suspect a copy-paste error here since ocpi_enable() is unused
in ohci-nxp.c and the extern declaration looks like an incomplete but
intended removal.

Will probably just remove this reference in my DT patchset.

Roland

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

* [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
@ 2012-04-11  7:49     ` Roland Stigge
  0 siblings, 0 replies; 44+ messages in thread
From: Roland Stigge @ 2012-04-11  7:49 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/11/2012 02:35 AM, Paul Walmsley wrote:
> Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
> for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?

I'd rather suspect a copy-paste error here since ocpi_enable() is unused
in ohci-nxp.c and the extern declaration looks like an incomplete but
intended removal.

Will probably just remove this reference in my DT patchset.

Roland

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

* Re: [PATCH v4 01/12] ARM: OMAP2+: declare file-local functions as static
  2012-04-11  0:35   ` Paul Walmsley
@ 2012-04-11  8:43     ` Arnd Bergmann
  -1 siblings, 0 replies; 44+ messages in thread
From: Arnd Bergmann @ 2012-04-11  8:43 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Paul Walmsley, linux-omap, Govindraj R, Santosh Shilimkar, David Anders

On Wednesday 11 April 2012, Paul Walmsley wrote:
> Several function declarations used only in the files in which they're
> declared should include the static keyboard, but don't:
					^^^ ???

The patch looks good otherwise,

Acked-by: Arnd Bergmann <arnd@arndb.de>


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

* [PATCH v4 01/12] ARM: OMAP2+: declare file-local functions as static
@ 2012-04-11  8:43     ` Arnd Bergmann
  0 siblings, 0 replies; 44+ messages in thread
From: Arnd Bergmann @ 2012-04-11  8:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 11 April 2012, Paul Walmsley wrote:
> Several function declarations used only in the files in which they're
> declared should include the static keyboard, but don't:
					^^^ ???

The patch looks good otherwise,

Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code
  2012-04-11  0:35   ` Paul Walmsley
@ 2012-04-11  9:12     ` Arnd Bergmann
  -1 siblings, 0 replies; 44+ messages in thread
From: Arnd Bergmann @ 2012-04-11  9:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Paul Walmsley, linux-omap, Imre Deak, Brian Swetland,
	Kevin Hilman, Kevin Hilman, Greg Lonnon

On Wednesday 11 April 2012, Paul Walmsley wrote:
> +void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> +{
> +       struct nand_chip *this = mtd->priv;
> +       unsigned long mask;
> +
> +       if (cmd == NAND_CMD_NONE)
> +               return;
> +
> +       mask = (ctrl & NAND_CLE) ? 0x02 : 0;
> +       if (ctrl & NAND_ALE)
> +               mask |= 0x04;
> +
> +       mask |= (unsigned long)this->IO_ADDR_W;
> +
> +       writeb(cmd, (void __iomem *)mask);
> +}

IO_ADDR_W is always a page aligned pointer AFAICT, so you can actually
remove both casts and make it more readable at the same time by writing
the last two lines as

	writeb(cmd, this->IO_ADDR_W + mask);


	Arnd

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

* [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code
@ 2012-04-11  9:12     ` Arnd Bergmann
  0 siblings, 0 replies; 44+ messages in thread
From: Arnd Bergmann @ 2012-04-11  9:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 11 April 2012, Paul Walmsley wrote:
> +void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> +{
> +       struct nand_chip *this = mtd->priv;
> +       unsigned long mask;
> +
> +       if (cmd == NAND_CMD_NONE)
> +               return;
> +
> +       mask = (ctrl & NAND_CLE) ? 0x02 : 0;
> +       if (ctrl & NAND_ALE)
> +               mask |= 0x04;
> +
> +       mask |= (unsigned long)this->IO_ADDR_W;
> +
> +       writeb(cmd, (void __iomem *)mask);
> +}

IO_ADDR_W is always a page aligned pointer AFAICT, so you can actually
remove both casts and make it more readable at the same time by writing
the last two lines as

	writeb(cmd, this->IO_ADDR_W + mask);


	Arnd

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

* Re: [PATCH v4 01/12] ARM: OMAP2+: declare file-local functions as static
  2012-04-11  8:43     ` Arnd Bergmann
@ 2012-04-11 18:16       ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 18:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-omap, Govindraj R, Santosh Shilimkar,
	David Anders

On Wed, 11 Apr 2012, Arnd Bergmann wrote:

> On Wednesday 11 April 2012, Paul Walmsley wrote:
> > Several function declarations used only in the files in which they're
> > declared should include the static keyboard, but don't:
> 					^^^ ???

Heh, should have read "keyword".

> The patch looks good otherwise,
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the comment, ack added.

- Paul

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

* [PATCH v4 01/12] ARM: OMAP2+: declare file-local functions as static
@ 2012-04-11 18:16       ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 18:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 11 Apr 2012, Arnd Bergmann wrote:

> On Wednesday 11 April 2012, Paul Walmsley wrote:
> > Several function declarations used only in the files in which they're
> > declared should include the static keyboard, but don't:
> 					^^^ ???

Heh, should have read "keyword".

> The patch looks good otherwise,
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the comment, ack added.

- Paul

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

* Re: [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
  2012-04-11  7:49     ` Roland Stigge
@ 2012-04-11 18:19       ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 18:19 UTC (permalink / raw)
  To: Roland Stigge
  Cc: linux-omap, linux-arm-kernel, linux-usb, Felipe Balbi, Anand Gadiyar

On Wed, 11 Apr 2012, Roland Stigge wrote:

> On 04/11/2012 02:35 AM, Paul Walmsley wrote:
> > Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
> > for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?
> 
> I'd rather suspect a copy-paste error here since ocpi_enable() is unused
> in ohci-nxp.c and the extern declaration looks like an incomplete but
> intended removal.
> 
> Will probably just remove this reference in my DT patchset.

Thanks, will drop the comment from the patch description.


- Paul

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

* [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
@ 2012-04-11 18:19       ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 18:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 11 Apr 2012, Roland Stigge wrote:

> On 04/11/2012 02:35 AM, Paul Walmsley wrote:
> > Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
> > for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?
> 
> I'd rather suspect a copy-paste error here since ocpi_enable() is unused
> in ohci-nxp.c and the extern declaration looks like an incomplete but
> intended removal.
> 
> Will probably just remove this reference in my DT patchset.

Thanks, will drop the comment from the patch description.


- Paul

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

* Re: [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
  2012-04-11  0:35   ` Paul Walmsley
@ 2012-04-11 18:26     ` Felipe Balbi
  -1 siblings, 0 replies; 44+ messages in thread
From: Felipe Balbi @ 2012-04-11 18:26 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Roland Stigge,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi, Anand Gadiyar,
	Alan Stern

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

Hi,

+Alan Stern

On Tue, Apr 10, 2012 at 06:35:38PM -0600, Paul Walmsley wrote:
> The OMAP1 OHCI driver needs to enable the OCPI IP block before it can
> work.  Previously, the driver was simply calling a symbol defined in
> the OMAP platform code, but this is incorrect: drivers should be fully
> decoupled from platform and architecture code.
> 
> So instead, modify the driver to call through a platform_data function
> pointer instead.  We skip any DT aspect, since OMAP1 is not scheduled
> to be converted to DT in the near future.
> 
> This resolves the following sparse warning:
> 
> It also gets rid of a cpu_is_omap16xx() call in a driver.
> 
> In the long term, it probably makes sense to move the OCPI bus code to
> somewhere under drivers/.  This should avoid the whole platform_data/DT
> issue with this function.
> 
> Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
> for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?
> 
> Signed-off-by: Paul Walmsley <paul-DWxLp4Yu+b8AvxtiuMwx3w@public.gmane.org>
> Cc: Roland Stigge <stigge-uj/7R2tJ6VmzQB+pC5nmwQ@public.gmane.org>
> Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
> Cc: Anand Gadiyar <gadiyar-l0cyMroinI0@public.gmane.org>

FWIW:

Acked-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>

ideally ocpi.c would be a platform_driver

> ---
>  arch/arm/mach-omap1/usb.c               |    3 +++
>  arch/arm/plat-omap/include/plat/board.h |    2 ++
>  drivers/usb/host/ohci-omap.c            |    5 +++--
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
> index 19de03b..e61afd9 100644
> --- a/arch/arm/mach-omap1/usb.c
> +++ b/arch/arm/mach-omap1/usb.c
> @@ -29,6 +29,8 @@
>  #include <plat/mux.h>
>  #include <plat/usb.h>
>  
> +#include "common.h"
> +
>  /* These routines should handle the standard chip-specific modes
>   * for usb0/1/2 ports, covering basic mux and transceiver setup.
>   *
> @@ -138,6 +140,7 @@ static inline void ohci_device_init(struct omap_usb_config *pdata)
>  	if (cpu_is_omap7xx())
>  		ohci_resources[1].start = INT_7XX_USB_HHC_1;
>  	pdata->ohci_device = &ohci_device;
> +	pdata->ocpi_enable = &ocpi_enable;
>  }
>  
>  #else
> diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
> index d5eb4c8..4814c5b 100644
> --- a/arch/arm/plat-omap/include/plat/board.h
> +++ b/arch/arm/plat-omap/include/plat/board.h
> @@ -91,6 +91,8 @@ struct omap_usb_config {
>  	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
>  	u32 (*usb1_init)(unsigned nwires);
>  	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
> +
> +	int (*ocpi_enable)(void);
>  };
>  
>  struct omap_lcd_config {
> diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
> index 96451e4..71229cb 100644
> --- a/drivers/usb/host/ohci-omap.c
> +++ b/drivers/usb/host/ohci-omap.c
> @@ -205,8 +205,9 @@ static int ohci_omap_init(struct usb_hcd *hcd)
>  	need_transceiver = need_transceiver
>  			|| machine_is_omap_h2() || machine_is_omap_h3();
>  
> -	if (cpu_is_omap16xx())
> -		ocpi_enable();
> +	/* XXX OMAP16xx only */
> +	if (config->ocpi_enable)
> +		config->ocpi_enable();
>  
>  #ifdef	CONFIG_USB_OTG
>  	if (need_transceiver) {
> 
> 

-- 
balbi

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

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

* [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
@ 2012-04-11 18:26     ` Felipe Balbi
  0 siblings, 0 replies; 44+ messages in thread
From: Felipe Balbi @ 2012-04-11 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

+Alan Stern

On Tue, Apr 10, 2012 at 06:35:38PM -0600, Paul Walmsley wrote:
> The OMAP1 OHCI driver needs to enable the OCPI IP block before it can
> work.  Previously, the driver was simply calling a symbol defined in
> the OMAP platform code, but this is incorrect: drivers should be fully
> decoupled from platform and architecture code.
> 
> So instead, modify the driver to call through a platform_data function
> pointer instead.  We skip any DT aspect, since OMAP1 is not scheduled
> to be converted to DT in the near future.
> 
> This resolves the following sparse warning:
> 
> It also gets rid of a cpu_is_omap16xx() call in a driver.
> 
> In the long term, it probably makes sense to move the OCPI bus code to
> somewhere under drivers/.  This should avoid the whole platform_data/DT
> issue with this function.
> 
> Also interesting is that drivers/usb/host/ohci-nxp.c contains a stub
> for ocpi_enable() - perhaps the NXP chips use a similar OCPI IP block?
> 
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Roland Stigge <stigge@antcom.de>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Anand Gadiyar <gadiyar@ti.com>

FWIW:

Acked-by: Felipe Balbi <balbi@ti.com>

ideally ocpi.c would be a platform_driver

> ---
>  arch/arm/mach-omap1/usb.c               |    3 +++
>  arch/arm/plat-omap/include/plat/board.h |    2 ++
>  drivers/usb/host/ohci-omap.c            |    5 +++--
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
> index 19de03b..e61afd9 100644
> --- a/arch/arm/mach-omap1/usb.c
> +++ b/arch/arm/mach-omap1/usb.c
> @@ -29,6 +29,8 @@
>  #include <plat/mux.h>
>  #include <plat/usb.h>
>  
> +#include "common.h"
> +
>  /* These routines should handle the standard chip-specific modes
>   * for usb0/1/2 ports, covering basic mux and transceiver setup.
>   *
> @@ -138,6 +140,7 @@ static inline void ohci_device_init(struct omap_usb_config *pdata)
>  	if (cpu_is_omap7xx())
>  		ohci_resources[1].start = INT_7XX_USB_HHC_1;
>  	pdata->ohci_device = &ohci_device;
> +	pdata->ocpi_enable = &ocpi_enable;
>  }
>  
>  #else
> diff --git a/arch/arm/plat-omap/include/plat/board.h b/arch/arm/plat-omap/include/plat/board.h
> index d5eb4c8..4814c5b 100644
> --- a/arch/arm/plat-omap/include/plat/board.h
> +++ b/arch/arm/plat-omap/include/plat/board.h
> @@ -91,6 +91,8 @@ struct omap_usb_config {
>  	u32 (*usb0_init)(unsigned nwires, unsigned is_device);
>  	u32 (*usb1_init)(unsigned nwires);
>  	u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
> +
> +	int (*ocpi_enable)(void);
>  };
>  
>  struct omap_lcd_config {
> diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
> index 96451e4..71229cb 100644
> --- a/drivers/usb/host/ohci-omap.c
> +++ b/drivers/usb/host/ohci-omap.c
> @@ -205,8 +205,9 @@ static int ohci_omap_init(struct usb_hcd *hcd)
>  	need_transceiver = need_transceiver
>  			|| machine_is_omap_h2() || machine_is_omap_h3();
>  
> -	if (cpu_is_omap16xx())
> -		ocpi_enable();
> +	/* XXX OMAP16xx only */
> +	if (config->ocpi_enable)
> +		config->ocpi_enable();
>  
>  #ifdef	CONFIG_USB_OTG
>  	if (need_transceiver) {
> 
> 

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120411/4a7eb5da/attachment-0001.sig>

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

* Re: [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code
  2012-04-11  9:12     ` Arnd Bergmann
@ 2012-04-11 18:45       ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 18:45 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linux-omap, Imre Deak, Brian Swetland,
	Kevin Hilman, Kevin Hilman, Greg Lonnon

On Wed, 11 Apr 2012, Arnd Bergmann wrote:

> On Wednesday 11 April 2012, Paul Walmsley wrote:
> > +void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> > +{
> > +       struct nand_chip *this = mtd->priv;
> > +       unsigned long mask;
> > +
> > +       if (cmd == NAND_CMD_NONE)
> > +               return;
> > +
> > +       mask = (ctrl & NAND_CLE) ? 0x02 : 0;
> > +       if (ctrl & NAND_ALE)
> > +               mask |= 0x04;
> > +
> > +       mask |= (unsigned long)this->IO_ADDR_W;
> > +
> > +       writeb(cmd, (void __iomem *)mask);
> > +}
> 
> IO_ADDR_W is always a page aligned pointer AFAICT, so you can actually
> remove both casts and make it more readable at the same time by writing
> the last two lines as
> 
> 	writeb(cmd, this->IO_ADDR_W + mask);

Thanks, patch updated.


- Paul

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

* [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code
@ 2012-04-11 18:45       ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 18:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 11 Apr 2012, Arnd Bergmann wrote:

> On Wednesday 11 April 2012, Paul Walmsley wrote:
> > +void omap1_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
> > +{
> > +       struct nand_chip *this = mtd->priv;
> > +       unsigned long mask;
> > +
> > +       if (cmd == NAND_CMD_NONE)
> > +               return;
> > +
> > +       mask = (ctrl & NAND_CLE) ? 0x02 : 0;
> > +       if (ctrl & NAND_ALE)
> > +               mask |= 0x04;
> > +
> > +       mask |= (unsigned long)this->IO_ADDR_W;
> > +
> > +       writeb(cmd, (void __iomem *)mask);
> > +}
> 
> IO_ADDR_W is always a page aligned pointer AFAICT, so you can actually
> remove both casts and make it more readable at the same time by writing
> the last two lines as
> 
> 	writeb(cmd, this->IO_ADDR_W + mask);

Thanks, patch updated.


- Paul

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

* Re: [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
  2012-04-11 18:26     ` Felipe Balbi
@ 2012-04-11 19:01         ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 19:01 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Roland Stigge,
	linux-usb-u79uwXL29TY76Z2rM5mHXA, Anand Gadiyar, Alan Stern

Hi Felipe,

On Wed, 11 Apr 2012, Felipe Balbi wrote:

> Acked-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>

Thanks, ack added.

> ideally ocpi.c would be a platform_driver

Agreed.


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus
@ 2012-04-11 19:01         ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-11 19:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Felipe,

On Wed, 11 Apr 2012, Felipe Balbi wrote:

> Acked-by: Felipe Balbi <balbi@ti.com>

Thanks, ack added.

> ideally ocpi.c would be a platform_driver

Agreed.


- Paul

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

* Re: [PATCH v4 11/12] ARM: OMAP1: DMTIMER: fix broken timer clock source selection
  2012-04-11  0:36   ` Paul Walmsley
@ 2012-04-17 21:48     ` Tony Lindgren
  -1 siblings, 0 replies; 44+ messages in thread
From: Tony Lindgren @ 2012-04-17 21:48 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap, linux-arm-kernel, Tarun Kanti DebBarma

* Paul Walmsley <paul@pwsan.com> [120410 17:41]:
> DMTIMER source selection on OMAP1 is broken.  omap1_dm_timer_set_src()
> tries to use __raw_{read,write}l() to read from and write to physical
> addresses, but those functions take virtual addresses.
> 
> sparse caught this:
> 
> arch/arm/mach-omap1/timer.c:50:13: warning: incorrect type in argument 1 (different base types)
> arch/arm/mach-omap1/timer.c:50:13:    expected void const volatile [noderef] <asn:2>*<noident>
> arch/arm/mach-omap1/timer.c:50:13:    got unsigned int
> arch/arm/mach-omap1/timer.c:52:9: warning: incorrect type in argument 1 (different base types)
> arch/arm/mach-omap1/timer.c:52:9:    expected void const volatile [noderef] <asn:2>*<noident>
> arch/arm/mach-omap1/timer.c:52:9:    got unsigned int
> 
> Fix by using omap_{read,writel}(), just like the other users of the
> MOD_CONF_CTRL_1 register in the OMAP1 codebase.  Of course, in the long term,
> removing omap_{read,write}l() is the appropriate thing to do; but
> this will take some work to do this cleanly.
> 
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>

Uhh looks like this was caused by commit 97933d6 (ARM: OMAP1: dmtimer: conversion
to platform devices) moving code and changing it :(

I'll pick this to fixes.

Tony

> ---
>  arch/arm/mach-omap1/timer.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
> index 5536e04..64c65bc 100644
> --- a/arch/arm/mach-omap1/timer.c
> +++ b/arch/arm/mach-omap1/timer.c
> @@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
>  	int n = (pdev->id - 1) << 1;
>  	u32 l;
>  
> -	l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
> +	l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
>  	l |= source << n;
> -	__raw_writel(l, MOD_CONF_CTRL_1);
> +	omap_writel(l, MOD_CONF_CTRL_1);
>  
>  	return 0;
>  }
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v4 11/12] ARM: OMAP1: DMTIMER: fix broken timer clock source selection
@ 2012-04-17 21:48     ` Tony Lindgren
  0 siblings, 0 replies; 44+ messages in thread
From: Tony Lindgren @ 2012-04-17 21:48 UTC (permalink / raw)
  To: linux-arm-kernel

* Paul Walmsley <paul@pwsan.com> [120410 17:41]:
> DMTIMER source selection on OMAP1 is broken.  omap1_dm_timer_set_src()
> tries to use __raw_{read,write}l() to read from and write to physical
> addresses, but those functions take virtual addresses.
> 
> sparse caught this:
> 
> arch/arm/mach-omap1/timer.c:50:13: warning: incorrect type in argument 1 (different base types)
> arch/arm/mach-omap1/timer.c:50:13:    expected void const volatile [noderef] <asn:2>*<noident>
> arch/arm/mach-omap1/timer.c:50:13:    got unsigned int
> arch/arm/mach-omap1/timer.c:52:9: warning: incorrect type in argument 1 (different base types)
> arch/arm/mach-omap1/timer.c:52:9:    expected void const volatile [noderef] <asn:2>*<noident>
> arch/arm/mach-omap1/timer.c:52:9:    got unsigned int
> 
> Fix by using omap_{read,writel}(), just like the other users of the
> MOD_CONF_CTRL_1 register in the OMAP1 codebase.  Of course, in the long term,
> removing omap_{read,write}l() is the appropriate thing to do; but
> this will take some work to do this cleanly.
> 
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Tarun Kanti DebBarma <tarun.kanti@ti.com>

Uhh looks like this was caused by commit 97933d6 (ARM: OMAP1: dmtimer: conversion
to platform devices) moving code and changing it :(

I'll pick this to fixes.

Tony

> ---
>  arch/arm/mach-omap1/timer.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
> index 5536e04..64c65bc 100644
> --- a/arch/arm/mach-omap1/timer.c
> +++ b/arch/arm/mach-omap1/timer.c
> @@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
>  	int n = (pdev->id - 1) << 1;
>  	u32 l;
>  
> -	l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
> +	l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
>  	l |= source << n;
> -	__raw_writel(l, MOD_CONF_CTRL_1);
> +	omap_writel(l, MOD_CONF_CTRL_1);
>  
>  	return 0;
>  }
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 11/12] ARM: OMAP1: DMTIMER: fix broken timer clock source selection
  2012-04-17 21:48     ` Tony Lindgren
@ 2012-04-17 21:53       ` Paul Walmsley
  -1 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-17 21:53 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, linux-arm-kernel, Tarun Kanti DebBarma

On Tue, 17 Apr 2012, Tony Lindgren wrote:

> Uhh looks like this was caused by commit 97933d6 (ARM: OMAP1: dmtimer: conversion
> to platform devices) moving code and changing it :(
> 
> I'll pick this to fixes.

Sounds good, will drop this from my series and send a new pull request.


- Paul

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

* [PATCH v4 11/12] ARM: OMAP1: DMTIMER: fix broken timer clock source selection
@ 2012-04-17 21:53       ` Paul Walmsley
  0 siblings, 0 replies; 44+ messages in thread
From: Paul Walmsley @ 2012-04-17 21:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 17 Apr 2012, Tony Lindgren wrote:

> Uhh looks like this was caused by commit 97933d6 (ARM: OMAP1: dmtimer: conversion
> to platform devices) moving code and changing it :(
> 
> I'll pick this to fixes.

Sounds good, will drop this from my series and send a new pull request.


- Paul

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

end of thread, other threads:[~2012-04-17 21:53 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11  0:35 [PATCH v4 00/12] ARM: OMAP: resolve some warnings Paul Walmsley
2012-04-11  0:35 ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 01/12] ARM: OMAP2+: declare file-local functions as static Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  8:43   ` Arnd Bergmann
2012-04-11  8:43     ` Arnd Bergmann
2012-04-11 18:16     ` Paul Walmsley
2012-04-11 18:16       ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 02/12] ARM: OMAP: add includes for missing prototypes Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 03/12] ARM: OMAP1: OCPI: move to mach-omap1/ Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 04/12] ARM: OMAP1: OHCI: use platform_data fn ptr to enable OCPI bus Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  7:49   ` Roland Stigge
2012-04-11  7:49     ` Roland Stigge
2012-04-11 18:19     ` Paul Walmsley
2012-04-11 18:19       ` Paul Walmsley
2012-04-11 18:26   ` Felipe Balbi
2012-04-11 18:26     ` Felipe Balbi
     [not found]     ` <20120411182634.GA9396-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-04-11 19:01       ` Paul Walmsley
2012-04-11 19:01         ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 05/12] ARM: OMAP2+: GPMC: resolve type-conversion warning from sparse Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 06/12] ARM: OMAP: fix 'using plain integer as NULL pointer' sparse warnings Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 07/12] ARM: OMAP: OCM RAM: use memset_io() when clearing SRAM Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 08/12] ARM: OMAP: DMA: use constant array maximum, drop some LCD DMA code Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 09/12] ARM: OMAP: USB: remove unnecessary sideways include Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  0:35 ` [PATCH v4 10/12] ARM: OMAP1: board files: deduplicate and clean some NAND-related code Paul Walmsley
2012-04-11  0:35   ` Paul Walmsley
2012-04-11  9:12   ` Arnd Bergmann
2012-04-11  9:12     ` Arnd Bergmann
2012-04-11 18:45     ` Paul Walmsley
2012-04-11 18:45       ` Paul Walmsley
2012-04-11  0:36 ` [PATCH v4 11/12] ARM: OMAP1: DMTIMER: fix broken timer clock source selection Paul Walmsley
2012-04-11  0:36   ` Paul Walmsley
2012-04-17 21:48   ` Tony Lindgren
2012-04-17 21:48     ` Tony Lindgren
2012-04-17 21:53     ` Paul Walmsley
2012-04-17 21:53       ` Paul Walmsley

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.