Merge tag 'tag-chrome-platform-for-v5.4' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / drivers / input / keyboard / cros_ec_keyb.c
index a29e81fdf1861aa02a1509a186b145502cdf9bb5..8d4d9786cc745db87143202256f8762cd663c863 100644 (file)
@@ -226,6 +226,8 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
 {
        struct cros_ec_keyb *ckdev = container_of(nb, struct cros_ec_keyb,
                                                  notifier);
+       uint8_t mkbp_event_type = ckdev->ec->event_data.event_type &
+                                 EC_MKBP_EVENT_TYPE_MASK;
        u32 val;
        unsigned int ev_type;
 
@@ -237,7 +239,7 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
        if (queued_during_suspend && !device_may_wakeup(ckdev->dev))
                return NOTIFY_OK;
 
-       switch (ckdev->ec->event_data.event_type & EC_MKBP_EVENT_TYPE_MASK) {
+       switch (mkbp_event_type) {
        case EC_MKBP_EVENT_KEY_MATRIX:
                pm_wakeup_event(ckdev->dev, 0);
 
@@ -264,7 +266,7 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
        case EC_MKBP_EVENT_SWITCH:
                pm_wakeup_event(ckdev->dev, 0);
 
-               if (ckdev->ec->event_data.event_type == EC_MKBP_EVENT_BUTTON) {
+               if (mkbp_event_type == EC_MKBP_EVENT_BUTTON) {
                        val = get_unaligned_le32(
                                        &ckdev->ec->event_data.data.buttons);
                        ev_type = EV_KEY;