aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2011-09-21 03:16:24 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-10-03 11:52:05 -0400
commit261e767628bb5971b9032439818237cc8511ea94 (patch)
tree11dccee774a968ad9c11c9b178b0e4979eddb4ea
parent2b7a905dd0d24d14a1099653ba63b7113a82fc54 (diff)
smscufx: change edid data to u8 instead of char
Having "edid" as char caused a problem in ufx_read_edid() where we compared "edid[i] != 0xFF". Because of the type difference, the condition was never true and the error checking failed. Also I added a __user notation to silence a sparse complaint. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
-rw-r--r--drivers/video/smscufx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c
index 44c8cab31a01..aaccffac67ab 100644
--- a/drivers/video/smscufx.c
+++ b/drivers/video/smscufx.c
@@ -103,7 +103,7 @@ struct ufx_data {
103 struct delayed_work free_framebuffer_work; 103 struct delayed_work free_framebuffer_work;
104 atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */ 104 atomic_t usb_active; /* 0 = update virtual buffer, but no usb traffic */
105 atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */ 105 atomic_t lost_pixels; /* 1 = a render op failed. Need screen refresh */
106 char *edid; /* null until we read edid from hw or get from sysfs */ 106 u8 *edid; /* null until we read edid from hw or get from sysfs */
107 size_t edid_size; 107 size_t edid_size;
108 u32 pseudo_palette[256]; 108 u32 pseudo_palette[256];
109}; 109};
@@ -993,7 +993,7 @@ static int ufx_ops_ioctl(struct fb_info *info, unsigned int cmd,
993 993
994 /* TODO: Update X server to get this from sysfs instead */ 994 /* TODO: Update X server to get this from sysfs instead */
995 if (cmd == UFX_IOCTL_RETURN_EDID) { 995 if (cmd == UFX_IOCTL_RETURN_EDID) {
996 char *edid = (char *)arg; 996 u8 __user *edid = (u8 __user *)arg;
997 if (copy_to_user(edid, dev->edid, dev->edid_size)) 997 if (copy_to_user(edid, dev->edid, dev->edid_size))
998 return -EFAULT; 998 return -EFAULT;
999 return 0; 999 return 0;
@@ -1428,7 +1428,7 @@ static int ufx_i2c_wait_busy(struct ufx_data *dev)
1428} 1428}
1429 1429
1430/* reads a 128-byte EDID block from the currently selected port and TAR */ 1430/* reads a 128-byte EDID block from the currently selected port and TAR */
1431static int ufx_read_edid(struct ufx_data *dev, char *edid, int edid_len) 1431static int ufx_read_edid(struct ufx_data *dev, u8 *edid, int edid_len)
1432{ 1432{
1433 int i, j, status; 1433 int i, j, status;
1434 u32 *edid_u32 = (u32 *)edid; 1434 u32 *edid_u32 = (u32 *)edid;
@@ -1491,7 +1491,7 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info,
1491 char *default_edid, size_t default_edid_size) 1491 char *default_edid, size_t default_edid_size)
1492{ 1492{
1493 const struct fb_videomode *default_vmode = NULL; 1493 const struct fb_videomode *default_vmode = NULL;
1494 char *edid; 1494 u8 *edid;
1495 int i, result = 0, tries = 3; 1495 int i, result = 0, tries = 3;
1496 1496
1497 if (info->dev) /* only use mutex if info has been registered */ 1497 if (info->dev) /* only use mutex if info has been registered */