summaryrefslogtreecommitdiffstats
path: root/drivers/video/nvidia
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-05-08 09:38:20 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 20:15:28 +0200
commita65ff76ac8b24df49bbf4acc38918fb52d1033b0 (patch)
tree4bd323a77da9e709267d1712e4424a2db155aab9 /drivers/video/nvidia
parentrivafb: handle I2C bus creation failure (diff)
downloadlinux-a65ff76ac8b24df49bbf4acc38918fb52d1033b0.tar.xz
linux-a65ff76ac8b24df49bbf4acc38918fb52d1033b0.zip
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')
-rw-r--r--drivers/video/nvidia/nv_i2c.c20
-rw-r--r--drivers/video/nvidia/nv_type.h2
2 files changed, 7 insertions, 15 deletions
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
index badc1a6c4357..4fc7118397fe 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,
void nvidia_create_i2c_busses(struct nvidia_par *par)
{
- par->bus = 3;
-
par->chan[0].par = par;
par->chan[1].par = par;
par->chan[2].par = par;
@@ -145,18 +143,14 @@ void nvidia_create_i2c_busses(struct nvidia_par *par)
void nvidia_delete_i2c_busses(struct nvidia_par *par)
{
- if (par->chan[0].par)
- i2c_del_adapter(&par->chan[0].adapter);
- par->chan[0].par = NULL;
-
- if (par->chan[1].par)
- i2c_del_adapter(&par->chan[1].adapter);
- par->chan[1].par = NULL;
-
- if (par->chan[2].par)
- i2c_del_adapter(&par->chan[2].adapter);
- par->chan[2].par = NULL;
+ int i;
+ for (i = 0; i < 3; i++) {
+ if (!par->chan[i].par)
+ continue;
+ i2c_del_adapter(&par->chan[i].adapter);
+ par->chan[i].par = NULL;
+ }
}
int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid)
diff --git a/drivers/video/nvidia/nv_type.h b/drivers/video/nvidia/nv_type.h
index 86e65dea60d3..ee430af89a0d 100644
--- a/drivers/video/nvidia/nv_type.h
+++ b/drivers/video/nvidia/nv_type.h
@@ -4,7 +4,6 @@
#include <linux/fb.h>
#include <linux/types.h>
#include <linux/i2c.h>
-#include <linux/i2c-id.h>
#include <linux/i2c-algo-bit.h>
#define NV_ARCH_04 0x04
@@ -100,7 +99,6 @@ struct nvidia_par {
u32 Architecture;
u32 CursorStart;
int Chipset;
- int bus;
unsigned long FbAddress;
u8 __iomem *FbStart;
u32 FbMapSize;