Skip to contentSkip to conversation

hid: hid-led: fix Delcom support on big endian systems

PATCH Applied Heiner Kallweit 2 participants 2 messages Jul 8, 2016 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hid: hid-led: fix Delcom support on big endian systems

Properly handle this __le16 value on big endian systems.

---
 drivers/hid/hid-led.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-led.c +1 -1
index 4c43ef8..d8d55f3 100644
@@ -327,7 +327,7 @@ static int delcom_init(struct hidled_device *ldev)
 	 * Several Delcom devices share the same USB VID/PID
 	 * Check for family id 2 for Visual Signal Indicator
 	 */
-	return dp.fw.family_code == 2 ? 0 : -ENODEV;
+	return le16_to_cpu(dp.fw.family_code) == 2 ? 0 : -ENODEV;
 }
 
 static int luxafor_write(struct led_classdev *cdev, enum led_brightness br)
Signature · 1 line
2.9.0
maintainer Applied
#1 lore raw
Quoted 12 lines · Heiner Kallweit

Properly handle this __le16 value on big endian systems.

---
 drivers/hid/hid-led.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-led.c +0 -0
index 4c43ef8..d8d55f3 100644

drivers/hid/hid-led.c static int delcom_init(struct hidled_device *ldev) · line 331

Quoted 6 lines
drivers/hid/hid-led.c +1 -1
@@ -327,7 +327,7 @@ static int delcom_init(struct hidled_device *ldev)
 	 * Several Delcom devices share the same USB VID/PID
 	 * Check for family id 2 for Visual Signal Indicator
 	 */
-	return dp.fw.family_code == 2 ? 0 : -ENODEV;
+	return le16_to_cpu(dp.fw.family_code) == 2 ? 0 : -ENODEV;
 }

Applied to for-4.8/hid-led. Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs