From 5f0cc6d16c0572bf5e9e65b6133ac415268c0720 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 30 Apr 2012 16:53:11 +0000 Subject: ARM: pxa: Wunused-result warning in viper board file Calling kstrtoul requires checking the result. In case of the viper_tpm_setup function, let's fail the __setup function if the number was invalid. Without this patch, building viper_defconfig results in: arch/arm/mach-pxa/viper.c: In function 'viper_tpm_setup': arch/arm/mach-pxa/viper.c:771:10: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Arnd Bergmann Acked-by: Marc Zyngier Cc: Haojian Zhuang Cc: Eric Miao --- arch/arm/mach-pxa/viper.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index 130379fb9d0f..ac733e91f3e4 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c @@ -768,8 +768,7 @@ static unsigned long viper_tpm; static int __init viper_tpm_setup(char *str) { - strict_strtoul(str, 10, &viper_tpm); - return 1; + return strict_strtoul(str, 10, &viper_tpm) >= 0; } __setup("tpm=", viper_tpm_setup); -- cgit v1.2.3 From 30bda0ebef512af996a079977488ea52a0ff1646 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 30 Apr 2012 16:05:28 +0000 Subject: ARM: pxa: define palmte2_pxa_keys conditionally Gcc prints a harmless warning about palmte2_pxa_keys not being used when the gpio keyboard driver is disabled. The solution is to use the same #ifdef that is already present in the place where the symbol is used. Without this patch, building palmz72_defconfig results in: /home/arnd/linux-arm/arch/arm/mach-pxa/palmte2.c:128:31: warning: 'palmte2_pxa_keys' defined but not used [-Wunused-variable] Signed-off-by: Arnd Bergmann Acked-by: Marek Vasut Cc: Carlos Eduardo Medaglia Dyonisio Cc: Haojian Zhuang Cc: Eric Miao --- arch/arm/mach-pxa/palmte2.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c index c054827c567f..8497b28825e5 100644 --- a/arch/arm/mach-pxa/palmte2.c +++ b/arch/arm/mach-pxa/palmte2.c @@ -105,6 +105,7 @@ static struct pxamci_platform_data palmte2_mci_platform_data = { .gpio_power = GPIO_NR_PALMTE2_SD_POWER, }; +#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) /****************************************************************************** * GPIO keys ******************************************************************************/ @@ -132,6 +133,7 @@ static struct platform_device palmte2_pxa_keys = { .platform_data = &palmte2_pxa_keys_data, }, }; +#endif /****************************************************************************** * Backlight -- cgit v1.2.3 From 066258f4293128bb489e42790637dd6d9b7ff206 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 30 Apr 2012 13:53:06 +0000 Subject: ARM: pxa: remove sharpsl_fatal_check function The sharpsl_fatal_check has not been used since Pavel Machek removed the caller in 99f329a2b "pxa/sharpsl_pm: zaurus c3000 aka spitz: fix resume". Nobody has complained since 2009, so it's safe to assume we can just remove the function. Without this patch, building corgi_defconfig results in: /home/arnd/linux-arm/arch/arm/mach-pxa/sharpsl_pm.c:693:12: warning: 'sharpsl_fatal_check' defined but not used [-Wunused-function] Signed-off-by: Arnd Bergmann Cc: Pavel Machek Cc: Stanislav Brabec Cc: Eric Miao Cc: Haojian Zhuang --- arch/arm/mach-pxa/sharpsl_pm.c | 48 ------------------------------------------ 1 file changed, 48 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index bdf4cb88ca0a..6c9658f4695a 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c @@ -55,7 +55,6 @@ #ifdef CONFIG_PM static int sharpsl_off_charge_battery(void); static int sharpsl_check_battery_voltage(void); -static int sharpsl_fatal_check(void); #endif static int sharpsl_check_battery_temp(void); static int sharpsl_ac_check(void); @@ -686,53 +685,6 @@ static int corgi_pxa_pm_enter(suspend_state_t state) return 0; } -/* - * Check for fatal battery errors - * Fatal returns -1 - */ -static int sharpsl_fatal_check(void) -{ - int buff[5], temp, i, acin; - - dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check entered\n"); - - /* Check AC-Adapter */ - acin = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); - - if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) { - sharpsl_pm.machinfo->charge(0); - udelay(100); - sharpsl_pm.machinfo->discharge(1); /* enable discharge */ - mdelay(SHARPSL_WAIT_DISCHARGE_ON); - } - - if (sharpsl_pm.machinfo->discharge1) - sharpsl_pm.machinfo->discharge1(1); - - /* Check battery : check inserting battery ? */ - for (i = 0; i < 5; i++) { - buff[i] = sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT); - mdelay(SHARPSL_CHECK_BATTERY_WAIT_TIME_VOLT); - } - - if (sharpsl_pm.machinfo->discharge1) - sharpsl_pm.machinfo->discharge1(0); - - if (acin && (sharpsl_pm.charge_mode == CHRG_ON)) { - udelay(100); - sharpsl_pm.machinfo->charge(1); - sharpsl_pm.machinfo->discharge(0); - } - - temp = get_select_val(buff); - dev_dbg(sharpsl_pm.dev, "sharpsl_fatal_check: acin: %d, discharge voltage: %d, no discharge: %ld\n", acin, temp, sharpsl_pm.machinfo->read_devdata(SHARPSL_BATT_VOLT)); - - if ((acin && (temp < sharpsl_pm.machinfo->fatal_acin_volt)) || - (!acin && (temp < sharpsl_pm.machinfo->fatal_noacin_volt))) - return -1; - return 0; -} - static int sharpsl_off_charge_error(void) { dev_err(sharpsl_pm.dev, "Offline Charger: Error occurred.\n"); -- cgit v1.2.3 From e0347c52384d494618299c64ad8ba68665044919 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 30 Apr 2012 13:34:49 +0000 Subject: ARM: pxa: work around duplicate definition of GPIO24_SSP1_SFRM The symbol "GPIO24_SSP1_SFRM" is defined in both mfp-pxa27x.h and mfp-pxa25x.h. Since the macro is not actually used in the cm-x2xx.c file, but it includes both headers, a safe workaround should be to just undefine it from the .c file. This is a bit hacky and the headers should be fixed to not both define it, but for now it gets us around an annoying warning. Without this patch, building cm_x2xx_defconfig results in: In file included from arch/arm/mach-pxa/include/mach-pxa/pxa27x.h:7:0, from arch/arm/mach-pxa/cm-x2xx.c:25: arch/arm/mach-pxa/include/mach-pxa/mfp-pxa27x.h:215:0: warning: "GPIO24_SSP1_SFRM" redefined [enabled by default] arch/arm/mach-pxa/include/mach-pxa/mfp-pxa25x.h:111:0: note: this is the location of the previous definition Signed-off-by: Arnd Bergmann Acked-by: Igor Grinberg Cc: Haojian Zhuang Cc: Mike Rapoport --- arch/arm/mach-pxa/cm-x2xx.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index 8fa4ad27edf3..ae5e74a34d5a 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c @@ -22,6 +22,7 @@ #include #include +#undef GPIO24_SSP1_SFRM #include #include #include -- cgit v1.2.3