Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58a3b92d authored by Linus Walleij's avatar Linus Walleij
Browse files

gpio: dwapb: fix pointer to integer cast



The statements BUG_ON(ctx == 0) was implicitly casting a pointer
to an integer for comparison. Do this with a bool test instead
to get away from sparse warnings.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 513d3c0f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -626,7 +626,7 @@ static int dwapb_gpio_suspend(struct device *dev)
		unsigned int idx = gpio->ports[i].idx;
		struct dwapb_context *ctx = gpio->ports[i].ctx;

		BUG_ON(ctx == 0);
		BUG_ON(!ctx);

		offset = GPIO_SWPORTA_DDR + idx * GPIO_SWPORT_DDR_SIZE;
		ctx->dir = dwapb_read(gpio, offset);
@@ -668,7 +668,7 @@ static int dwapb_gpio_resume(struct device *dev)
		unsigned int idx = gpio->ports[i].idx;
		struct dwapb_context *ctx = gpio->ports[i].ctx;

		BUG_ON(ctx == 0);
		BUG_ON(!ctx);

		offset = GPIO_SWPORTA_DR + idx * GPIO_SWPORT_DR_SIZE;
		dwapb_write(gpio, offset, ctx->data);