summaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/push-switch.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2017-11-28 17:12:32 +0100
committerTony Lindgren <tony@atomide.com>2017-11-28 17:12:32 +0100
commitbc686442f8a601bccac1f22506ecdb4b0d62cadd (patch)
treeb224ab4aa2350b233da640f5850f48bc6bfeb2d0 /arch/sh/drivers/push-switch.c
parentARM: dts: Add remote-wakeup-connected for omap OHCI (diff)
parentARM: dts: am437x-cm-t43: Correct the dmas property of spi0 (diff)
downloadlinux-bc686442f8a601bccac1f22506ecdb4b0d62cadd.tar.xz
linux-bc686442f8a601bccac1f22506ecdb4b0d62cadd.zip
Merge branch 'dts-fixes' into omap-for-v4.15/fixes-dt
Diffstat (limited to 'arch/sh/drivers/push-switch.c')
-rw-r--r--arch/sh/drivers/push-switch.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/sh/drivers/push-switch.c b/arch/sh/drivers/push-switch.c
index 5bfb341cc5c4..a17181160233 100644
--- a/arch/sh/drivers/push-switch.c
+++ b/arch/sh/drivers/push-switch.c
@@ -26,9 +26,9 @@ static ssize_t switch_show(struct device *dev,
}
static DEVICE_ATTR(switch, S_IRUGO, switch_show, NULL);
-static void switch_timer(unsigned long data)
+static void switch_timer(struct timer_list *t)
{
- struct push_switch *psw = (struct push_switch *)data;
+ struct push_switch *psw = from_timer(psw, t, debounce);
schedule_work(&psw->work);
}
@@ -78,10 +78,7 @@ static int switch_drv_probe(struct platform_device *pdev)
}
INIT_WORK(&psw->work, switch_work_handler);
- init_timer(&psw->debounce);
-
- psw->debounce.function = switch_timer;
- psw->debounce.data = (unsigned long)psw;
+ timer_setup(&psw->debounce, switch_timer, 0);
/* Workqueue API brain-damage */
psw->pdev = pdev;