Skip to contentSkip to conversation

viafb: fix viafb_find_i2c_adapt return value

PATCH In review Dzianis Kahanovich 2 participants 3 messages Dec 20, 2010 – Jan 4, 2011 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 viafb: fix viafb_find_i2c_adapt return value

viafb_find_i2c_adapt return unverifyed value, "is_active" field still uplevel. Fix it.

---

drivers/video/via/via_i2c.c +1 -1
@@ -188,7 +188,7 @@ struct i2c_adapter *viafb_find_i2c_adapt
 {
 	struct via_i2c_stuff *stuff = &via_i2c_par[which];
 
-	return &stuff->adapter;
+	return stuff->is_active ? &stuff->adapter : NULL;
 }
 EXPORT_SYMBOL_GPL(viafb_find_i2c_adapter);
 

--

#1 lore raw

[cc'ed Jon; un-cc'ed Joseph as his email address is no longer valid]

Quoted 2 lines · Dzianis Kahanovich

viafb_find_i2c_adapt return unverifyed value, "is_active" field still uplevel. Fix it.

This patch looks useful to me but the viafb camera driver uses this function at the moment. It's not a big issue now as 31 will be always I2C but perhaps it might be a good idea to patch drivers/media/video/via-camera.c

Jon, do you agree that this patch is useful, at least as long we do not dynamically change the configuration?

Thanks,

Florian Tobias Schandinat

Quoted 17 lines

---

drivers/video/via/via_i2c.c +1 -2
@@ -188,7 +188,7 @@ struct i2c_adapter *viafb_find_i2c_adapt
 {
 	struct via_i2c_stuff *stuff = &via_i2c_par[which];
 
-	return &stuff->adapter;
+	return stuff->is_active ? &stuff->adapter : NULL;
 }
 EXPORT_SYMBOL_GPL(viafb_find_i2c_adapter);
 
--
#2 lore raw
In reply to Dzianis Kahanovich
Quoted 9 lines · Florian Tobias Schandinat

[cc'ed Jon; un-cc'ed Joseph as his email address is no longer valid]

Quoted 2 lines · Dzianis Kahanovich

viafb_find_i2c_adapt return unverifyed value, "is_active" field still uplevel. Fix it.

This patch looks useful to me but the viafb camera driver uses this function at the moment. It's not a big issue now as 31 will be always I2C but perhaps it might be a good idea to patch drivers/media/video/via-camera.c

Oops!

Quoted 29 lines

Jon, do you agree that this patch is useful, at least as long we do not dynamically change the configuration?

Thanks,

Florian Tobias Schandinat

Quoted 17 lines

---

drivers/video/via/via_i2c.c 2010-12-20 19:55:17.000000000 +0200 renamed from drivers/video/via/via_i2c.c 2010-12-18 06:42:37.000000000 +0200 +1 -1
@@ -188,7 +188,7 @@ struct i2c_adapter *viafb_find_i2c_adapt
 {
     struct via_i2c_stuff *stuff = &via_i2c_par[which];
 
-    return &stuff->adapter;
+    return stuff->is_active ? &stuff->adapter : NULL;
 }
 EXPORT_SYMBOL_GPL(viafb_find_i2c_adapter);
 
Signature · 1 line
WBR, Dzianis Kahanovich AKA Denis Kaganovich, http://mahatma.bspu.unibel.by/