From patchwork Sat Mar 23 11:00:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vishwanathrao Badarkhe, Manish" X-Patchwork-Id: 2324441 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 52A8D3FC8A for ; Sat, 23 Mar 2013 11:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751545Ab3CWLA0 (ORCPT ); Sat, 23 Mar 2013 07:00:26 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:37072 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244Ab3CWLA0 (ORCPT ); Sat, 23 Mar 2013 07:00:26 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2NAxodg020597; Sat, 23 Mar 2013 05:59:50 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2NAxibT009338; Sat, 23 Mar 2013 16:29:45 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Sat, 23 Mar 2013 16:29:44 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id r2NAxdL9010131; Sat, 23 Mar 2013 16:29:39 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id BBE97158003; Sat, 23 Mar 2013 16:29:38 +0530 (IST) Received: from ubuntu-psp-linux.india.ext.ti.com (ubuntu-psp-linux [192.168.247.46]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r2NAxYR01214; Sat, 23 Mar 2013 16:29:35 +0530 (IST) From: "Vishwanathrao Badarkhe, Manish" To: , , CC: , , , , , Subject: [PATCH] tps6507x-ts: update to devm_* API Date: Sat, 23 Mar 2013 16:30:23 +0530 Message-ID: <1364036423-2057-1-git-send-email-manishv.b@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Update the code to use devm_* API so that driver core will manage resources. Signed-off-by: Vishwanathrao Badarkhe, Manish --- :100644 100644 820a066... 65e0f9a... M drivers/input/touchscreen/tps6507x-ts.c drivers/input/touchscreen/tps6507x-ts.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index 820a066..65e0f9a 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c @@ -261,7 +261,7 @@ static int tps6507x_ts_probe(struct platform_device *pdev) init_data = tps_board->tps6507x_ts_init_data; - tsc = kzalloc(sizeof(struct tps6507x_ts), GFP_KERNEL); + tsc = devm_kzalloc(&pdev->dev, sizeof(struct tps6507x_ts), GFP_KERNEL); if (!tsc) { dev_err(tps6507x_dev->dev, "failed to allocate driver data\n"); error = -ENOMEM; @@ -339,7 +339,6 @@ err2: cancel_delayed_work_sync(&tsc->work); input_free_device(input_dev); err1: - kfree(tsc); tps6507x_dev->ts = NULL; err0: return error; @@ -356,7 +355,6 @@ static int tps6507x_ts_remove(struct platform_device *pdev) input_unregister_device(input_dev); tps6507x_dev->ts = NULL; - kfree(tsc); return 0; }