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] [thread-next>] [day] [month] [year] [list]
Message-ID: <331ABD5ECB02734CA317220B2BBEABC103ECA4@DBDE01.ent.ti.com>
Date:	Wed, 28 Dec 2011 09:14:13 +0000
From:	"AnilKumar, Chimata" <anilkumar@...com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	"sameo@...ux.intel.com" <sameo@...ux.intel.com>,
	"Girdwood, Liam" <lrg@...com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
	"Nori, Sekhar" <nsekhar@...com>
Subject: RE: [PATCH 1/2] MFD: TPS65217: Add new mfd device for TPS65217

Hi Mark,

Thanks for reviewing these patches.

On Fri, Dec 23, 2011 at 16:19:18, Mark Brown wrote:
> On Fri, Dec 23, 2011 at 10:51:19AM +0530, AnilKumar Ch wrote:
> > The TPS65217 chip is a power management IC for Portable Navigation Systems
> > and Tablet Computing devices. It contains the following components:
> 
> I can't help but thinking that there ought to be more code sharing
> between the various TI PMIC drivers.
> 
> > +static int tps65217_i2c_read_device(struct tps65217_dev *tps65217, char reg,
> > +				  int bytes, void *dest)
> > +{
> > +	struct i2c_client *i2c = tps65217->i2c_client;
> > +	struct i2c_msg xfer[2];
> > +	int ret;
> 
> Use regmap for the register I/O, this will save a lot of code and will
> also give access to things like the register cache code.
> 

All the I2C read and writes moved to regmap read and writes.

> > +	tps65217 = kzalloc(sizeof(struct tps65217_dev), GFP_KERNEL);
> > +	if (tps65217 == NULL)
> > +		return -ENOMEM;
> 
> Use devm_kzalloc(), it saves all the unwinding code.

Changed kzalloc to devm_kzalloc

> 
> > +/* All register addresses */
> > +#define TPS65217_REG_CHIPID		0X00
> 
> You should verify this as part of the probe() routine - read it back to
> make sure it's what's expected, and log the chip revision too in case it
> is useful for diagnostics.
> 

Added chip verification code to mfd probe and printing the regulator ID &
version number.

Thanks
AnilKumar
--
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