In current code we register/unregister connector object by 
drm_sysfs_connector_add/remove function.
However under some cases, we need to dynamically register or unregister device 
multiple times, so we have to
go through register -> unregister ->register routine. Because after 
device_unregister function our memory is dirty,
we need to do clean operation in order to re-register the device, otherwise the 
system will crash. 
The patch intends to clean device after device release.

Signed-off-by: Ma Ling <ling...@intel.com>
---
 drivers/gpu/drm/drm_sysfs.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index bc0c684..022876a 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -132,6 +132,7 @@ void drm_sysfs_destroy(void)
  */
 static void drm_sysfs_device_release(struct device *dev)
 {
+       memset(dev, 0, sizeof(struct device));
        return;
 }
 
-- 
1.5.4.4




------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to