From: Joe Perches <joe@perches.com>
To: balbi@ti.com
Cc: Li Wu <willy.woo@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>, Li Wu <li.wu@st.com>,
Henrik Rydberg <rydberg@euromail.se>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"David S. Miller" <davem@davemloft.net>,
Mauro Carvalho Chehab <mchehab@redhat.com>,
Shawn Landden <shawnlandden@gmail.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Jianchun <jcbian@pixcir.com.cn>,
David Dajun Chen <dchen@diasemi.com>,
Ashish Jangam <ashish.jangam@kpitcummins.com>,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
device-drivers-devel@blackfin.uclinux.org, victor.phay@st.com
Subject: Re: [PATCH 1/1] Input: STMicroelectronics multi touch capacitive touchscreen ftk
Date: Fri, 30 Nov 2012 07:40:55 -0800 [thread overview]
Message-ID: <1354290055.11903.20.camel@joe-AO722> (raw)
In-Reply-To: <20121130150437.GE17587@arwen.pp.htv.fi>
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..
next prev parent reply other threads:[~2012-11-30 15:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 14:18 [PATCH 1/1] Input: STMicroelectronics multi touch capacitive touchscreen ftk Li Wu
2012-11-30 15:04 ` Felipe Balbi
2012-11-30 15:40 ` Joe Perches [this message]
[not found] ` <CAEdoeCM94F3RT8J4w8i3S6GJ5Upy1CBCatnuwiFB_7ZzB0Cn6Q@mail.gmail.com>
2012-12-04 1:44 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1354290055.11903.20.camel@joe-AO722 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=ashish.jangam@kpitcummins.com \
--cc=balbi@ti.com \
--cc=davem@davemloft.net \
--cc=dchen@diasemi.com \
--cc=device-drivers-devel@blackfin.uclinux.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jcbian@pixcir.com.cn \
--cc=li.wu@st.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=rydberg@euromail.se \
--cc=shawnlandden@gmail.com \
--cc=victor.phay@st.com \
--cc=viresh.kumar@linaro.org \
--cc=willy.woo@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).