aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/radio/radio-si4713.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
index c54210c7fef9..5f366d16be26 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -268,7 +268,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev)
268 goto exit; 268 goto exit;
269 } 269 }
270 270
271 rsdev = kzalloc(sizeof *rsdev, GFP_KERNEL); 271 rsdev = devm_kzalloc(&pdev->dev, sizeof(*rsdev), GFP_KERNEL);
272 if (!rsdev) { 272 if (!rsdev) {
273 dev_err(&pdev->dev, "Failed to alloc video device.\n"); 273 dev_err(&pdev->dev, "Failed to alloc video device.\n");
274 rval = -ENOMEM; 274 rval = -ENOMEM;
@@ -278,7 +278,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev)
278 rval = v4l2_device_register(&pdev->dev, &rsdev->v4l2_dev); 278 rval = v4l2_device_register(&pdev->dev, &rsdev->v4l2_dev);
279 if (rval) { 279 if (rval) {
280 dev_err(&pdev->dev, "Failed to register v4l2 device.\n"); 280 dev_err(&pdev->dev, "Failed to register v4l2 device.\n");
281 goto free_rsdev; 281 goto exit;
282 } 282 }
283 283
284 adapter = i2c_get_adapter(pdata->i2c_bus); 284 adapter = i2c_get_adapter(pdata->i2c_bus);
@@ -322,8 +322,6 @@ put_adapter:
322 i2c_put_adapter(adapter); 322 i2c_put_adapter(adapter);
323unregister_v4l2_dev: 323unregister_v4l2_dev:
324 v4l2_device_unregister(&rsdev->v4l2_dev); 324 v4l2_device_unregister(&rsdev->v4l2_dev);
325free_rsdev:
326 kfree(rsdev);
327exit: 325exit:
328 return rval; 326 return rval;
329} 327}
@@ -342,7 +340,6 @@ static int __exit radio_si4713_pdriver_remove(struct platform_device *pdev)
342 video_unregister_device(rsdev->radio_dev); 340 video_unregister_device(rsdev->radio_dev);
343 i2c_put_adapter(client->adapter); 341 i2c_put_adapter(client->adapter);
344 v4l2_device_unregister(&rsdev->v4l2_dev); 342 v4l2_device_unregister(&rsdev->v4l2_dev);
345 kfree(rsdev);
346 343
347 return 0; 344 return 0;
348} 345}