Skip to content

Commit

Permalink
w1_bq27000: remove unnecessary NULL test.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown authored and Greg Kroah-Hartman committed Feb 24, 2012
1 parent 93518dd commit b6c40b8
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/w1/slaves/w1_bq27000.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ static int w1_bq27000_read(struct device *dev, unsigned int reg)
u8 val;
struct w1_slave *sl = container_of(dev->parent, struct w1_slave, dev);

if (!dev)
return 0;

w1_write_8(sl->master, HDQ_CMD_READ | reg);
val = w1_read_8(sl->master);

Expand Down

0 comments on commit b6c40b8

Please sign in to comment.