aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-01-14 02:24:20 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:42:22 -0400
commit730e92c9acfab4f577c65c112a6d14ad9d3d02ba (patch)
treeba1c1a99512cd7fade7700cf773969e25a0589da /drivers/media/video/pvrusb2/pvrusb2-sysfs.c
parent13a887971b6c97751fce62ab803ee93a42a23c5d (diff)
V4L/DVB (10238): pvrusb2: Change sysfs serial number handling
Use the new pvrusb2 internal API to grab the device identifier, rather than generating it directly. This unifies some code and make possible use of that identifier in places other than sysfs. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-sysfs.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-sysfs.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index e641cd971453..e20ba1e6e0ea 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -627,16 +627,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp,
627 pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); 627 pvr2_sysfs_trace("Creating class_dev id=%p",class_dev);
628 628
629 class_dev->class = &class_ptr->class; 629 class_dev->class = &class_ptr->class;
630 if (pvr2_hdw_get_sn(sfp->channel.hdw)) { 630 dev_set_name(class_dev, "%s",
631 dev_set_name(class_dev, "sn-%lu", 631 pvr2_hdw_get_device_identifier(sfp->channel.hdw));
632 pvr2_hdw_get_sn(sfp->channel.hdw));
633 } else if (pvr2_hdw_get_unit_number(sfp->channel.hdw) >= 0) {
634 dev_set_name(class_dev, "unit-%c",
635 pvr2_hdw_get_unit_number(sfp->channel.hdw) + 'a');
636 } else {
637 kfree(class_dev);
638 return;
639 }
640 632
641 class_dev->parent = &usb_dev->dev; 633 class_dev->parent = &usb_dev->dev;
642 634