lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 30 Nov 2012 07:40:55 -0800
From:	Joe Perches <joe@...ches.com>
To:	balbi@...com
Cc:	Li Wu <willy.woo@...il.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Li Wu <li.wu@...com>, Henrik Rydberg <rydberg@...omail.se>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"David S. Miller" <davem@...emloft.net>,
	Mauro Carvalho Chehab <mchehab@...hat.com>,
	Shawn Landden <shawnlandden@...il.com>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Jianchun <jcbian@...cir.com.cn>,
	David Dajun Chen <dchen@...semi.com>,
	Ashish Jangam <ashish.jangam@...tcummins.com>,
	linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
	device-drivers-devel@...ckfin.uclinux.org, victor.phay@...com
Subject: Re: [PATCH 1/1] Input: STMicroelectronics multi touch capacitive
 touchscreen ftk

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..


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ