diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-05-08 03:38:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:28 -0400 |
commit | a65ff76ac8b24df49bbf4acc38918fb52d1033b0 (patch) | |
tree | 4bd323a77da9e709267d1712e4424a2db155aab9 /drivers/video/nvidia/nv_i2c.c | |
parent | 5b358fe12f03a7822db6f376b608f996c664a952 (diff) |
rivafb/nvidiafb: Various cleanups
Various cleanups to rivafb/nvidiafb's I2C code:
* Drop useless par->bus.
* Refactor I2C bus deletion code.
* Drop useless variable initialization.
* Remove unneeded include of <linux/i2c-id.h>.
* Simplify +1/-1.
* Add __devinit tags where possible.
[adaplas]
The varible initialization are not useless. However, rivafb must
check if i2c bus are created properly before reading the EDID
block.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/nvidia/nv_i2c.c')
-rw-r--r-- | drivers/video/nvidia/nv_i2c.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c index badc1a6c435..4fc7118397f 100644 --- a/drivers/video/nvidia/nv_i2c.c +++ b/drivers/video/nvidia/nv_i2c.c | |||
@@ -127,8 +127,6 @@ static int nvidia_setup_i2c_bus(struct nvidia_i2c_chan *chan, const char *name, | |||
127 | 127 | ||
128 | void nvidia_create_i2c_busses(struct nvidia_par *par) | 128 | void nvidia_create_i2c_busses(struct nvidia_par *par) |
129 | { | 129 | { |
130 | par->bus = 3; | ||
131 | |||
132 | par->chan[0].par = par; | 130 | par->chan[0].par = par; |
133 | par->chan[1].par = par; | 131 | par->chan[1].par = par; |
134 | par->chan[2].par = par; | 132 | par->chan[2].par = par; |
@@ -145,18 +143,14 @@ void nvidia_create_i2c_busses(struct nvidia_par *par) | |||
145 | 143 | ||
146 | void nvidia_delete_i2c_busses(struct nvidia_par *par) | 144 | void nvidia_delete_i2c_busses(struct nvidia_par *par) |
147 | { | 145 | { |
148 | if (par->chan[0].par) | 146 | int i; |
149 | i2c_del_adapter(&par->chan[0].adapter); | ||
150 | par->chan[0].par = NULL; | ||
151 | |||
152 | if (par->chan[1].par) | ||
153 | i2c_del_adapter(&par->chan[1].adapter); | ||
154 | par->chan[1].par = NULL; | ||
155 | |||
156 | if (par->chan[2].par) | ||
157 | i2c_del_adapter(&par->chan[2].adapter); | ||
158 | par->chan[2].par = NULL; | ||
159 | 147 | ||
148 | for (i = 0; i < 3; i++) { | ||
149 | if (!par->chan[i].par) | ||
150 | continue; | ||
151 | i2c_del_adapter(&par->chan[i].adapter); | ||
152 | par->chan[i].par = NULL; | ||
153 | } | ||
160 | } | 154 | } |
161 | 155 | ||
162 | int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) | 156 | int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) |