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

[media] rc: protocol is not set on register for raw IR devices

ir_raw_event_register() sets up change_protocol(), and without that set,
rc_setup_rx_device() does not set the protocol for the device on register.

The standard udev rules run ir-keytable, which writes to the protocols
file again, which hides this problem.

Fixes: 7ff2c2b ("[media] rc-main: split setup and unregister functions")

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Sean Young and committed by
Mauro Carvalho Chehab
5df62771 41380868

+9 -9
+9 -9
drivers/media/rc/rc-main.c
··· 1781 1781 dev->input_name ?: "Unspecified device", path ?: "N/A"); 1782 1782 kfree(path); 1783 1783 1784 - if (dev->driver_type != RC_DRIVER_IR_RAW_TX) { 1785 - rc = rc_setup_rx_device(dev); 1786 - if (rc) 1787 - goto out_dev; 1788 - } 1789 - 1790 1784 if (dev->driver_type == RC_DRIVER_IR_RAW || 1791 1785 dev->driver_type == RC_DRIVER_IR_RAW_TX) { 1792 1786 if (!raw_init) { ··· 1789 1795 } 1790 1796 rc = ir_raw_event_register(dev); 1791 1797 if (rc < 0) 1792 - goto out_rx; 1798 + goto out_dev; 1799 + } 1800 + 1801 + if (dev->driver_type != RC_DRIVER_IR_RAW_TX) { 1802 + rc = rc_setup_rx_device(dev); 1803 + if (rc) 1804 + goto out_raw; 1793 1805 } 1794 1806 1795 1807 /* Allow the RC sysfs nodes to be accessible */ ··· 1807 1807 1808 1808 return 0; 1809 1809 1810 - out_rx: 1811 - rc_free_rx_device(dev); 1810 + out_raw: 1811 + ir_raw_event_unregister(dev); 1812 1812 out_dev: 1813 1813 device_del(&dev->dev); 1814 1814 out_unlock: