aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorWei Yang <richardw.yang@linux.intel.com>2019-01-18 10:34:59 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-18 16:55:48 +0100
commit570d0200123fb4f809aa2f6226e93a458d664d70 (patch)
tree7da09bb196cd7cd3dcc845f9ed96466fa3a15eeb /drivers/base/core.c
parentsysfs: fix blank line coding style warning (diff)
downloadlinux-dev-570d0200123fb4f809aa2f6226e93a458d664d70.tar.xz
linux-dev-570d0200123fb4f809aa2f6226e93a458d664d70.zip
driver core: move device->knode_class to device_private
As the description of struct device_private says, it stores data which is private to driver core. And it already has similar fields like: knode_parent, knode_driver, knode_driver and knode_bus. This look it is more proper to put knode_class together with those fields to make it private to driver core. This patch move device->knode_class to device_private to make it comply with code convention. Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 0073b09bb99f..4a4b6f8cbc4f 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1966,7 +1966,7 @@ int device_add(struct device *dev)
if (dev->class) {
mutex_lock(&dev->class->p->mutex);
/* tie the class to the device */
- klist_add_tail(&dev->knode_class,
+ klist_add_tail(&dev->p->knode_class,
&dev->class->p->klist_devices);
/* notify any interfaces that the device is here */
@@ -2105,7 +2105,7 @@ void device_del(struct device *dev)
if (class_intf->remove_dev)
class_intf->remove_dev(dev, class_intf);
/* remove the device from the class list */
- klist_del(&dev->knode_class);
+ klist_del(&dev->p->knode_class);
mutex_unlock(&dev->class->p->mutex);
}
device_remove_file(dev, &dev_attr_uevent);