From patchwork Fri Aug 3 15:40:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Cassou X-Patchwork-Id: 1271561 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2B1ECDF25A for ; Fri, 3 Aug 2012 15:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753959Ab2HCPkg (ORCPT ); Fri, 3 Aug 2012 11:40:36 -0400 Received: from mail1-relais-roc.national.inria.fr ([192.134.164.82]:43437 "EHLO mail1-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753912Ab2HCPkc (ORCPT ); Fri, 3 Aug 2012 11:40:32 -0400 X-IronPort-AV: E=Sophos;i="4.77,706,1336341600"; d="scan'208";a="169023109" Received: from tytso.inria.fr (HELO localhost.localdomain) ([128.93.60.73]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Aug 2012 17:40:24 +0200 From: Damien Cassou To: David Brown Cc: kernel-janitors@vger.kernel.org, Daniel Walker , Bryan Huntsman , Florian Tobias Schandinat , linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] drivers/video/msm/mddi_client_dummy.c: use devm_ functions Date: Fri, 3 Aug 2012 17:40:14 +0200 Message-Id: <1344008414-2894-6-git-send-email-damien.cassou@lifl.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1344008414-2894-1-git-send-email-damien.cassou@lifl.fr> References: <1344008414-2894-1-git-send-email-damien.cassou@lifl.fr> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Damien Cassou The various devm_ functions allocate memory that is released when a driver detaches. This patch replaces the use of kzalloc by devm_kzalloc. Signed-off-by: Damien Cassou Acked-by: David Brown --- drivers/video/msm/mddi_client_dummy.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/msm/mddi_client_dummy.c b/drivers/video/msm/mddi_client_dummy.c index d2a091c..4c31325 100644 --- a/drivers/video/msm/mddi_client_dummy.c +++ b/drivers/video/msm/mddi_client_dummy.c @@ -51,7 +51,7 @@ static int mddi_dummy_probe(struct platform_device *pdev) { struct msm_mddi_client_data *client_data = pdev->dev.platform_data; struct panel_info *panel = - kzalloc(sizeof(struct panel_info), GFP_KERNEL); + devm_kzalloc(&pdev->dev, sizeof(struct panel_info), GFP_KERNEL); int ret; if (!panel) return -ENOMEM; @@ -67,18 +67,11 @@ static int mddi_dummy_probe(struct platform_device *pdev) client_data->fb_resource, 1); panel->panel_data.fb_data = client_data->private_client_data; panel->pdev.dev.platform_data = &panel->panel_data; - ret = platform_device_register(&panel->pdev); - if (ret) { - kfree(panel); - return ret; - } - return 0; + return platform_device_register(&panel->pdev); } static int mddi_dummy_remove(struct platform_device *pdev) { - struct panel_info *panel = platform_get_drvdata(pdev); - kfree(panel); return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in