From patchwork Sat Dec 4 02:06:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin McNeely X-Patchwork-Id: 379941 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB427Fe7007478 for ; Sat, 4 Dec 2010 02:07:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754405Ab0LDCGZ (ORCPT ); Fri, 3 Dec 2010 21:06:25 -0500 Received: from ns2.cypress.com ([157.95.67.5]:33563 "EHLO ns2.cypress.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752735Ab0LDCGX (ORCPT ); Fri, 3 Dec 2010 21:06:23 -0500 Received: from corpmail.cypress.com (corpmail [157.95.1.2]) by ns2.cypress.com (8.12.10/8.12.10) with ESMTP id oB4268Lu003145; Fri, 3 Dec 2010 18:06:08 -0800 (PST) Received: from kenmore.ipdsd.cypress.com (kenmore.ipdsd.cypress.com [157.95.129.67]) by corpmail.cypress.com (8.12.10/8.12.10) with ESMTP id oB42604E001660; Fri, 3 Dec 2010 18:06:01 -0800 (PST) Received: from ubuntu.ipdsd.cypress.com (ekdibmt60xp.ipdsd.cypress.com [157.95.129.94] (may be forged)) by kenmore.ipdsd.cypress.com (8.11.6+Sun/8.11.6) with ESMTP id oB4260r14188; Fri, 3 Dec 2010 18:06:00 -0800 (PST) From: Kevin McNeely To: Dmitry Torokhov Cc: David Brown , Trilok Soni , Kevin McNeely , Dmitry Torokhov , Samuel Ortiz , Luotao Fu , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [v2] 2/3 i2c: Cypress TTSP G3 MTDEV I2C Device Driver Date: Fri, 3 Dec 2010 18:06:22 -0800 Message-Id: <1291428384-26364-2-git-send-email-kev@cypress.com> X-Mailer: git-send-email 1.7.2.1 In-Reply-To: References: X-Brightmail-Tracker: AAAAAA== MIME-Version: 1.0 X-MailScanner: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 04 Dec 2010 02:07:15 +0000 (UTC) diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 9c142b8..88ee091 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -16,8 +16,8 @@ obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o -obj-$(CONFIG_TOUCHSCREEN_CYTTSP_CORE) += cyttsp_core.o -obj-$(CONFIG_TOUCHSCREEN_CYTTSP_I2C) += cyttsp_i2c.o +obj-$(CONFIG_TOUCHSCREEN_CYTTSP_CORE) += cyttsp_core.o +obj-$(CONFIG_TOUCHSCREEN_CYTTSP_I2C) += cyttsp_i2c.o obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o obj-$(CONFIG_TOUCHSCREEN_HAMPSHIRE) += hampshire.o diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c old mode 100644 new mode 100755 index cacfe4d..2a066d8b --- a/drivers/input/touchscreen/cyttsp_i2c.c +++ b/drivers/input/touchscreen/cyttsp_i2c.c @@ -87,17 +87,15 @@ static int __devinit cyttsp_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct cyttsp_i2c *ts; - int retval; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) return -EIO; /* allocate and clear memory */ ts = kzalloc(sizeof(*ts), GFP_KERNEL); - if (ts == NULL) { + if (!ts) { dev_dbg(&client->dev, "%s: Error, kzalloc.\n", __func__); - retval = -ENOMEM; - goto error_alloc_data_failed; + return -ENOMEM; } /* register driver_data */ @@ -109,18 +107,16 @@ static int __devinit cyttsp_i2c_probe(struct i2c_client *client, ts->ops.dev = &client->dev; ts->ops.dev->bus = &i2c_bus_type; - retval = cyttsp_core_init(&ts->ops, &client->dev, &ts->ttsp_client); - if (retval) - goto ttsp_core_err; + ts->ttsp_client = cyttsp_core_init(&ts->ops, &client->dev); + if (IS_ERR(ts->ttsp_client)) { + int retval = PTR_ERR(ts->ttsp_client); + kfree(ts); + return retval; + } dev_dbg(ts->ops.dev, "%s: Registration complete\n", __func__); return 0; - -ttsp_core_err: - kfree(ts); -error_alloc_data_failed: - return retval; }