mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: dvb-usb: do not clear the raw IR change_protocol
@ 2026-11-23  6:37 Ho Jie Feng
  0 siblings, 0 replies; only message in thread
From: Ho Jie Feng @ 2026-11-23  6:37 UTC (permalink / raw)
  To: linux-media, Sean Young
  Cc: Ho Jie Feng, stable, Ho Jie Feng, Mauro Carvalho Chehab, linux-kernel

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()")
Cc: stable@vger.kernel.org
Signed-off-by: Ho Jie Feng <hj3108@gmail.com>
---
 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(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index bd86d25043..218397cc68 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -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;
 
diff --git a/drivers/media/usb/dvb-usb/dvb-usb-remote.c b/drivers/media/usb/dvb-usb/dvb-usb-remote.c
index 6dc11718df..f5f30d714e 100644
--- a/drivers/media/usb/dvb-usb/dvb-usb-remote.c
+++ b/drivers/media/usb/dvb-usb/dvb-usb-remote.c
@@ -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
-- 
2.53.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  6:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  6:37 [PATCH] media: dvb-usb: do not clear the raw IR change_protocol Ho Jie Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®