diff options
| author | Sage Weil <sage@inktank.com> | 2013-08-15 22:11:45 +0400 |
|---|---|---|
| committer | Sage Weil <sage@inktank.com> | 2013-08-15 22:11:45 +0400 |
| commit | ee3e542fec6e69bc9fb668698889a37d93950ddf (patch) | |
| tree | e74ee766a4764769ef1d3d45d266b4dea64101d3 /drivers/media/i2c/ov7640.c | |
| parent | fe2a801b50c0bb8039d627e5ae1fec249d10ff39 (diff) | |
| parent | f1d6e17f540af37bb1891480143669ba7636c4cf (diff) | |
| download | linux-ee3e542fec6e69bc9fb668698889a37d93950ddf.tar.xz | |
Merge remote-tracking branch 'linus/master' into testing
Diffstat (limited to 'drivers/media/i2c/ov7640.c')
| -rw-r--r-- | drivers/media/i2c/ov7640.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/i2c/ov7640.c b/drivers/media/i2c/ov7640.c index b0cc927e8b19..faa64baf09e8 100644 --- a/drivers/media/i2c/ov7640.c +++ b/drivers/media/i2c/ov7640.c @@ -20,7 +20,6 @@ #include <linux/i2c.h> #include <linux/videodev2.h> #include <media/v4l2-device.h> -#include <media/v4l2-chip-ident.h> #include <linux/slab.h> MODULE_DESCRIPTION("OmniVision ov7640 sensor driver"); @@ -59,7 +58,7 @@ static int ov7640_probe(struct i2c_client *client, if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -ENODEV; - sd = kzalloc(sizeof(struct v4l2_subdev), GFP_KERNEL); + sd = devm_kzalloc(&client->dev, sizeof(*sd), GFP_KERNEL); if (sd == NULL) return -ENOMEM; v4l2_i2c_subdev_init(sd, client, &ov7640_ops); @@ -71,7 +70,6 @@ static int ov7640_probe(struct i2c_client *client, if (write_regs(client, initial_registers) < 0) { v4l_err(client, "error initializing OV7640\n"); - kfree(sd); return -ENODEV; } @@ -84,7 +82,7 @@ static int ov7640_remove(struct i2c_client *client) struct v4l2_subdev *sd = i2c_get_clientdata(client); v4l2_device_unregister_subdev(sd); - kfree(sd); + return 0; } |
