From ab6a818ea32ee2eadb61fa2bb8bc9e0ce20600fe Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 16 Apr 2007 18:06:32 +0000 Subject: [PATCH] CodingStyle fixes based on LKML comments Changes are mostly: - No externs in .c files - Use standard commenting format - Use standard debug functions or loglevel for printk Signed-off-by: Tony Lindgren --- arch/arm/mach-omap1/Kconfig | 14 +++++++------- arch/arm/mach-omap1/board-palmz71.c | 14 +++++++------- arch/arm/mach-omap2/board-n800-audio.c | 4 ++-- arch/arm/mach-omap2/board-n800-dsp.c | 4 +--- arch/arm/mach-omap2/board-n800-flash.c | 4 ++-- arch/arm/mach-omap2/board-n800-mmc.c | 21 ++++++++++++--------- arch/arm/mach-omap2/board-n800-pm.c | 6 ++++-- arch/arm/mach-omap2/board-n800-usb.c | 2 +- arch/arm/mach-omap2/board-n800.c | 14 ++------------ arch/arm/mach-omap2/pm.c | 21 +++++---------------- arch/arm/plat-omap/fb.c | 24 +++++++++++++++--------- arch/arm/plat-omap/sram.c | 3 ++- include/asm-arm/arch-omap/board-nokia.h | 11 +++++++++++ include/asm-arm/arch-omap/gpio.h | 2 ++ include/asm-arm/arch-omap/gpmc.h | 1 + include/asm-arm/arch-omap/pm.h | 2 ++ 16 files changed, 76 insertions(+), 71 deletions(-) diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 5a87aa982dd..72852dc6ae9 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig @@ -90,13 +90,13 @@ config MACH_OMAP_PALMTE Say Y here if you have this PDA model, say N otherwise. config MACH_OMAP_PALMZ71 - bool "Palm Zire71" - depends on ARCH_OMAP1 && ARCH_OMAP15XX - help - Support for the Palm Zire71 PDA. To boot the kernel, - you'll need a PalmOS compatible bootloader; check out - http://hackndev.com/palm/z71 for more informations. - Say Y here if you have such a PDA, say N otherwise. + bool "Palm Zire71" + depends on ARCH_OMAP1 && ARCH_OMAP15XX + help + Support for the Palm Zire71 PDA. To boot the kernel, + you'll need a PalmOS compatible bootloader; check out + http://hackndev.com/palm/z71 for more informations. + Say Y here if you have such a PDA, say N otherwise. config MACH_OMAP_PALMTT bool "Palm Tungsten|T" diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index 3936190db84..c275d517764 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c @@ -199,12 +199,12 @@ static struct omap_mcbsp_reg_cfg mcbsp_regs = { static struct omap_alsa_codec_config alsa_config = { .name = "PalmZ71 AIC23", .mcbsp_regs_alsa = &mcbsp_regs, - .codec_configure_dev = NULL, // aic23_configure, - .codec_set_samplerate = NULL, // aic23_set_samplerate, - .codec_clock_setup = NULL, // aic23_clock_setup, - .codec_clock_on = NULL, // aic23_clock_on, - .codec_clock_off = NULL, // aic23_clock_off, - .get_default_samplerate = NULL, // aic23_get_default_samplerate, + .codec_configure_dev = NULL, /* aic23_configure */ + .codec_set_samplerate = NULL, /* aic23_set_samplerate */ + .codec_clock_setup = NULL, /* aic23_clock_setup */ + .codec_clock_on = NULL, /* aic23_clock_on */ + .codec_clock_off = NULL, /* aic23_clock_off */ + .get_default_samplerate = NULL, /* aic23_get_default_samplerate */ }; static struct platform_device palmz71_mcbsp1_device = { @@ -345,7 +345,7 @@ palmz71_gpio_setup(int early) palmz71_powercable, IRQF_SAMPLE_RANDOM, "palmz71-cable", 0)) printk(KERN_ERR - "IRQ request for power cable failed!\n"); + "IRQ request for power cable failed!\n"); palmz71_powercable(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), 0); } } diff --git a/arch/arm/mach-omap2/board-n800-audio.c b/arch/arm/mach-omap2/board-n800-audio.c index fa6ab869927..9033de58319 100644 --- a/arch/arm/mach-omap2/board-n800-audio.c +++ b/arch/arm/mach-omap2/board-n800-audio.c @@ -188,14 +188,14 @@ static int n800_codec_get_clocks(struct device *dev) { sys_clkout2 = clk_get(dev, "sys_clkout2"); if (IS_ERR(sys_clkout2)) { - printk(KERN_ERR "Could not get sys_clkout2\n"); + dev_err(dev, "Could not get sys_clkout2\n"); return -ENODEV; } /* configure 12 MHz output on SYS_CLKOUT2. Therefore we must use * 96 MHz as its parent in order to get 12 MHz */ func96m_clk = clk_get(dev, "func_96m_ck"); if (IS_ERR(func96m_clk)) { - printk(KERN_ERR "could not get func 96M clock\n"); + dev_err(dev, "Could not get func 96M clock\n"); clk_put(sys_clkout2); return -ENODEV; } diff --git a/arch/arm/mach-omap2/board-n800-dsp.c b/arch/arm/mach-omap2/board-n800-dsp.c index a15ff961fbf..b6da02f8f75 100644 --- a/arch/arm/mach-omap2/board-n800-dsp.c +++ b/arch/arm/mach-omap2/board-n800-dsp.c @@ -29,12 +29,10 @@ #include #include +#include #include "../plat-omap/dsp/dsp_common.h" -extern int n800_audio_enable(struct dsp_kfunc_device *kdev, int stage); -extern int n800_audio_disable(struct dsp_kfunc_device *kdev, int stage); - #if defined(CONFIG_OMAP_DSP) /* diff --git a/arch/arm/mach-omap2/board-n800-flash.c b/arch/arm/mach-omap2/board-n800-flash.c index 4005cfb56ad..528ee52a377 100644 --- a/arch/arm/mach-omap2/board-n800-flash.c +++ b/arch/arm/mach-omap2/board-n800-flash.c @@ -28,7 +28,7 @@ static struct omap_onenand_platform_data n800_onenand_data = { .gpio_irq = 26, .parts = n800_partitions, .nr_parts = 0, /* filled later */ - .onenand_setup = n800_onenand_setup + .onenand_setup = n800_onenand_setup, }; static struct platform_device n800_onenand_device = { @@ -134,7 +134,7 @@ void __init n800_flash_init(void) int i = 0; while ((part = omap_get_nr_config(OMAP_TAG_PARTITION, - struct omap_partition_config, i)) != NULL) { + struct omap_partition_config, i)) != NULL) { struct mtd_partition *mpart; mpart = n800_partitions + i; diff --git a/arch/arm/mach-omap2/board-n800-mmc.c b/arch/arm/mach-omap2/board-n800-mmc.c index b20f1ad02a5..b0bdd97ea53 100644 --- a/arch/arm/mach-omap2/board-n800-mmc.c +++ b/arch/arm/mach-omap2/board-n800-mmc.c @@ -2,7 +2,7 @@ * linux/arch/arm/mach-omap2/board-n800-mmc.c * * Copyright (C) 2006 Nokia Corporation - * Author: Juha Yrj?l? + * Author: Juha Yrjola * * 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 @@ -31,7 +31,7 @@ static struct device *mmc_device; static int n800_mmc_switch_slot(struct device *dev, int slot) { #ifdef CONFIG_MMC_DEBUG - printk("Choose slot %d\n", slot + 1); + dev_dbg(dev, "Choose slot %d\n", slot + 1); #endif if (slot == 0) omap_set_gpio_dataout(slot_switch_gpio, 0); @@ -40,13 +40,14 @@ static int n800_mmc_switch_slot(struct device *dev, int slot) return 0; } -static int n800_mmc_set_power(struct device *dev, int slot, int power_on, int vdd) +static int n800_mmc_set_power(struct device *dev, int slot, int power_on, + int vdd) { int mV; #ifdef CONFIG_MMC_DEBUG - printk("Set slot %d power: %s (vdd %d)\n", slot + 1, - power_on ? "on" : "off", vdd); + dev_dbg(dev, "Set slot %d power: %s (vdd %d)\n", slot + 1, + power_on ? "on" : "off", vdd); #endif if (slot == 0) { if (!power_on) @@ -119,8 +120,8 @@ static int n800_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) int r; #ifdef CONFIG_MMC_DEBUG - printk("Set slot %d bus mode %s\n", slot + 1, - bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); + dev_dbg(dev, "Set slot %d bus mode %s\n", slot + 1, + bus_mode == MMC_BUSMODE_OPENDRAIN ? "open-drain" : "push-pull"); #endif BUG_ON(slot != 0 && slot != 1); slot++; @@ -135,7 +136,8 @@ static int n800_mmc_set_bus_mode(struct device *dev, int slot, int bus_mode) BUG(); } if (r != 0 && printk_ratelimit()) - printk(KERN_ERR "MMC: unable to set bus mode for slot %d\n", slot); + dev_err(dev, "MMC: unable to set bus mode for slot %d\n", + slot); return r; } @@ -150,7 +152,8 @@ static int n800_mmc_get_ro(struct device *dev, int slot) else ro = omap_get_gpio_datain(slot2_wp_gpio); #ifdef CONFIG_MMC_DEBUG - printk("Get RO slot %d: %s\n", slot, ro ? "read-only" : "read-write"); + dev_dbg(dev, "Get RO slot %d: %s\n", + slot, ro ? "read-only" : "read-write"); #endif return ro; } diff --git a/arch/arm/mach-omap2/board-n800-pm.c b/arch/arm/mach-omap2/board-n800-pm.c index fb2873e7ba3..33f3e4da3e4 100644 --- a/arch/arm/mach-omap2/board-n800-pm.c +++ b/arch/arm/mach-omap2/board-n800-pm.c @@ -27,7 +27,8 @@ static int n800_auto_sleep_regulators(void) ret = menelaus_set_regulator_sleep(1, val); if (ret < 0) { - printk(KERN_ERR "Could not set regulators to sleep on menelaus: %u\n", ret); + printk(KERN_ERR "Could not set regulators to sleep on " + "menelaus: %u\n", ret); return ret; } return 0; @@ -39,7 +40,8 @@ static int n800_auto_voltage_scale(void) ret = menelaus_set_vcore_hw(1400, 1050); if (ret < 0) { - printk(KERN_ERR "Could not set VCORE voltage on menelaus: %u\n", ret); + printk(KERN_ERR "Could not set VCORE voltage on " + "menelaus: %u\n", ret); return ret; } return 0; diff --git a/arch/arm/mach-omap2/board-n800-usb.c b/arch/arm/mach-omap2/board-n800-usb.c index f6cc15cb793..bfd606b5bbf 100644 --- a/arch/arm/mach-omap2/board-n800-usb.c +++ b/arch/arm/mach-omap2/board-n800-usb.c @@ -2,7 +2,7 @@ * linux/arch/arm/mach-omap2/board-n800-usb.c * * Copyright (C) 2006 Nokia Corporation - * Author: Juha Yrj?l? + * Author: Juha Yrjola * * 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 diff --git a/arch/arm/mach-omap2/board-n800.c b/arch/arm/mach-omap2/board-n800.c index bb805cf0152..73ff6236112 100644 --- a/arch/arm/mach-omap2/board-n800.c +++ b/arch/arm/mach-omap2/board-n800.c @@ -2,7 +2,7 @@ * linux/arch/arm/mach-omap2/board-n800.c * * Copyright (C) 2005 Nokia Corporation - * Author: Juha Yrj?l? + * Author: Juha Yrjola * * Modified from mach-omap2/board-generic.c * @@ -333,7 +333,7 @@ static void tsc2301_dev_init(void) int gpio = N800_KEYB_IRQ_GPIO; if (omap_request_gpio(gpio) < 0) { - printk("can't get KBIRQ GPIO\n"); + printk(KERN_ERR "can't get KBIRQ GPIO\n"); return; } omap_set_gpio_direction(gpio, 1); @@ -442,8 +442,6 @@ static inline void n800_ts_set_config(void) } #endif -extern void n800_mmc_slot1_cover_handler(void *arg, int state); - static struct omap_gpio_switch n800_gpio_switches[] __initdata = { { .name = "bat_cover", @@ -476,14 +474,6 @@ static struct platform_device *n800_devices[] __initdata = { #endif }; -extern void __init n800_flash_init(void); -extern void __init n800_mmc_init(void); -extern void __init n800_bt_init(void); -extern void __init n800_audio_init(struct tsc2301_platform_data *); -extern void __init n800_dsp_init(void); -extern void __init n800_usb_init(void); -extern void __init n800_pm_init(void); - static void __init nokia_n800_init(void) { platform_add_devices(n800_devices, ARRAY_SIZE(n800_devices)); diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index ef2c0673143..7c988adc63c 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -3,22 +3,16 @@ * * OMAP2 Power Management Routines * + * Copyright (C) 2005 Texas Instruments, Inc. * Copyright (C) 2006 Nokia Corporation - * Tony Lindgren * - * Fixed suspend-resume/dynamic-idle to get OMAP to retention + * Written by: + * Richard Woodruff + * Tony Lindgren + * Juha Yrjola * Amit Kucheria * Igor Stoppa * - * Fixed MPU sleep to get ARM idle - * Igor Stoppa - * - * Fixed MPU sleep some more - * Juha Yrjola - * - * Copyright (C) 2005 Texas Instruments, Inc. - * Richard Woodruff - * * Based on pm.c for omap1 * * This program is free software; you can redistribute it and/or modify @@ -440,8 +434,6 @@ static struct subsys_attribute sleep_while_idle_attr = { .store = omap_pm_sleep_while_idle_store, }; -extern struct subsystem power_subsys; - static struct clk *osc_ck, *emul_ck; #define CONTROL_DEVCONF __REG32(0x48000274) @@ -487,9 +479,6 @@ void omap2_allow_sleep(void) BUG_ON(i < 0); } -extern void omap2_gpio_prepare_for_retention(void); -extern void omap2_gpio_resume_after_retention(void); - static void omap2_enter_full_retention(void) { u32 sleep_time = 0; diff --git a/arch/arm/plat-omap/fb.c b/arch/arm/plat-omap/fb.c index 50824962604..4493bcff517 100644 --- a/arch/arm/plat-omap/fb.c +++ b/arch/arm/plat-omap/fb.c @@ -86,7 +86,8 @@ static int fbmem_region_reserved(unsigned long start, size_t size) return 0; } -/* Get the region_idx`th region from board config/ATAG and convert it to +/* + * Get the region_idx`th region from board config/ATAG and convert it to * our internal format. */ static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg) @@ -100,7 +101,8 @@ static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg) return -ENOENT; paddr = conf->start; - /* Low bits encode the page allocation mode, if high bits + /* + * Low bits encode the page allocation mode, if high bits * are zero. Otherwise we need a page aligned fixed * address. */ @@ -115,7 +117,8 @@ static int set_fbmem_region_type(struct omapfb_mem_region *rg, int mem_type, unsigned long mem_start, unsigned long mem_size) { - /* Check if the configuration specifies the type explicitly. + /* + * Check if the configuration specifies the type explicitly. * type = 0 && paddr = 0, a default don't care case maps to * the SDRAM type. */ @@ -150,7 +153,8 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg, /* Allocate this dynamically, leave paddr 0 for now. */ return 0; - /* Fixed region for the given RAM range. Check if it's already + /* + * Fixed region for the given RAM range. Check if it's already * reserved by the FB code or someone else. */ if (fbmem_region_reserved(paddr, size) || @@ -163,7 +167,8 @@ static int check_fbmem_region(int region_idx, struct omapfb_mem_region *rg, return 0; } -/* Called from map_io. We need to call to this early enough so that we +/* + * Called from map_io. We need to call to this early enough so that we * can reserve the fixed SDRAM regions before VM could get hold of them. */ void omapfb_reserve_sdram(void) @@ -213,7 +218,8 @@ void omapfb_reserve_sdram(void) reserved); } -/* Called at sram init time, before anything is pushed to the SRAM stack. +/* + * Called at sram init time, before anything is pushed to the SRAM stack. * Because of the stack scheme, we will allocate everything from the * start of the lowest address region to the end of SRAM. This will also * include padding for page alignment and possible holes between regions. @@ -271,13 +277,13 @@ unsigned long omapfb_reserve_sram(unsigned long sram_pstart, size_avail = (size_avail - rg.size) & PAGE_MASK; rg.paddr = pstart_avail + size_avail; } - /* Reserve everything above the start of the region. - */ + /* Reserve everything above the start of the region. */ if (pend_avail - rg.paddr > reserved) reserved = pend_avail - rg.paddr; size_avail = pend_avail - reserved - pstart_avail; - /* We have a kernel mapping for this already, so the + /* + * We have a kernel mapping for this already, so the * driver won't have to make one. */ rg.vaddr = (void *)(sram_vstart + rg.paddr - sram_pstart); diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 25ce5269626..bc46f33aede 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c @@ -57,7 +57,8 @@ extern unsigned long omapfb_reserve_sram(unsigned long sram_pstart, unsigned long pstart_avail, unsigned long size_avail); -/* Depending on the target RAMFS firewall setup, the public usable amount of +/* + * Depending on the target RAMFS firewall setup, the public usable amount of * SRAM varies. The default accessable size for all device types is 2k. A GP * device allows ARM11 but not other initators for full size. This * functionality seems ok until some nice security API happens. diff --git a/include/asm-arm/arch-omap/board-nokia.h b/include/asm-arm/arch-omap/board-nokia.h index 72deea20349..a1ee877f450 100644 --- a/include/asm-arm/arch-omap/board-nokia.h +++ b/include/asm-arm/arch-omap/board-nokia.h @@ -11,6 +11,17 @@ #include +extern void __init n800_flash_init(void); +extern void __init n800_mmc_init(void); +extern void __init n800_bt_init(void); +extern void __init n800_audio_init(struct tsc2301_platform_data *); +extern void __init n800_dsp_init(void); +extern void __init n800_usb_init(void); +extern void __init n800_pm_init(void); +extern int n800_audio_enable(struct dsp_kfunc_device *kdev, int stage); +extern int n800_audio_disable(struct dsp_kfunc_device *kdev, int stage); +extern void n800_mmc_slot1_cover_handler(void *arg, int state); + #define OMAP_TAG_NOKIA_BT 0x4e01 #define OMAP_TAG_WLAN_CX3110X 0x4e02 #define OMAP_TAG_CBUS 0x4e03 diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h index 590917efc94..c2ae7d867dd 100644 --- a/include/asm-arm/arch-omap/gpio.h +++ b/include/asm-arm/arch-omap/gpio.h @@ -75,6 +75,8 @@ extern void omap_free_gpio(int gpio); extern void omap_set_gpio_direction(int gpio, int is_input); extern void omap_set_gpio_dataout(int gpio, int enable); extern int omap_get_gpio_datain(int gpio); +extern void omap2_gpio_prepare_for_retention(void); +extern void omap2_gpio_resume_after_retention(void); /*-------------------------------------------------------------------------*/ diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h index 0fe920ac901..6a8e07ffc2d 100644 --- a/include/asm-arm/arch-omap/gpmc.h +++ b/include/asm-arm/arch-omap/gpmc.h @@ -82,6 +82,7 @@ struct gpmc_timings { extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns); extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns); +extern unsigned long gpmc_get_fclk_period(void); extern void gpmc_cs_write_reg(int cs, int idx, u32 val); extern u32 gpmc_cs_read_reg(int cs, int idx); diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h index 0b75e3389e5..34f971bf3bf 100644 --- a/include/asm-arm/arch-omap/pm.h +++ b/include/asm-arm/arch-omap/pm.h @@ -115,6 +115,8 @@ #include +extern struct subsystem power_subsys; + extern void prevent_idle_sleep(void); extern void allow_idle_sleep(void); -- 2.41.1