Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] rc: raw decoder for keymap protocol is not loaded on register

When the protocol is set via the sysfs protocols attribute, the
decoder is loaded. However, when it is not when a device is first
plugged in or registered.

Fixes: acc1c3c ("[media] media: rc: load decoder modules on-demand")

Signed-off-by: Sean Young <sean@mess.org>
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Sean Young and committed by
Mauro Carvalho Chehab
41380868 c1305a40

+6 -2
+6 -2
drivers/media/rc/rc-main.c
··· 1663 1663 { 1664 1664 int rc; 1665 1665 struct rc_map *rc_map; 1666 + u64 rc_type; 1666 1667 1667 1668 if (!dev->map_name) 1668 1669 return -EINVAL; ··· 1678 1677 if (rc) 1679 1678 return rc; 1680 1679 1681 - if (dev->change_protocol) { 1682 - u64 rc_type = (1ll << rc_map->rc_type); 1680 + rc_type = BIT_ULL(rc_map->rc_type); 1683 1681 1682 + if (dev->change_protocol) { 1684 1683 rc = dev->change_protocol(dev, &rc_type); 1685 1684 if (rc < 0) 1686 1685 goto out_table; 1687 1686 dev->enabled_protocols = rc_type; 1688 1687 } 1688 + 1689 + if (dev->driver_type == RC_DRIVER_IR_RAW) 1690 + ir_raw_load_modules(&rc_type); 1689 1691 1690 1692 set_bit(EV_KEY, dev->input_dev->evbit); 1691 1693 set_bit(EV_REP, dev->input_dev->evbit);