From patchwork Wed Feb 13 14:07:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: archit taneja X-Patchwork-Id: 2136351 Return-Path: X-Original-To: patchwork-linux-omap@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 D338FDFE75 for ; Wed, 13 Feb 2013 14:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934051Ab3BMOIO (ORCPT ); Wed, 13 Feb 2013 09:08:14 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:39230 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933917Ab3BMOIM (ORCPT ); Wed, 13 Feb 2013 09:08:12 -0500 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r1DE8C2S009475; Wed, 13 Feb 2013 08:08:12 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1DE8Cda024111; Wed, 13 Feb 2013 08:08:12 -0600 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Wed, 13 Feb 2013 08:08:12 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r1DE8Cp8015989; Wed, 13 Feb 2013 08:08:12 -0600 Received: from localhost (a0393947pc.apr.dhcp.ti.com [172.24.137.46]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r1DE8AV15668; Wed, 13 Feb 2013 08:08:10 -0600 (CST) From: Archit Taneja To: CC: , , Archit Taneja Subject: [PATCH 06/11] OMAPDSS: Generic DPI Panel: use devm_kzalloc for allocating driver data Date: Wed, 13 Feb 2013 19:37:09 +0530 Message-ID: <1360764434-18788-7-git-send-email-archit@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360764434-18788-1-git-send-email-archit@ti.com> References: <1360764434-18788-1-git-send-email-archit@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use devm_kzalloc instead of kzalloc to allocate driver data for the generic dpi panel driver. This simplifies the driver's probe and remove functions. Signed-off-by: Archit Taneja --- drivers/video/omap2/displays/panel-generic-dpi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c index 54ca8ae..6cb2fe0 100644 --- a/drivers/video/omap2/displays/panel-generic-dpi.c +++ b/drivers/video/omap2/displays/panel-generic-dpi.c @@ -632,7 +632,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev) dssdev->panel.timings = panel_config->timings; - drv_data = kzalloc(sizeof(*drv_data), GFP_KERNEL); + drv_data = devm_kzalloc(&dssdev->dev, sizeof(*drv_data), GFP_KERNEL); if (!drv_data) return -ENOMEM; @@ -648,12 +648,8 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev) static void __exit generic_dpi_panel_remove(struct omap_dss_device *dssdev) { - struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev); - dev_dbg(&dssdev->dev, "remove\n"); - kfree(drv_data); - dev_set_drvdata(&dssdev->dev, NULL); }