浏览代码

mfd: Fix error handling if BUG() isn't enabled in WM8994

Even if we would've BUG()ed we should still tidy up after ourselves if that
isn't enabled in the kernel config.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown 14 年之前
父节点
当前提交
f85dbda076
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/mfd/wm8994-core.c

+ 2 - 2
drivers/mfd/wm8994-core.c

@@ -409,7 +409,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
 		break;
 	default:
 		BUG();
-		return -EINVAL;
+		goto err;
 	}
 
 	wm8994->supplies = kzalloc(sizeof(struct regulator_bulk_data) *
@@ -431,7 +431,7 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
 		break;
 	default:
 		BUG();
-		return -EINVAL;
+		goto err;
 	}
 		
 	ret = regulator_bulk_get(wm8994->dev, wm8994->num_supplies,