aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/tuners/tuner-xc2028.c2
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c10
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h2
-rw-r--r--drivers/media/dvb/firewire/firedtv-1394.c4
-rw-r--r--drivers/media/dvb/firewire/firedtv-dvb.c2
-rw-r--r--drivers/media/video/dabusb.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-sysfs.c22
7 files changed, 32 insertions, 16 deletions
diff --git a/drivers/media/common/tuners/tuner-xc2028.c b/drivers/media/common/tuners/tuner-xc2028.c
index 1adce9ff52ce..7636c33bc1e9 100644
--- a/drivers/media/common/tuners/tuner-xc2028.c
+++ b/drivers/media/common/tuners/tuner-xc2028.c
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(audio_std,
48 "NICAM/A\n" 48 "NICAM/A\n"
49 "NICAM/B\n"); 49 "NICAM/B\n");
50 50
51static char firmware_name[FIRMWARE_NAME_MAX]; 51static char firmware_name[30];
52module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0); 52module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0);
53MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the " 53MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the "
54 "default firmware name\n"); 54 "default firmware name\n");
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index a454ee8f1e43..479dd05762a5 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -447,6 +447,15 @@ static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env)
447 return 0; 447 return 0;
448} 448}
449 449
450static char *dvb_nodename(struct device *dev)
451{
452 struct dvb_device *dvbdev = dev_get_drvdata(dev);
453
454 return kasprintf(GFP_KERNEL, "dvb/adapter%d/%s%d",
455 dvbdev->adapter->num, dnames[dvbdev->type], dvbdev->id);
456}
457
458
450static int __init init_dvbdev(void) 459static int __init init_dvbdev(void)
451{ 460{
452 int retval; 461 int retval;
@@ -469,6 +478,7 @@ static int __init init_dvbdev(void)
469 goto error; 478 goto error;
470 } 479 }
471 dvb_class->dev_uevent = dvb_uevent; 480 dvb_class->dev_uevent = dvb_uevent;
481 dvb_class->nodename = dvb_nodename;
472 return 0; 482 return 0;
473 483
474error: 484error:
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 2d5352e54dc0..b5157518a300 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -196,7 +196,7 @@ struct dvb_usb_device_properties {
196#define CYPRESS_FX2 3 196#define CYPRESS_FX2 3
197 int usb_ctrl; 197 int usb_ctrl;
198 int (*download_firmware) (struct usb_device *, const struct firmware *); 198 int (*download_firmware) (struct usb_device *, const struct firmware *);
199 const char firmware[FIRMWARE_NAME_MAX]; 199 const char *firmware;
200 int no_reconnect; 200 int no_reconnect;
201 201
202 int size_of_priv; 202 int size_of_priv;
diff --git a/drivers/media/dvb/firewire/firedtv-1394.c b/drivers/media/dvb/firewire/firedtv-1394.c
index 4e207658c5d9..2b6eeeab5b25 100644
--- a/drivers/media/dvb/firewire/firedtv-1394.c
+++ b/drivers/media/dvb/firewire/firedtv-1394.c
@@ -225,7 +225,7 @@ fail_free:
225 225
226static int node_remove(struct device *dev) 226static int node_remove(struct device *dev)
227{ 227{
228 struct firedtv *fdtv = dev->driver_data; 228 struct firedtv *fdtv = dev_get_drvdata(dev);
229 229
230 fdtv_dvb_unregister(fdtv); 230 fdtv_dvb_unregister(fdtv);
231 231
@@ -242,7 +242,7 @@ static int node_remove(struct device *dev)
242 242
243static int node_update(struct unit_directory *ud) 243static int node_update(struct unit_directory *ud)
244{ 244{
245 struct firedtv *fdtv = ud->device.driver_data; 245 struct firedtv *fdtv = dev_get_drvdata(&ud->device);
246 246
247 if (fdtv->isochannel >= 0) 247 if (fdtv->isochannel >= 0)
248 cmp_establish_pp_connection(fdtv, fdtv->subunit, 248 cmp_establish_pp_connection(fdtv, fdtv->subunit,
diff --git a/drivers/media/dvb/firewire/firedtv-dvb.c b/drivers/media/dvb/firewire/firedtv-dvb.c
index 9d308dd32a5c..5742fde79d99 100644
--- a/drivers/media/dvb/firewire/firedtv-dvb.c
+++ b/drivers/media/dvb/firewire/firedtv-dvb.c
@@ -268,7 +268,7 @@ struct firedtv *fdtv_alloc(struct device *dev,
268 if (!fdtv) 268 if (!fdtv)
269 return NULL; 269 return NULL;
270 270
271 dev->driver_data = fdtv; 271 dev_set_drvdata(dev, fdtv);
272 fdtv->device = dev; 272 fdtv->device = dev;
273 fdtv->isochannel = -1; 273 fdtv->isochannel = -1;
274 fdtv->voltage = 0xff; 274 fdtv->voltage = 0xff;
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c
index ba3709bec3f0..ec2f45dde164 100644
--- a/drivers/media/video/dabusb.c
+++ b/drivers/media/video/dabusb.c
@@ -747,8 +747,14 @@ static const struct file_operations dabusb_fops =
747 .release = dabusb_release, 747 .release = dabusb_release,
748}; 748};
749 749
750static char *dabusb_nodename(struct device *dev)
751{
752 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
753}
754
750static struct usb_class_driver dabusb_class = { 755static struct usb_class_driver dabusb_class = {
751 .name = "dabusb%d", 756 .name = "dabusb%d",
757 .nodename = dabusb_nodename,
752 .fops = &dabusb_fops, 758 .fops = &dabusb_fops,
753 .minor_base = DABUSB_MINOR, 759 .minor_base = DABUSB_MINOR,
754}; 760};
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index 299c1cbc3832..6c23456e0bda 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -539,7 +539,7 @@ static void class_dev_destroy(struct pvr2_sysfs *sfp)
539 &sfp->attr_unit_number); 539 &sfp->attr_unit_number);
540 } 540 }
541 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev); 541 pvr2_sysfs_trace("Destroying class_dev id=%p",sfp->class_dev);
542 sfp->class_dev->driver_data = NULL; 542 dev_set_drvdata(sfp->class_dev, NULL);
543 device_unregister(sfp->class_dev); 543 device_unregister(sfp->class_dev);
544 sfp->class_dev = NULL; 544 sfp->class_dev = NULL;
545} 545}
@@ -549,7 +549,7 @@ static ssize_t v4l_minor_number_show(struct device *class_dev,
549 struct device_attribute *attr, char *buf) 549 struct device_attribute *attr, char *buf)
550{ 550{
551 struct pvr2_sysfs *sfp; 551 struct pvr2_sysfs *sfp;
552 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 552 sfp = dev_get_drvdata(class_dev);
553 if (!sfp) return -EINVAL; 553 if (!sfp) return -EINVAL;
554 return scnprintf(buf,PAGE_SIZE,"%d\n", 554 return scnprintf(buf,PAGE_SIZE,"%d\n",
555 pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, 555 pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw,
@@ -561,7 +561,7 @@ static ssize_t bus_info_show(struct device *class_dev,
561 struct device_attribute *attr, char *buf) 561 struct device_attribute *attr, char *buf)
562{ 562{
563 struct pvr2_sysfs *sfp; 563 struct pvr2_sysfs *sfp;
564 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 564 sfp = dev_get_drvdata(class_dev);
565 if (!sfp) return -EINVAL; 565 if (!sfp) return -EINVAL;
566 return scnprintf(buf,PAGE_SIZE,"%s\n", 566 return scnprintf(buf,PAGE_SIZE,"%s\n",
567 pvr2_hdw_get_bus_info(sfp->channel.hdw)); 567 pvr2_hdw_get_bus_info(sfp->channel.hdw));
@@ -572,7 +572,7 @@ static ssize_t hdw_name_show(struct device *class_dev,
572 struct device_attribute *attr, char *buf) 572 struct device_attribute *attr, char *buf)
573{ 573{
574 struct pvr2_sysfs *sfp; 574 struct pvr2_sysfs *sfp;
575 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 575 sfp = dev_get_drvdata(class_dev);
576 if (!sfp) return -EINVAL; 576 if (!sfp) return -EINVAL;
577 return scnprintf(buf,PAGE_SIZE,"%s\n", 577 return scnprintf(buf,PAGE_SIZE,"%s\n",
578 pvr2_hdw_get_type(sfp->channel.hdw)); 578 pvr2_hdw_get_type(sfp->channel.hdw));
@@ -583,7 +583,7 @@ static ssize_t hdw_desc_show(struct device *class_dev,
583 struct device_attribute *attr, char *buf) 583 struct device_attribute *attr, char *buf)
584{ 584{
585 struct pvr2_sysfs *sfp; 585 struct pvr2_sysfs *sfp;
586 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 586 sfp = dev_get_drvdata(class_dev);
587 if (!sfp) return -EINVAL; 587 if (!sfp) return -EINVAL;
588 return scnprintf(buf,PAGE_SIZE,"%s\n", 588 return scnprintf(buf,PAGE_SIZE,"%s\n",
589 pvr2_hdw_get_desc(sfp->channel.hdw)); 589 pvr2_hdw_get_desc(sfp->channel.hdw));
@@ -595,7 +595,7 @@ static ssize_t v4l_radio_minor_number_show(struct device *class_dev,
595 char *buf) 595 char *buf)
596{ 596{
597 struct pvr2_sysfs *sfp; 597 struct pvr2_sysfs *sfp;
598 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 598 sfp = dev_get_drvdata(class_dev);
599 if (!sfp) return -EINVAL; 599 if (!sfp) return -EINVAL;
600 return scnprintf(buf,PAGE_SIZE,"%d\n", 600 return scnprintf(buf,PAGE_SIZE,"%d\n",
601 pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, 601 pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw,
@@ -607,7 +607,7 @@ static ssize_t unit_number_show(struct device *class_dev,
607 struct device_attribute *attr, char *buf) 607 struct device_attribute *attr, char *buf)
608{ 608{
609 struct pvr2_sysfs *sfp; 609 struct pvr2_sysfs *sfp;
610 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 610 sfp = dev_get_drvdata(class_dev);
611 if (!sfp) return -EINVAL; 611 if (!sfp) return -EINVAL;
612 return scnprintf(buf,PAGE_SIZE,"%d\n", 612 return scnprintf(buf,PAGE_SIZE,"%d\n",
613 pvr2_hdw_get_unit_number(sfp->channel.hdw)); 613 pvr2_hdw_get_unit_number(sfp->channel.hdw));
@@ -635,7 +635,7 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
635 class_dev->parent = &usb_dev->dev; 635 class_dev->parent = &usb_dev->dev;
636 636
637 sfp->class_dev = class_dev; 637 sfp->class_dev = class_dev;
638 class_dev->driver_data = sfp; 638 dev_set_drvdata(class_dev, sfp);
639 ret = device_register(class_dev); 639 ret = device_register(class_dev);
640 if (ret) { 640 if (ret) {
641 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 641 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
@@ -792,7 +792,7 @@ static ssize_t debuginfo_show(struct device *class_dev,
792 struct device_attribute *attr, char *buf) 792 struct device_attribute *attr, char *buf)
793{ 793{
794 struct pvr2_sysfs *sfp; 794 struct pvr2_sysfs *sfp;
795 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 795 sfp = dev_get_drvdata(class_dev);
796 if (!sfp) return -EINVAL; 796 if (!sfp) return -EINVAL;
797 pvr2_hdw_trigger_module_log(sfp->channel.hdw); 797 pvr2_hdw_trigger_module_log(sfp->channel.hdw);
798 return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE); 798 return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE);
@@ -803,7 +803,7 @@ static ssize_t debugcmd_show(struct device *class_dev,
803 struct device_attribute *attr, char *buf) 803 struct device_attribute *attr, char *buf)
804{ 804{
805 struct pvr2_sysfs *sfp; 805 struct pvr2_sysfs *sfp;
806 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 806 sfp = dev_get_drvdata(class_dev);
807 if (!sfp) return -EINVAL; 807 if (!sfp) return -EINVAL;
808 return pvr2_debugifc_print_status(sfp->channel.hdw,buf,PAGE_SIZE); 808 return pvr2_debugifc_print_status(sfp->channel.hdw,buf,PAGE_SIZE);
809} 809}
@@ -816,7 +816,7 @@ static ssize_t debugcmd_store(struct device *class_dev,
816 struct pvr2_sysfs *sfp; 816 struct pvr2_sysfs *sfp;
817 int ret; 817 int ret;
818 818
819 sfp = (struct pvr2_sysfs *)class_dev->driver_data; 819 sfp = dev_get_drvdata(class_dev);
820 if (!sfp) return -EINVAL; 820 if (!sfp) return -EINVAL;
821 821
822 ret = pvr2_debugifc_docmd(sfp->channel.hdw,buf,count); 822 ret = pvr2_debugifc_docmd(sfp->channel.hdw,buf,count);