Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213469
b: refs/heads/master
c: ead454f
h: refs/heads/master
i:
  213467: dacc793
v: v3
  • Loading branch information
Randy Dunlap authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent 5d5f9ff commit f15d6d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a868088ee48d1816c10f9be6d32aef4cf30bcf7
refs/heads/master: ead454feb6cbfe0fa6a1eeb30aa9abc338dacf62
6 changes: 6 additions & 0 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,14 @@ static struct kobject *get_device_parent(struct device *dev,
struct kobject *parent_kobj;
struct kobject *k;

#ifdef CONFIG_BLOCK
/* block disks show up in /sys/block */
if (sysfs_deprecated && dev->class == &block_class) {
if (parent && parent->class == &block_class)
return &parent->kobj;
return &block_class.p->class_subsys.kobj;
}
#endif

/*
* If we have no parent, we live in "virtual".
Expand Down Expand Up @@ -719,9 +721,11 @@ static int device_add_class_symlinks(struct device *dev)
goto out_subsys;
}

#ifdef CONFIG_BLOCK
/* /sys/block has directories and does not need symlinks */
if (sysfs_deprecated && dev->class == &block_class)
return 0;
#endif

/* link in the class directory pointing to the device */
error = sysfs_create_link(&dev->class->p->class_subsys.kobj,
Expand All @@ -748,8 +752,10 @@ static void device_remove_class_symlinks(struct device *dev)
if (dev->parent && device_is_not_partition(dev))
sysfs_remove_link(&dev->kobj, "device");
sysfs_remove_link(&dev->kobj, "subsystem");
#ifdef CONFIG_BLOCK
if (sysfs_deprecated && dev->class == &block_class)
return;
#endif
sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
}

Expand Down

0 comments on commit f15d6d3

Please sign in to comment.