diff --git a/drivers/sh/pfc.c b/drivers/sh/pfc.c
index dee581f6382c1f91abf764bc07339edf13c66887..75934e3ea34e848b4e3612b031d77635da1451d1 100644
--- a/drivers/sh/pfc.c
+++ b/drivers/sh/pfc.c
@@ -561,10 +561,8 @@ static int sh_gpio_get_value(struct pinmux_info *gpioc, unsigned gpio)
 	struct pinmux_data_reg *dr = NULL;
 	int bit = 0;
 
-	if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0) {
-		BUG();
-		return 0;
-	}
+	if (!gpioc || get_data_reg(gpioc, gpio, &dr, &bit) != 0)
+		return -EINVAL;
 
 	return gpio_read_reg(dr->reg, dr->reg_width, 1, bit);
 }