X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fovcamchip%2Fovcamchip_core.c;h=3fe9fa04cd8419332d8e1ee1bf601e166a78b10a;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=54dd5612d3b823d2a4a761605078720cbdac51ba;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/media/video/ovcamchip/ovcamchip_core.c b/drivers/media/video/ovcamchip/ovcamchip_core.c index 54dd5612d..3fe9fa04c 100644 --- a/drivers/media/video/ovcamchip/ovcamchip_core.c +++ b/drivers/media/video/ovcamchip/ovcamchip_core.c @@ -266,17 +266,17 @@ static int ovcamchip_detect(struct i2c_client *c) PDEBUG(3, "Testing for 0V6xx0"); c->addr = OV6xx0_SID; if (init_camchip(c) < 0) { - return -ENODEV; + return -ENODEV; } else { if (ov6xx0_detect(c) < 0) { PERROR("Failed to init OV6xx0"); - return -EIO; + return -EIO; } } } else { if (ov7xx0_detect(c) < 0) { PERROR("Failed to init OV7xx0"); - return -EIO; + return -EIO; } } @@ -296,10 +296,10 @@ static int ovcamchip_attach(struct i2c_adapter *adap) * attach to adapters that are known to contain OV camera chips. */ switch (adap->id) { - case (I2C_ALGO_SMBUS | I2C_HW_SMBUS_OV511): - case (I2C_ALGO_SMBUS | I2C_HW_SMBUS_OV518): - case (I2C_ALGO_SMBUS | I2C_HW_SMBUS_OVFX2): - case (I2C_ALGO_SMBUS | I2C_HW_SMBUS_W9968CF): + case I2C_HW_SMBUS_OV511: + case I2C_HW_SMBUS_OV518: + case I2C_HW_SMBUS_OVFX2: + case I2C_HW_SMBUS_W9968CF: PDEBUG(1, "Adapter ID 0x%06x accepted", adap->id); break; default: @@ -314,21 +314,20 @@ static int ovcamchip_attach(struct i2c_adapter *adap) } memcpy(c, &client_template, sizeof *c); c->adapter = adap; - strcpy(i2c_clientname(c), "OV????"); + strcpy(c->name, "OV????"); - ov = kmalloc(sizeof *ov, GFP_KERNEL); + ov = kzalloc(sizeof *ov, GFP_KERNEL); if (!ov) { rc = -ENOMEM; goto no_ov; } - memset(ov, 0, sizeof *ov); i2c_set_clientdata(c, ov); rc = ovcamchip_detect(c); if (rc < 0) goto error; - strcpy(i2c_clientname(c), chip_names[ov->subtype]); + strcpy(c->name, chip_names[ov->subtype]); PDEBUG(1, "Camera chip detection complete"); @@ -410,18 +409,18 @@ static int ovcamchip_command(struct i2c_client *c, unsigned int cmd, void *arg) /* ----------------------------------------------------------------------- */ static struct i2c_driver driver = { - .owner = THIS_MODULE, - .name = "ovcamchip", + .driver = { + .name = "ovcamchip", + }, .id = I2C_DRIVERID_OVCAMCHIP, .class = I2C_CLASS_CAM_DIGITAL, - .flags = I2C_DF_NOTIFY, .attach_adapter = ovcamchip_attach, .detach_client = ovcamchip_detach, .command = ovcamchip_command, }; static struct i2c_client client_template = { - I2C_DEVNAME("(unset)"), + .name = "(unset)", .driver = &driver, };