fbdev: ssd1307fb: fix logical error
authorThomas Niederprüm <niederp@physik.uni-kl.de>
Mon, 25 May 2015 19:29:21 +0000 (21:29 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 27 May 2015 09:54:48 +0000 (12:54 +0300)
The logical not needs to be done after the bit masking.

Fixes: a3998fe03e87 ("fbdev: ssd1307fb: Unify init code and obtain
hw specific bits from DT")

Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/ssd1307fb.c

index 9c28a77c29345d9826b0121b70118e98e93f8a98..3e153c06131ad94adc2dac710dcd1c53539b75e8 100644 (file)
@@ -368,7 +368,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par)
        if (ret < 0)
                return ret;
 
-       compins = 0x02 | (!par->com_seq & 0x1) << 4
+       compins = 0x02 | !(par->com_seq & 0x1) << 4
                                   | (par->com_lrremap & 0x1) << 5;
        ret = ssd1307fb_write_cmd(par->client, compins);
        if (ret < 0)