diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2004-03-18 22:15:17 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-03-18 22:15:17 -0800 |
| commit | 667de9e824ae559dfb8e67f7cbe5be3ce807c4ad (patch) | |
| tree | e90bb9e7f6fada38d51cd42617fb8be534118a80 /drivers/base | |
| parent | 6746ea4db53794205cd21f56fa71c9e21057d13b (diff) | |
Driver class: remove possible oops
This happens when the device associated with a class device goes away before
the class does.
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/class.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index f6a96e931788..b9fdce488e2c 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -155,8 +155,7 @@ static int class_device_dev_link(struct class_device * class_dev) static void class_device_dev_unlink(struct class_device * class_dev) { - if (class_dev->dev) - sysfs_remove_link(&class_dev->kobj, "device"); + sysfs_remove_link(&class_dev->kobj, "device"); } static int class_device_driver_link(struct class_device * class_dev) @@ -169,8 +168,7 @@ static int class_device_driver_link(struct class_device * class_dev) static void class_device_driver_unlink(struct class_device * class_dev) { - if ((class_dev->dev) && (class_dev->dev->driver)) - sysfs_remove_link(&class_dev->kobj, "driver"); + sysfs_remove_link(&class_dev->kobj, "driver"); } |
