aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/hp_sdc.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2018-02-01 00:37:30 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2018-02-01 00:37:30 -0800
commitd67ad78e09cbb9935c74a40b85c5abe5b9cd48f8 (patch)
tree56e92b487de80090a998ff3c0469375982156802 /drivers/input/serio/hp_sdc.c
parentRevert "Input: synaptics_rmi4 - use devm_device_add_group() for attributes in F01" (diff)
parentInput: goodix - use generic touchscreen_properties (diff)
downloadlinux-dev-d67ad78e09cbb9935c74a40b85c5abe5b9cd48f8.tar.xz
linux-dev-d67ad78e09cbb9935c74a40b85c5abe5b9cd48f8.zip
Merge branch 'next' into for-linus
Prepare input updates for 4.16 merge window.
Diffstat (limited to 'drivers/input/serio/hp_sdc.c')
-rw-r--r--drivers/input/serio/hp_sdc.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index 1d7c7d81a5ef..0b8a25c58d02 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -193,7 +193,7 @@ static void hp_sdc_take(int irq, void *dev_id, uint8_t status, uint8_t data)
curr->seq[curr->idx++] = status;
curr->seq[curr->idx++] = data;
hp_sdc.rqty -= 2;
- do_gettimeofday(&hp_sdc.rtv);
+ hp_sdc.rtime = ktime_get();
if (hp_sdc.rqty <= 0) {
/* All data has been gathered. */
@@ -306,13 +306,10 @@ static void hp_sdc_tasklet(unsigned long foo)
write_lock_irq(&hp_sdc.rtq_lock);
if (hp_sdc.rcurr >= 0) {
- struct timeval tv;
+ ktime_t now = ktime_get();
- do_gettimeofday(&tv);
- if (tv.tv_sec > hp_sdc.rtv.tv_sec)
- tv.tv_usec += USEC_PER_SEC;
-
- if (tv.tv_usec - hp_sdc.rtv.tv_usec > HP_SDC_MAX_REG_DELAY) {
+ if (ktime_after(now, ktime_add_us(hp_sdc.rtime,
+ HP_SDC_MAX_REG_DELAY))) {
hp_sdc_transaction *curr;
uint8_t tmp;
@@ -321,8 +318,8 @@ static void hp_sdc_tasklet(unsigned long foo)
* we'll need to figure out a way to communicate
* it back to the application. and be less verbose.
*/
- printk(KERN_WARNING PREFIX "read timeout (%ius)!\n",
- (int)(tv.tv_usec - hp_sdc.rtv.tv_usec));
+ printk(KERN_WARNING PREFIX "read timeout (%lldus)!\n",
+ ktime_us_delta(now, hp_sdc.rtime));
curr->idx += hp_sdc.rqty;
hp_sdc.rqty = 0;
tmp = curr->seq[curr->actidx];
@@ -551,7 +548,7 @@ unsigned long hp_sdc_put(void)
/* Start a new read */
hp_sdc.rqty = curr->seq[curr->idx];
- do_gettimeofday(&hp_sdc.rtv);
+ hp_sdc.rtime = ktime_get();
curr->idx++;
/* Still need to lock here in case of spurious irq. */
write_lock_irq(&hp_sdc.rtq_lock);