The patch titled Subject: drivers/video/backlight/ot200_bl.c: use devm_ functions has been added to the -mm tree. Its filename is drivers-video-backlight-ot200_blc-use-devm_-functions.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jingoo Han <jg1.han@xxxxxxxxxxx> Subject: drivers/video/backlight/ot200_bl.c: use devm_ functions The devm_ functions allocate memory that is released when a driver detaches. This patch uses devm_kzalloc of these functions Signed-off-by: Jingoo Han <jg1.han@xxxxxxxxxxx> Cc: Christian Gmeiner <christian.gmeiner@xxxxxxxxx> Cc: Richard Purdie <rpurdie@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/video/backlight/ot200_bl.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff -puN drivers/video/backlight/ot200_bl.c~drivers-video-backlight-ot200_blc-use-devm_-functions drivers/video/backlight/ot200_bl.c --- a/drivers/video/backlight/ot200_bl.c~drivers-video-backlight-ot200_blc-use-devm_-functions +++ a/drivers/video/backlight/ot200_bl.c @@ -97,10 +97,10 @@ static int ot200_backlight_probe(struct goto error_mfgpt_alloc; } - data = kzalloc(sizeof(*data), GFP_KERNEL); + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); if (!data) { retval = -ENOMEM; - goto error_kzalloc; + goto error_devm_kzalloc; } /* setup gpio */ @@ -122,16 +122,14 @@ static int ot200_backlight_probe(struct if (IS_ERR(bl)) { dev_err(&pdev->dev, "failed to register backlight\n"); retval = PTR_ERR(bl); - goto error_backlight_device_register; + goto error_devm_kzalloc; } platform_set_drvdata(pdev, bl); return 0; -error_backlight_device_register: - kfree(data); -error_kzalloc: +error_devm_kzalloc: cs5535_mfgpt_free_timer(pwm_timer); error_mfgpt_alloc: gpio_free(GPIO_DIMM); @@ -141,7 +139,6 @@ error_mfgpt_alloc: static int ot200_backlight_remove(struct platform_device *pdev) { struct backlight_device *bl = platform_get_drvdata(pdev); - struct ot200_backlight_data *data = bl_get_data(bl); backlight_device_unregister(bl); @@ -154,7 +151,6 @@ static int ot200_backlight_remove(struct cs5535_mfgpt_free_timer(pwm_timer); gpio_free(GPIO_DIMM); - kfree(data); return 0; } _ Subject: Subject: drivers/video/backlight/ot200_bl.c: use devm_ functions Patches currently in -mm which might be from jg1.han@xxxxxxxxxxx are drivers-video-backlight-atmel-pwm-blc-use-devm_-functions.patch drivers-video-backlight-ot200_blc-use-devm_-functions.patch drivers-video-backlight-lm3533_blc-use-devm_-functions.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html