w1_bq27000: remove unnecessary NULL test.
authorNeilBrown <neilb@suse.de>
Sun, 19 Feb 2012 02:10:00 +0000 (13:10 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Feb 2012 22:25:50 +0000 (14:25 -0800)
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>
drivers/w1/slaves/w1_bq27000.c

index 8f10fd2630a0b0ca72194c14f40f2cf20fe3ff05..50d9af708b29d5f563e65d2275d017f8ea9da5b5 100644 (file)
@@ -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);
 
This page took 0.024942 seconds and 5 git commands to generate.