diff mbox

[v2] 2/3 i2c: Cypress TTSP G3 MTDEV I2C Device Driver

Message ID 1291428384-26364-2-git-send-email-kev@cypress.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kevin McNeely Dec. 4, 2010, 2:06 a.m. UTC
None
diff mbox

Patch

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;
 }