diff -urN a/drivers/media/video/upd64083.c b/drivers/media/video/upd64083.c --- a/drivers/media/video/upd64083.c 2008-07-14 06:51:29.000000000 +0900 +++ b/drivers/media/video/upd64083.c 2008-07-16 20:54:05.702773275 +0900 @@ -51,9 +51,9 @@ }; struct upd64083_state { + u8 regs[TOT_REGS]; u8 mode; u8 ext_y_adc; - u8 regs[TOT_REGS]; }; /* Initial values when used in combination with the @@ -178,20 +178,19 @@ struct upd64083_state *state; int i; - if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -EIO; - v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); - state = kmalloc(sizeof(struct upd64083_state), GFP_KERNEL); + state = kzalloc(sizeof(struct upd64083_state), GFP_KERNEL); // Fix 20080716 if (state == NULL) return -ENOMEM; i2c_set_clientdata(client, state); /* Initially assume that a ghost reduction chip is present */ state->mode = 0; /* YCS mode */ state->ext_y_adc = (1 << 5); - memcpy(state->regs, upd64083_init, TOT_REGS); + memcpy(state->regs, upd64083_init, sizeof(state->regs)); // Fix 20080716 for (i = 0; i < TOT_REGS; i++) upd64083_write(client, i, state->regs[i]); return 0; @@ -217,5 +216,6 @@ .command = upd64083_command, .probe = upd64083_probe, .remove = upd64083_remove, + .legacy_class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL , // Add 20080716 .id_table = upd64083_id, };