Re: [PATCH 05/17] ARM: pxa: remove sharpsl_fatal_check function

From: Eric Miao
Date: Sun Oct 07 2012 - 22:38:38 EST


On Wed, Oct 3, 2012 at 12:36 AM, Arnd Bergmann <arnd@xxxxxxxx> wrote:
> 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 <arnd@xxxxxxxx>
> Cc: Pavel Machek <pavel@xxxxxx>
> Cc: Stanislav Brabec <utx@xxxxxxxxxx>
> Cc: Eric Miao <eric.y.miao@xxxxxxxxx>
> Cc: Haojian Zhuang <haojian.zhuang@xxxxxxxxx>

Acked-by: Eric Miao <eric.y.miao@xxxxxxxxx>

Let's get it cleaned up firstly. One can always reference the history for a
sample implementation later if this is needed in the future.

> ---
> arch/arm/mach-pxa/sharpsl_pm.c | 48 ----------------------------------------
> 1 file changed, 48 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
> index bdf4cb8..6c9658f 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");
> --
> 1.7.10
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/