summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-07-05 19:57:07 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-04 07:56:39 -0300
commitde73beeed032f93f0106992c075357be5b1f2fab (patch)
tree52112ac9dd232a7ca88a85684d5ed0f69b78905e
parent5674ca257c6b1553005d5a9d9b8f514c53591203 (diff)
downloadlinux-de73beeed032f93f0106992c075357be5b1f2fab.tar.gz
linux-de73beeed032f93f0106992c075357be5b1f2fab.tar.bz2
linux-de73beeed032f93f0106992c075357be5b1f2fab.zip
[media] dvb_usb_v2: register device even no remote keymap defined
It failed to register device when remote keymap was not set. Fix it to register device even keymap is NULL. In that case just skip remote registration. Driver should set RC_MAP_EMPTY to enable remote in case of there is remote receiver but default keymap is unknown. Reported-by: pierigno <pierigno@gmail.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/dvb-usb/af9015.c4
-rw-r--r--drivers/media/dvb/dvb-usb/af9035.c4
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb.h2
-rw-r--r--drivers/media/dvb/dvb-usb/dvb_usb_core.c10
4 files changed, 15 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
index e48cb586f4cf..bbe1d3382195 100644
--- a/drivers/media/dvb/dvb-usb/af9015.c
+++ b/drivers/media/dvb/dvb-usb/af9015.c
@@ -1276,6 +1276,10 @@ static int af9015_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc)
}
}
+ /* load empty to enable rc */
+ if (!rc->map_name)
+ rc->map_name = RC_MAP_EMPTY;
+
rc->allowed_protos = RC_TYPE_NEC;
rc->query = af9015_rc_query;
rc->interval = 500;
diff --git a/drivers/media/dvb/dvb-usb/af9035.c b/drivers/media/dvb/dvb-usb/af9035.c
index 82b1ac716c2f..79197f46aa95 100644
--- a/drivers/media/dvb/dvb-usb/af9035.c
+++ b/drivers/media/dvb/dvb-usb/af9035.c
@@ -966,6 +966,10 @@ static int af9035_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc)
rc->query = af9035_rc_query;
rc->interval = 500;
+
+ /* load empty to enable rc */
+ if (!rc->map_name)
+ rc->map_name = RC_MAP_EMPTY;
}
return 0;
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb.h b/drivers/media/dvb/dvb-usb/dvb_usb.h
index 6fcab07ecada..773817b5fe06 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb_usb.h
@@ -124,7 +124,7 @@ struct dvb_usb_driver_info {
* @bulk_mode: device supports bulk mode for rc (disable polling mode)
*/
struct dvb_usb_rc {
- char *map_name;
+ const char *map_name;
u64 allowed_protos;
int (*change_protocol)(struct rc_dev *dev, u64 rc_type);
int (*query) (struct dvb_usb_device *d);
diff --git a/drivers/media/dvb/dvb-usb/dvb_usb_core.c b/drivers/media/dvb/dvb-usb/dvb_usb_core.c
index aed7463167bc..3224621e1f32 100644
--- a/drivers/media/dvb/dvb-usb/dvb_usb_core.c
+++ b/drivers/media/dvb/dvb-usb/dvb_usb_core.c
@@ -135,10 +135,15 @@ static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
if (dvb_usbv2_disable_rc_polling || !d->props->get_rc_config)
return 0;
+ d->rc.map_name = d->rc_map;
ret = d->props->get_rc_config(d, &d->rc);
if (ret < 0)
goto err;
+ /* disable rc when there is no keymap defined */
+ if (!d->rc.map_name)
+ return 0;
+
dev = rc_allocate_device();
if (!dev) {
ret = -ENOMEM;
@@ -153,14 +158,11 @@ static int dvb_usbv2_remote_init(struct dvb_usb_device *d)
usb_to_input_id(d->udev, &dev->input_id);
/* TODO: likely RC-core should took const char * */
dev->driver_name = (char *) d->props->driver_name;
+ dev->map_name = d->rc.map_name;
dev->driver_type = d->rc.driver_type;
dev->allowed_protos = d->rc.allowed_protos;
dev->change_protocol = d->rc.change_protocol;
dev->priv = d;
- if (d->rc.map_name)
- dev->map_name = d->rc.map_name;
- else
- dev->map_name = d->rc_map;
ret = rc_register_device(dev);
if (ret < 0) {