[PATCH v2 4/7] mips: loongson64: remove yeeloong_report_lid_status from pm.c
From: Yifeng Li
Date: Mon Mar 04 2019 - 17:29:23 EST
There is some complicated logic in lemote-2f/pm.c. During wakeup, it
creates a delayed_work to execute a callback to the function
yeeloong_report_lid_status(). It's only purpose is to report the current
status of the laptop lid switch, and this callback function wan not
implemented in the mainline kernel.
This level of overenginnering hardly makes sense. All we need is to report
the laptop lid switch unconditionally upon wakeup in the future PM code,
which is being worked on.
Signed-off-by: Yifeng Li <tomli@xxxxxxxx>
---
arch/mips/loongson64/lemote-2f/pm.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/arch/mips/loongson64/lemote-2f/pm.c b/arch/mips/loongson64/lemote-2f/pm.c
index 4ee7e9864700..ebe4b57535f0 100644
--- a/arch/mips/loongson64/lemote-2f/pm.c
+++ b/arch/mips/loongson64/lemote-2f/pm.c
@@ -80,17 +80,6 @@ void setup_wakeup_events(void)
}
}
-static struct delayed_work lid_task;
-static int initialized;
-/* yeeloong_report_lid_status will be implemented in yeeloong_laptop.c */
-sci_handler yeeloong_report_lid_status;
-EXPORT_SYMBOL(yeeloong_report_lid_status);
-static void yeeloong_lid_update_task(struct work_struct *work)
-{
- if (yeeloong_report_lid_status)
- yeeloong_report_lid_status(KB3310B_BIT_LID_DETECT_ON);
-}
-
int wakeup_loongson(void)
{
int irq;
@@ -119,17 +108,6 @@ int wakeup_loongson(void)
lid_status = kb3310b_read(KB3310B_REG_LID_DETECT);
/* wakeup cpu when people open the LID */
if (lid_status == KB3310B_BIT_LID_DETECT_ON) {
- /* If we call it directly here, the WARNING
- * will be sent out by getnstimeofday
- * via "WARN_ON(timekeeping_suspended);"
- * because we can not schedule in suspend mode.
- */
- if (initialized == 0) {
- INIT_DELAYED_WORK(&lid_task,
- yeeloong_lid_update_task);
- initialized = 1;
- }
- schedule_delayed_work(&lid_task, 1);
return 1;
}
}
--
2.20.1