Date:2012-09-20 06:18:46 (7 years 2 months ago)
Author:Marcos Paulo de Souza
Commit:dbd96db24fcda41be591140a08408466341222ba
Message:media/radio/radio-rda5807.c: Use devm_* when allocating memory

With this change, we can get ride of some kfrees and have less code.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Files: drivers/media/radio/radio-rda5807.c (3 diffs)

Change Details

drivers/media/radio/radio-rda5807.c
477477
478478    // TODO: Resetting the chip would be good.
479479
480    radio = kzalloc(sizeof(*radio), GFP_KERNEL);
480    radio = devm_kzalloc(&client->dev, sizeof(*radio), GFP_KERNEL);
481481    if (!radio) {
482482        dev_err(&client->dev, "Failed to allocate driver data\n");
483483        return -ENOMEM;
...... 
573573
574574/*err_radio_rel:*/
575575    video_device_release_empty(&radio->video_dev);
576    kfree(radio);
577576
578577    return err;
579578}
...... 
585584    video_unregister_device(&radio->video_dev);
586585    v4l2_ctrl_handler_free(&radio->ctrl_handler);
587586    video_device_release_empty(&radio->video_dev);
588    kfree(radio);
589587
590588    return 0;
591589}

Archive Download the corresponding diff file



interactive