]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
pktcdvd: remove broken dev_t export of class devices
authorKay Sievers <kay.sievers@vrfy.org>
Sat, 6 Dec 2008 03:38:11 +0000 (04:38 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Dec 2008 18:03:32 +0000 (10:03 -0800)
The pktcdvd created class devices only export some sysfs files,
but have no char dev_t registered in the driver.

At class device creation time they copy the dev_t value of the
block device to the char device, wich will register a new char
device in the driver core and userspace, with a conflicting dev_t
value.

In many cases the class devices dev_t just points to a random
USB device. This fixes the sysfs "duplicate entry" errors.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Peter Osterlund <petero2@telia.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/pktcdvd.c

index edda7b6b077b290695460e9e2ee92a0476fc197a..dc7a8c352da2e7c5b44a3d9a4e7a02bfd029d0c2 100644 (file)
@@ -302,7 +302,7 @@ static struct kobj_type kobj_pkt_type_wqueue = {
 static void pkt_sysfs_dev_new(struct pktcdvd_device *pd)
 {
        if (class_pktcdvd) {
-               pd->dev = device_create(class_pktcdvd, NULL, pd->pkt_dev, NULL,
+               pd->dev = device_create(class_pktcdvd, NULL, MKDEV(0, 0), NULL,
                                        "%s", pd->name);
                if (IS_ERR(pd->dev))
                        pd->dev = NULL;