diff mbox

davincifb driver fix

Message ID 1c12dfe70911011048r75273148gc53e2553a62d3f9d@mail.gmail.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Sameer Naik Nov. 1, 2009, 6:48 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/video/davincifb.c b/drivers/video/davincifb.c
index 1344be7..199c335 100644
--- a/drivers/video/davincifb.c
+++ b/drivers/video/davincifb.c
@@ -295,20 +295,26 @@  static irqreturn_t davincifb_isr(int irq, void *arg)
 	unsigned long addr=0;
 
 	if ((dispc_reg_in(VENC_VSTAT) & 0x00000010) == 0x10) {
-		xchg(&addr, dm->osd0->sdram_address);
-		if (addr) {
-			set_sdram_params(dm->osd0->info.fix.id,
-					 dm->osd0->sdram_address,
-					 dm->osd0->info.fix.line_length);
-			dm->osd0->sdram_address = 0;
+		if (dm->osd0)
+		{
+			xchg(&addr, dm->osd0->sdram_address);
+			if (addr) {
+				set_sdram_params(dm->osd0->info.fix.id,
+						dm->osd0->sdram_address,
+						dm->osd0->info.fix.line_length);
+				dm->osd0->sdram_address = 0;
+			}
 		}
-		addr = 0;
-		xchg(&addr, dm->osd1->sdram_address);
-		if (addr) {
-			set_sdram_params(dm->osd1->info.fix.id,
-					 dm->osd1->sdram_address,
-					 dm->osd1->info.fix.line_length);
-			dm->osd1->sdram_address = 0;
+		if (dm->osd1)
+		{
+			addr = 0;
+			xchg(&addr, dm->osd1->sdram_address);
+			if (addr) {
+				set_sdram_params(dm->osd1->info.fix.id,
+						dm->osd1->sdram_address,
+						dm->osd1->info.fix.line_length);
+				dm->osd1->sdram_address = 0;
+			}
 		}
 		addr = 0;
 		xchg(&addr, dm->vid0->sdram_address);
@@ -318,13 +324,16 @@  static irqreturn_t davincifb_isr(int irq, void *arg)
 					 dm->vid0->info.fix.line_length);
 			dm->vid0->sdram_address = 0;
 		}
-		addr = 0;
-		xchg(&addr, dm->vid1->sdram_address);
-		if (addr) {
-			set_sdram_params(dm->vid1->info.fix.id,
-					 dm->vid1->sdram_address,
-					 dm->vid1->info.fix.line_length);
-			dm->vid1->sdram_address = 0;
+		if (dm->vid1)
+		{
+			addr = 0;
+			xchg(&addr, dm->vid1->sdram_address);
+			if (addr) {
+				set_sdram_params(dm->vid1->info.fix.id,
+						dm->vid1->sdram_address,
+						dm->vid1->info.fix.line_length);
+				dm->vid1->sdram_address = 0;
+			}
 		}
 		return IRQ_HANDLED;
 	} else {