Commit Graph

5 Commits (14aaa9f0a318bd04cbb9d822524b817e95d8b343)

Author SHA1 Message Date
NeilBrown f6e8a1d7b4 w1_bq27000: Only one thread can access the bq27000 at a time.
If multiple threads try, they trip over each other badly.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 14:25:50 -08:00
NeilBrown df7019f370 w1_bq27000 - remove w1_bq27000_write
The function is never used so remove it to avoid bit-rot.
It can trivially be re-added if there is ever a need.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 14:25:50 -08:00
NeilBrown b6c40b8581 w1_bq27000: remove unnecessary NULL test.
As recent change means that we now dereference 'dev' before testing
for NULL.

That means either the change was wrong, or the test isn't needed.
As this function is only called from one driver (bq27x000_battery) and
it always passed a non-NULL dev, it seems good to assume that the
test isn't needed.

So remove it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 14:25:50 -08:00
NeilBrown 9f3519d2ed w1: Fix w1_bq27000
w1_bq27000 adds a bq27000-battery platform device but does not provide
platform data for it. This causes the bq27x00 driver to dereference a NULL
pointer.
So provide the appropriate platform data.  This requires modifying
w1_bq27000_read so that it find the w1 device as the parent of the bq device.

Also there is no point exporting w1_bq27000_read as nothing else uses it
or could use it.  So make it static.

Finally, as there is no way to track how many batteries have been found, and
we will probably only find one, use an id number of '-1' to assert that this
is a unique instance.

Signed-off-by: NeilBrown <neilb@suse.de>
Tested-by: Thomas Weber <weber@corscience.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-15 17:17:50 -08:00
Madhusudhan Chikkature cfbc619033 hdq: bQ27000 HDQ Slave Interface Driver
Provide the BQ27000 slave interface driver.

Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>
Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-12 17:17:18 -08:00