From 5bdebb183c9702a8c57a01dff09337be3de337a6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 11 Oct 2013 14:07:25 +1000 Subject: drm/sysfs: sort out minor and connector device object lifetimes. So drm was abusing device lifetimes, by having embedded device structures in the minor and connector it meant that the lifetime of the internal drm objects (drm_minor and drm_connector) were tied to the lifetime of the device files in sysfs, so if something kept those files opened the current code would kfree the objects and things would go downhill from there. Now in reality there is no need for these lifetimes to be so intertwined, especailly with hotplugging of devices where we wish to remove the sysfs and userspace facing pieces before we can unwind the internal objects due to open userspace files or mmaps, so split the objects out so the struct device is no longer embedded and do what fbdev does and just allocate and remove the sysfs inodes separately. Signed-off-by: Dave Airlie --- include/drm/drmP.h | 2 +- include/drm/drm_crtc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include/drm') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 2b954ad..7062307 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1046,7 +1046,7 @@ struct drm_minor { int index; /**< Minor device number */ int type; /**< Control or render */ dev_t device; /**< Device number for mknod */ - struct device kdev; /**< Linux device */ + struct device *kdev; /**< Linux device */ struct drm_device *dev; struct dentry *debugfs_root; diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index ba407f6..755dd25 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -595,7 +595,7 @@ enum drm_connector_force { */ struct drm_connector { struct drm_device *dev; - struct device kdev; + struct device *kdev; struct device_attribute *attr; struct list_head head; -- cgit v1.1