From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Subject: Re: [PATCH 1/1] Input: STMicroelectronics multi touch capacitive touchscreen ftk Date: Fri, 30 Nov 2012 07:40:55 -0800 Message-ID: <1354290055.11903.20.camel@joe-AO722> References: <1354285134-8188-1-git-send-email-willy.woo@gmail.com> <20121130150437.GE17587@arwen.pp.htv.fi> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: Received: from perches-mx.perches.com ([206.117.179.246]:34543 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030746Ab2K3Pkz (ORCPT ); Fri, 30 Nov 2012 10:40:55 -0500 In-Reply-To: <20121130150437.GE17587@arwen.pp.htv.fi> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: balbi@ti.com Cc: Li Wu , Dmitry Torokhov , Li Wu , Henrik Rydberg , Andrew Morton , Greg Kroah-Hartman , "David S. Miller" , Mauro Carvalho Chehab , Shawn Landden , Viresh Kumar , Jianchun , David Dajun Chen , Ashish Jangam , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, device-drivers-devel@blackfin.uclinux.org, victor.phay@st.com On Fri, 2012-11-30 at 17:04 +0200, Felipe Balbi wrote: > On Fri, Nov 30, 2012 at 09:18:54AM -0500, Li Wu wrote: > > This is a initial driver for STMicroelectronics multi touch > > capacitive touchscren FingertipK. It supports maximum 10 fingers, > > based on I2C interface. [] > diff --git a/drivers/input/touchscreen/ftk.c b/drivers/input/touchscreen/ftk.c [] > > +static int stm_ts_probe(struct i2c_client *client, > > + const struct i2c_device_id *idp) > > +{ [] > > + ftk_ts->dev = &ftk_ts->client->dev; > > + ftk_ts->input_dev = input_allocate_device(); It'd be nicer to use a temporary "dev" > > + ftk_ts->input_dev->dev.parent = &client->dev; > > + if (!ftk_ts->input_dev) { > > + dev_err(ftk_ts->dev, "err = ENOMEM!\n"); > > + err = ENOMEM; > > + goto fail; > > + } Put the dev_parent assign after the error check. > > + ftk_ts->input_dev->name = "ftk"; > > + ftk_ts->input_dev->phys = "ftk/input0"; > > + ftk_ts->input_dev->id.bustype = BUS_I2C; > > + ftk_ts->input_dev->id.vendor = 0x0001; > > + ftk_ts->input_dev->id.product = 0x0002; > > + ftk_ts->input_dev->id.version = 0x0100; All of these would be a lot shorter and likely fit on a single line with just dev->name = "ftk"; etc..