]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
mach-omap2: fix sparse warnings, some style issues for OMAP2 builds
authorPaul Walmsley <paul@pwsan.com>
Fri, 18 Jul 2008 02:52:39 +0000 (20:52 -0600)
committerTony Lindgren <tony@atomide.com>
Tue, 5 Aug 2008 11:49:32 +0000 (14:49 +0300)
This cleans up remaining sparse warnings for OMAP2 builds and fixes a
few CodingStyle issues.  This involves:

- removing casts where they don't belong,

- adding casts where they should be,

- marking internal functions as static,

- fixing some indentation in board-2430sdp-flash.c.

Patch should cause no change in kernel behavior.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
12 files changed:
arch/arm/mach-omap2/board-2430sdp-flash.c
arch/arm/mach-omap2/board-n800-audio.c
arch/arm/mach-omap2/board-n800-camera.c
arch/arm/mach-omap2/board-n800.h
arch/arm/mach-omap2/clock24xx.c
arch/arm/mach-omap2/mailbox.c
arch/arm/mach-omap2/mcbsp.c
arch/arm/mach-omap2/mmu.h
arch/arm/mach-omap2/mux.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/pm.h
include/asm-arm/arch-omap/mailbox.h

index 47aa8bff1476d7bfcea1f051c3749ddecd364286..aaa8db46e3c630e15ecac1a23295acef22142ccd 100644 (file)
@@ -125,16 +125,16 @@ static struct platform_device sdp_onenand_device = {
 
 void __init sdp2430_flash_init(void)
 {
-       unsigned long gpmc_base_add, gpmc_cs_base_add;
+       void __iomem *gpmc_base_add, *gpmc_cs_base_add;
        unsigned char cs = 0;
 
-       gpmc_base_add = OMAP243X_GPMC_VIRT;
+       gpmc_base_add = (__force void __iomem *)OMAP243X_GPMC_VIRT;
        while (cs < GPMC_CS_NUM) {
                int ret = 0;
 
                /* Each GPMC set for a single CS is at offset 0x30 */
-               gpmc_cs_base_add =
-                       (gpmc_base_add + GPMC_OFF_CONFIG1_0 + (cs*0x30));
+               gpmc_cs_base_add = (gpmc_base_add + GPMC_OFF_CONFIG1_0 +
+                                   (cs*0x30));
 
                /* xloader/Uboot would have programmed the NAND/oneNAND
                 * base address for us This is a ugly hack. The proper
@@ -164,22 +164,22 @@ void __init sdp2430_flash_init(void)
        }
 
        if (flash_type == NAND) {
-               sdp_nand_data.cs               = cs;
-               sdp_nand_data.gpmc_cs_baseaddr = (void *) gpmc_cs_base_add;
-               sdp_nand_data.gpmc_baseaddr    = (void *) gpmc_base_add;
+               sdp_nand_data.cs               = cs;
+               sdp_nand_data.gpmc_cs_baseaddr = gpmc_cs_base_add;
+               sdp_nand_data.gpmc_baseaddr    = gpmc_base_add;
 
                if (platform_device_register(&sdp_nand_device) < 0) {
                        printk(KERN_ERR "Unable to register NAND device\n");
-               return;
-       }
+                       return;
+               }
        }
 
        if (flash_type == ONENAND) {
-       sdp_onenand_data.cs = cs;
+               sdp_onenand_data.cs = cs;
 
-       if (platform_device_register(&sdp_onenand_device) < 0) {
-               printk(KERN_ERR "Unable to register OneNAND device\n");
-               return;
-       }
+               if (platform_device_register(&sdp_onenand_device) < 0) {
+                       printk(KERN_ERR "Unable to register OneNAND device\n");
+                       return;
+               }
        }
 }
index bebc4a50b0b387b490df4106135cd55a8085ddc7..233198edbd577ca0db8c577442132fe8177d4caf 100644 (file)
@@ -54,11 +54,13 @@ static int eac_mux_disabled = 0;
 static int clkout2_mux_disabled = 0;
 static u32 saved_mux[2];
 
+#define MUX_EAC_IOP2V(x)               (__force void __iomem *)io_p2v(x)
+
 static void n800_enable_eac_mux(void)
 {
        if (!eac_mux_disabled)
                return;
-       __raw_writel(saved_mux[1], IO_ADDRESS(0x48000124));
+       __raw_writel(saved_mux[1], MUX_EAC_IOP2V(0x48000124));
        eac_mux_disabled = 0;
 }
 
@@ -68,8 +70,8 @@ static void n800_disable_eac_mux(void)
                WARN_ON(eac_mux_disabled);
                return;
        }
-       saved_mux[1] = __raw_readl(IO_ADDRESS(0x48000124));
-       __raw_writel(0x1f1f1f1f, IO_ADDRESS(0x48000124));
+       saved_mux[1] = __raw_readl(MUX_EAC_IOP2V(0x48000124));
+       __raw_writel(0x1f1f1f1f, MUX_EAC_IOP2V(0x48000124));
        eac_mux_disabled = 1;
 }
 
@@ -77,7 +79,7 @@ static void n800_enable_clkout2_mux(void)
 {
        if (!clkout2_mux_disabled)
                return;
-       __raw_writel(saved_mux[0], IO_ADDRESS(0x480000e8));
+       __raw_writel(saved_mux[0], MUX_EAC_IOP2V(0x480000e8));
        clkout2_mux_disabled = 0;
 }
 
@@ -89,10 +91,10 @@ static void n800_disable_clkout2_mux(void)
                WARN_ON(clkout2_mux_disabled);
                return;
        }
-       saved_mux[0] = __raw_readl(IO_ADDRESS(0x480000e8));
+       saved_mux[0] = __raw_readl(MUX_EAC_IOP2V(0x480000e8));
        l = saved_mux[0] & ~0xff;
        l |= 0x1f;
-       __raw_writel(l, IO_ADDRESS(0x480000e8));
+       __raw_writel(l, MUX_EAC_IOP2V(0x480000e8));
        clkout2_mux_disabled = 1;
 }
 
index 94148822f567c557db8358c1f7d0e5bbcf5f2f61..701dedaa2583335b23e0ab2d0f7203172759674a 100644 (file)
@@ -37,6 +37,8 @@
 #include <../drivers/cbus/retu.h>
 #include <../drivers/media/video/tcm825x.h>
 
+#include "board-n800.h"
+
 #if defined (CONFIG_VIDEO_TCM825X) || defined (CONFIG_VIDEO_TCM825X_MODULE)
 
 #define OMAP24XX_CAMERA_JAM_HACK
index 96d2fa3cb4bfe8ebd2c42065d320fbfaea0b863b..e71dae4722a5705ed06a0ce74b360113b17afa8c 100644 (file)
@@ -18,4 +18,6 @@ void __init nokia_n800_common_init(void);
 void __init nokia_n800_map_io(void);
 void __init nokia_n800_init_irq(void);
 
+extern const struct tcm825x_platform_data n800_tcm825x_platform_data;
+
 #endif
index 54cc6e10350508f89c3f0c202abf1605bc0d915d..1c9351cace1b4c29f9726f8d6d3c1422d6df79a4 100644 (file)
@@ -530,7 +530,7 @@ static inline void omap2_clk_check_reg(u32 flags, void __iomem **reg)
        *reg = (__force void __iomem *)tmp;
 }
 
-void __init omap2_clk_rewrite_base(struct clk *clk)
+static void __init omap2_clk_rewrite_base(struct clk *clk)
 {
        omap2_clk_check_reg(clk->flags, &clk->clksel_reg);
        omap2_clk_check_reg(clk->flags, &clk->enable_reg);
index 4799561c5a9ec048f46bdfb9cf53d437c04e82ff..ac88d329994cd59e1349d981e10f3cc7442c3804 100644 (file)
@@ -75,12 +75,12 @@ static void omap2_mbox_enable_irq(struct omap_mbox *mbox,
 
 static inline unsigned int mbox_read_reg(unsigned int reg)
 {
-       return __raw_readl(mbox_base + reg);
+       return __raw_readl((void __iomem *)(mbox_base + reg));
 }
 
 static inline void mbox_write_reg(unsigned int val, unsigned int reg)
 {
-       __raw_writel(val, mbox_base + reg);
+       __raw_writel(val, (void __iomem *)(mbox_base + reg));
 }
 
 /* Mailbox H/W preparations */
index 17cf199d113005dd24981bba01efe2a7a5b9e7b4..2cca1b7bc4b64253bf8029866600c5ef04b126e6 100644 (file)
@@ -185,7 +185,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
 #define OMAP34XX_MCBSP_PDATA_SZ                0
 #endif
 
-int __init omap2_mcbsp_init(void)
+static int __init omap2_mcbsp_init(void)
 {
        int i;
 
index f45fcca0cf2abea7d9c7872f4476442370334bea..363eaa1e9cb6da8d00957a59169333a0b3947c9f 100644 (file)
@@ -105,13 +105,13 @@ struct omap_mmu_tlb_entry {
 static inline unsigned long
 omap_mmu_read_reg(struct omap_mmu *mmu, unsigned long reg)
 {
-       return __raw_readl(mmu->base + reg);
+       return __raw_readl((void __iomem *)(mmu->base + reg));
 }
 
 static inline void omap_mmu_write_reg(struct omap_mmu *mmu,
                               unsigned long val, unsigned long reg)
 {
-       __raw_writel(val, mmu->base + reg);
+       __raw_writel(val, (void __iomem *)(mmu->base + reg));
 }
 
 #endif /* __MACH_OMAP2_MMU_H */
index 5a68fb35dbb50e404316455b6fd5f1ce6be0c726..545e0924ba58ab93b9e94f530b23271c26ab6cd0 100644 (file)
@@ -408,7 +408,7 @@ static void __init_or_module omap2_cfg_debug(const struct pin_config *cfg, u16 r
 #endif
 
 #ifdef CONFIG_ARCH_OMAP24XX
-int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg)
+static int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg)
 {
        static DEFINE_SPINLOCK(mux_spin_lock);
        unsigned long flags;
index f69982661c0227c3101a7537cb74540bf7b46090..524b4db06dca699bd774606b369fed592808f41c 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/mach/time.h>
 #include <asm/atomic.h>
 
+#include <asm/arch/pm.h>
 #include "pm.h"
 
 unsigned short enable_dyn_sleep;
index 31712f439b17e66a557fc503069c8a2a054d70f3..68c92781d83575dbfd0874464a3fcbfe71c47223 100644 (file)
@@ -32,11 +32,11 @@ extern void pm_init_serial_console(void);
 extern void serial_console_sleep(int enable);
 extern int omap2_pm_debug;
 #else
-#define omap2_read_32k_sync_counter() 0;
-#define serial_console_sleep(enable) do; while(0)
-#define pm_init_serial_console() do; while(0)
-#define omap2_pm_dump(mode,resume,us) do; while(0)
-#define serial_console_fclk_mask(f1,f2)  do; while(0)
-#define omap2_pm_debug 0
+#define omap2_read_32k_sync_counter()          0
+#define serial_console_sleep(enable)           do {} while (0);
+#define pm_init_serial_console()               do {} while (0);
+#define omap2_pm_dump(mode, resume, us)                do {} while (0);
+#define serial_console_fclk_mask(f1, f2)               do {} while (0);
+#define omap2_pm_debug                         0
 #endif /* CONFIG_PM_DEBUG */
 #endif
index 7cbed9332e169f36854349048051cf02b979144e..9d3994b7ff62ed31d4bd7d14d2cdee7c288c329e 100644 (file)
@@ -61,6 +61,8 @@ struct omap_mbox {
        void                    (*err_notify)(void);
 };
 
+extern struct omap_mbox mbox_dsp_info;
+
 int omap_mbox_msg_send(struct omap_mbox *, mbox_msg_t msg, void *);
 void omap_mbox_init_seq(struct omap_mbox *);