diff options
-rw-r--r-- | drivers/video/fb_ddc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/fb_ddc.c b/drivers/video/fb_ddc.c index 3aa6ebf68f17..f836137a0eda 100644 --- a/drivers/video/fb_ddc.c +++ b/drivers/video/fb_ddc.c | |||
@@ -20,26 +20,26 @@ | |||
20 | static unsigned char *fb_do_probe_ddc_edid(struct i2c_adapter *adapter) | 20 | static unsigned char *fb_do_probe_ddc_edid(struct i2c_adapter *adapter) |
21 | { | 21 | { |
22 | unsigned char start = 0x0; | 22 | unsigned char start = 0x0; |
23 | unsigned char *buf = kmalloc(EDID_LENGTH, GFP_KERNEL); | ||
23 | struct i2c_msg msgs[] = { | 24 | struct i2c_msg msgs[] = { |
24 | { | 25 | { |
25 | .addr = DDC_ADDR, | 26 | .addr = DDC_ADDR, |
27 | .flags = 0, | ||
26 | .len = 1, | 28 | .len = 1, |
27 | .buf = &start, | 29 | .buf = &start, |
28 | }, { | 30 | }, { |
29 | .addr = DDC_ADDR, | 31 | .addr = DDC_ADDR, |
30 | .flags = I2C_M_RD, | 32 | .flags = I2C_M_RD, |
31 | .len = EDID_LENGTH, | 33 | .len = EDID_LENGTH, |
34 | .buf = buf, | ||
32 | } | 35 | } |
33 | }; | 36 | }; |
34 | unsigned char *buf; | ||
35 | 37 | ||
36 | buf = kmalloc(EDID_LENGTH, GFP_KERNEL); | ||
37 | if (!buf) { | 38 | if (!buf) { |
38 | dev_warn(&adapter->dev, "unable to allocate memory for EDID " | 39 | dev_warn(&adapter->dev, "unable to allocate memory for EDID " |
39 | "block.\n"); | 40 | "block.\n"); |
40 | return NULL; | 41 | return NULL; |
41 | } | 42 | } |
42 | msgs[1].buf = buf; | ||
43 | 43 | ||
44 | if (i2c_transfer(adapter, msgs, 2) == 2) | 44 | if (i2c_transfer(adapter, msgs, 2) == 2) |
45 | return buf; | 45 | return buf; |