nvidiafb: Delete i2c bus on driver unload

Started by Antonino A. Daplas on Mar 20, 2005

Subsystems (2)

Maintainers (2)

DORMANTno replies

open the first message on its own page

Message details and related content
The driver nvidiafb fails to delete the i2c bus on load failure or
unload.  Fix

From: Antonino Daplas <redacted>
Signed-off-by: Antonino Daplas <redacted>
---

 nv_i2c.c   |    2 --
 nv_of.c    |    1 +
 nv_proto.h |    2 ++
 nvidia.c   |    6 ++++--
 4 files changed, 7 insertions(+), 4 deletions(-)

diff -Nru a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
--- a/drivers/video/nvidia/nv_i2c.c	2005-03-12 23:25:10 +08:00
+++ b/drivers/video/nvidia/nv_i2c.c	2005-03-18 21:06:28 +08:00
@@ -146,7 +146,6 @@
 	nvidia_setup_i2c_bus(&par->chan[2], "BUS3");
 }
 
-#if 0
 void nvidia_delete_i2c_busses(struct nvidia_par *par)
 {
 	if (par->chan[0].par)
@@ -162,7 +161,6 @@
 	par->chan[2].par = NULL;
 
 }
-#endif  /*  0  */
 
 static u8 *nvidia_do_probe_i2c_edid(struct nvidia_i2c_chan *chan)
 {
diff -Nru a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c
--- a/drivers/video/nvidia/nv_of.c	2005-03-12 23:25:11 +08:00
+++ b/drivers/video/nvidia/nv_of.c	2005-03-18 21:06:28 +08:00
@@ -28,6 +28,7 @@
 #include "nv_proto.h"
 
 void nvidia_create_i2c_busses(struct nvidia_par *par) {}
+void nvidia_delete_i2c_busses(struct nvidia_par *par) {}
 
 int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn, u8 **out_edid)
 {
diff -Nru a/drivers/video/nvidia/nv_proto.h b/drivers/video/nvidia/nv_proto.h
--- a/drivers/video/nvidia/nv_proto.h	2005-03-12 23:25:12 +08:00
+++ b/drivers/video/nvidia/nv_proto.h	2005-03-18 21:06:28 +08:00
@@ -33,10 +33,12 @@
 /* in nvidia-i2c.c */
 #if defined(CONFIG_FB_NVIDIA_I2C) || defined (CONFIG_PPC_OF)
 void nvidia_create_i2c_busses(struct nvidia_par *par);
+void nvidia_delete_i2c_busses(struct nvidia_par *par);
 int nvidia_probe_i2c_connector(struct nvidia_par *par, int conn,
 			       u8 ** out_edid);
 #else
 #define nvidia_create_i2c_busses(...)
+#define nvidia_delete_i2c_busses(...)
 #define nvidia_probe_i2c_connector(p, c, edid) \
 do {                                           \
 	*(edid) = NULL;                        \
diff -Nru a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
--- a/drivers/video/nvidia/nvidia.c	2005-03-15 18:42:12 +08:00
+++ b/drivers/video/nvidia/nvidia.c	2005-03-18 21:22:39 +08:00
@@ -1566,8 +1566,9 @@
 
       err_out_iounmap_fb:
 	iounmap(info->screen_base);
-      err_out_free_base1:
 	fb_destroy_modedb(info->monspecs.modedb);
+	nvidia_delete_i2c_busses(par);
+      err_out_free_base1:
 	iounmap(par->REGS);
       err_out_free_base0:
 	pci_release_regions(pd);
@@ -1597,9 +1598,10 @@
 			 info->fix.smem_len);
 #endif				/* CONFIG_MTRR */
 
+	iounmap(info->screen_base);
 	fb_destroy_modedb(info->monspecs.modedb);
+	nvidia_delete_i2c_busses(par);
 	iounmap(par->REGS);
-	iounmap(info->screen_base);
 	pci_release_regions(pd);
 	pci_disable_device(pd);
 	kfree(info->pixmap.addr);




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help