[media] media: i2c: Convert to devm_kzalloc()
[deliverable/linux.git] / drivers / media / i2c / sony-btf-mpx.c
index 38cbea98764c901924fdce080abb76569605b9d0..efa306165618021d8174b65fb93690178be5d783 100644 (file)
@@ -355,7 +355,7 @@ static int sony_btf_mpx_probe(struct i2c_client *client,
        v4l_info(client, "chip found @ 0x%x (%s)\n",
                        client->addr << 1, client->adapter->name);
 
-       t = kzalloc(sizeof(struct sony_btf_mpx), GFP_KERNEL);
+       t = devm_kzalloc(&client->dev, sizeof(*t), GFP_KERNEL);
        if (t == NULL)
                return -ENOMEM;
 
@@ -374,7 +374,6 @@ static int sony_btf_mpx_remove(struct i2c_client *client)
        struct v4l2_subdev *sd = i2c_get_clientdata(client);
 
        v4l2_device_unregister_subdev(sd);
-       kfree(to_state(sd));
 
        return 0;
 }
This page took 0.026803 seconds and 5 git commands to generate.