Skip to content

Commit

Permalink
rc: raw decoder for keymap protocol is not loaded on register
Browse files Browse the repository at this point in the history
commit 4138086 upstream.

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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Sean Young authored and Greg Kroah-Hartman committed Mar 18, 2017
1 parent 22fc2f9 commit 1cda290
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/media/rc/rc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@ int rc_register_device(struct rc_dev *dev)
int attr = 0;
int minor;
int rc;
u64 rc_type;

if (!dev || !dev->map_name)
return -EINVAL;
Expand Down Expand Up @@ -1526,14 +1527,18 @@ int rc_register_device(struct rc_dev *dev)
goto out_input;
}

rc_type = BIT_ULL(rc_map->rc_type);

if (dev->change_protocol) {
u64 rc_type = (1ll << rc_map->rc_type);
rc = dev->change_protocol(dev, &rc_type);
if (rc < 0)
goto out_raw;
dev->enabled_protocols = rc_type;
}

if (dev->driver_type == RC_DRIVER_IR_RAW)
ir_raw_load_modules(&rc_type);

/* Allow the RC sysfs nodes to be accessible */
atomic_set(&dev->initialized, 1);

Expand Down

0 comments on commit 1cda290

Please sign in to comment.