diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-14 01:24:20 -0600 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-01-14 01:24:20 -0600 |
commit | 9995056d221313e22ee2c551356bff630936896c (patch) | |
tree | 00578364cb78c3ebbd989e953e22b17893da18a7 /linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | |
parent | 3df4ed9fbae7f696ce17ae3d05102465596b7f57 (diff) | |
download | mediapointer-dvb-s2-9995056d221313e22ee2c551356bff630936896c.tar.gz mediapointer-dvb-s2-9995056d221313e22ee2c551356bff630936896c.tar.bz2 |
pvrusb2: Change sysfs serial number handling
From: Mike Isely <isely@pobox.com>
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.
Priority: normal
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index 770f31e60..84379d6e0 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -636,16 +636,8 @@ static void class_dev_create(struct pvr2_sysfs *sfp, pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); class_dev->class = &class_ptr->class; - if (pvr2_hdw_get_sn(sfp->channel.hdw)) { - dev_set_name(class_dev, "sn-%lu", - pvr2_hdw_get_sn(sfp->channel.hdw)); - } else if (pvr2_hdw_get_unit_number(sfp->channel.hdw) >= 0) { - dev_set_name(class_dev, "unit-%c", - pvr2_hdw_get_unit_number(sfp->channel.hdw) + 'a'); - } else { - kfree(class_dev); - return; - } + dev_set_name(class_dev, "%s", + pvr2_hdw_get_device_identifier(sfp->channel.hdw)); class_dev->parent = &usb_dev->dev; |