Skip to contentSkip to conversation

HID: i2c-hid: Fix test in i2c_hid_core_register_panel_follower()

PATCH Applied Dan Carpenter 4 participants 5 messages Aug 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: i2c-hid: Fix test in i2c_hid_core_register_panel_follower()

Bitwise AND was intended instead of OR. With the current code the condition is always true.

Fixes cbdd16b818ee ("HID: i2c-hid: Make elan touch controllers power on after panel is enabled")
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid-core.c +1 -1
index 99ce6386176c..30ebde1273be 100644
@@ -1189,7 +1189,7 @@ static int i2c_hid_core_register_panel_follower(struct i2c_hid *ihid)
 	struct device *dev = &ihid->client->dev;
 	int ret;
 
-	if (ihid->hid->initial_quirks | HID_QUIRK_POWER_ON_AFTER_BACKLIGHT)
+	if (ihid->hid->initial_quirks & HID_QUIRK_POWER_ON_AFTER_BACKLIGHT)
 		ihid->panel_follower.funcs = &i2c_hid_core_panel_follower_enable_funcs;
 	else
 		ihid->panel_follower.funcs = &i2c_hid_core_panel_follower_prepare_funcs;
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Dan,

Quoted 24 lines · Dan Carpenter

Bitwise AND was intended instead of OR. With the current code the condition is always true.

Fixes cbdd16b818ee ("HID: i2c-hid: Make elan touch controllers power on after panel is enabled")
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid-core.c +1 -2
index 99ce6386176c..30ebde1273be 100644
@@ -1189,7 +1189,7 @@ static int i2c_hid_core_register_panel_follower(struct i2c_hid *ihid)
        struct device *dev = &ihid->client->dev;
        int ret;
 
-       if (ihid->hid->initial_quirks | HID_QUIRK_POWER_ON_AFTER_BACKLIGHT)
+       if (ihid->hid->initial_quirks & HID_QUIRK_POWER_ON_AFTER_BACKLIGHT)
                ihid->panel_follower.funcs = &i2c_hid_core_panel_follower_enable_funcs;
        else
                ihid->panel_follower.funcs = &i2c_hid_core_panel_follower_prepare_funcs;
--
Quoted 2 lines

2.47.2

Thanks for catching this!

Regards,
Pin-yen

Reviewed-by on v1 1/1
#2 lore raw
In reply to Dan Carpenter

Hi,

Quoted 9 lines · Dan Carpenter

Bitwise AND was intended instead of OR. With the current code the condition is always true.

Fixes cbdd16b818ee ("HID: i2c-hid: Make elan touch controllers power on after panel is enabled")
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Jiri / Benjamin: if one of you can give this a quick Ack then I'll throw it into drm-misc-next with the patch it's fixing.

-Doug

maintainer Acked-by
#3 lore raw
Quoted 10 lines · Doug Anderson
Quoted 8 lines

Bitwise AND was intended instead of OR. With the current code the condition is always true.

Fixes cbdd16b818ee ("HID: i2c-hid: Make elan touch controllers power on after panel is enabled")
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This seems to be missing closing bracket :)

Quoted 2 lines

Jiri / Benjamin: if one of you can give this a quick Ack then I'll throw it into drm-misc-next with the patch it's fixing.

Thanks!

Signature · 2 lines
Jiri Kosina
SUSE Labs
#4 lore raw

Hi,

Quoted 12 lines · Jiri Kosina
Quoted 9 lines · Doug Anderson
Quoted 8 lines

Bitwise AND was intended instead of OR. With the current code the condition is always true.

Fixes cbdd16b818ee ("HID: i2c-hid: Make elan touch controllers power on after panel is enabled")
---
 drivers/hid/i2c-hid/i2c-hid-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines
Quoted 1 line

This seems to be missing closing bracket :)

Fixed. The tools would probably have caught it, but better to be safe. ...actually, "b4" fixed it for me. :-P

Quoted 4 lines
Quoted 2 lines

Jiri / Benjamin: if one of you can give this a quick Ack then I'll throw it into drm-misc-next with the patch it's fixing.

Pushed to drm-misc-next.

[1/1] HID: i2c-hid: Fix test in i2c_hid_core_register_panel_follower()

      commit: 5c76c794bf29399394ebacaa5af8436b8bed0d46