Skip to content

Commit

Permalink
V4L/DVB (10238): pvrusb2: Change sysfs serial number handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 13a8879 commit 730e92c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/media/video/pvrusb2/pvrusb2-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,16 +627,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;

Expand Down

0 comments on commit 730e92c

Please sign in to comment.