Skip to contentSkip to conversation

media: dvb-usb: do not clear the raw IR change_protocol

PATCH New Ho Jie Feng 1 participant 1 message Nov 23

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

PATCH 1/1 media: dvb-usb: do not clear the raw IR change_protocol

Since commit ec7cb49871e5 ("media: rc: Fix race condition during rc_register_device()"), rc_allocate_device() prepares raw IR handling, which sets dev->change_protocol for RC_DRIVER_IR_RAW devices.

dvb-usb and dvb-usb-v2 then overwrite dev->change_protocol with the callback from the device properties, which is NULL for raw IR devices such as rtl28xxu. Without it, rc-core enables no protocol decoder when the device is registered, so keys are no longer decoded.

Only set change_protocol when the device provides one.

Tested with a rtl28xxu device.

Fixes ec7cb49871e5 ("media: rc: Fix race condition during rc_register_device()")
---
 drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 3 ++-
 drivers/media/usb/dvb-usb/dvb-usb-remote.c  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +2 -1
index bd86d25043..218397cc68 100644
@@ -149,7 +149,8 @@ static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
 	dev->driver_name = d->props->driver_name;
 	dev->map_name = d->rc.map_name;
 	dev->allowed_protocols = d->rc.allowed_protos;
-	dev->change_protocol = d->rc.change_protocol;
+	if (d->rc.change_protocol)
+		dev->change_protocol = d->rc.change_protocol;
 	dev->timeout = d->rc.timeout;
 	dev->priv = d;
 
drivers/media/usb/dvb-usb/dvb-usb-remote.c +2 -1
index 6dc11718df..f5f30d714e 100644
@@ -277,7 +277,8 @@ static int rc_core_dvb_usb_remote_init(struct dvb_usb_device *d)
 
 	dev->driver_name = d->props.rc.core.module_name;
 	dev->map_name = d->props.rc.core.rc_codes;
-	dev->change_protocol = d->props.rc.core.change_protocol;
+	if (d->props.rc.core.change_protocol)
+		dev->change_protocol = d->props.rc.core.change_protocol;
 	dev->allowed_protocols = d->props.rc.core.allowed_protos;
 	usb_to_input_id(d->udev, &dev->input_id);
 	dev->device_name = d->desc->name;

base-commit: b7ac871daee981f1963f632586ff9b9d898ce5dd

Signature · 1 line
2.53.0