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

Commit 3d40f7fe authored by Uwe Kleine-König's avatar Uwe Kleine-König
Browse files

arm/imx/gpio: GPIO_INT_{HIGH,LOW}_LEV are not necessarily constant



GPIO_INT_LOW_LEV is defined as

	(cpu_is_mx1_mx2() ? 0x3 : 0x0)

so depending on compiler optimisation and enabled SoCs this doesn't
qualify as a constant expression as needed by a switch statement.
Ditto for GPIO_INT_HIGH_LEV.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 4a50d00c
Loading
Loading
Loading
Loading
+3 −6
Original line number Original line Diff line number Diff line
@@ -140,16 +140,13 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
	val = __raw_readl(reg);
	val = __raw_readl(reg);
	edge = (val >> (bit << 1)) & 3;
	edge = (val >> (bit << 1)) & 3;
	val &= ~(0x3 << (bit << 1));
	val &= ~(0x3 << (bit << 1));
	switch (edge) {
	if (edge == GPIO_INT_HIGH_LEV) {
	case GPIO_INT_HIGH_LEV:
		edge = GPIO_INT_LOW_LEV;
		edge = GPIO_INT_LOW_LEV;
		pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
		pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
		break;
	} else if (edge == GPIO_INT_LOW_LEV) {
	case GPIO_INT_LOW_LEV:
		edge = GPIO_INT_HIGH_LEV;
		edge = GPIO_INT_HIGH_LEV;
		pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
		pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
		break;
	} else {
	default:
		pr_err("mxc: invalid configuration for GPIO %d: %x\n",
		pr_err("mxc: invalid configuration for GPIO %d: %x\n",
		       gpio, edge);
		       gpio, edge);
		return;
		return;