chelsio: use BUG() instead of BUG_ON(1)
[linux-2.6-block.git] / drivers / mfd / sec-core.c
index e0835c9df7a197944f0373c0443a4f2eeffa4496..521319086c81d15fc6678c136eeffea7af707b5e 100644 (file)
@@ -114,7 +114,8 @@ static const struct mfd_cell s2mpu02_devs[] = {
 
 #ifdef CONFIG_OF
 static const struct of_device_id sec_dt_match[] = {
-       {       .compatible = "samsung,s5m8767-pmic",
+       {
+               .compatible = "samsung,s5m8767-pmic",
                .data = (void *)S5M8767X,
        }, {
                .compatible = "samsung,s2mps11-pmic",
@@ -309,8 +310,8 @@ static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic)
  * the sub-modules need not instantiate another instance while parsing their
  * platform data.
  */
-static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
-                                       struct device *dev)
+static struct sec_platform_data *
+sec_pmic_i2c_parse_dt_pdata(struct device *dev)
 {
        struct sec_platform_data *pd;
 
@@ -331,8 +332,8 @@ static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
        return pd;
 }
 #else
-static struct sec_platform_data *sec_pmic_i2c_parse_dt_pdata(
-                                       struct device *dev)
+static struct sec_platform_data *
+sec_pmic_i2c_parse_dt_pdata(struct device *dev)
 {
        return NULL;
 }
@@ -471,8 +472,9 @@ static int sec_pmic_probe(struct i2c_client *i2c,
                num_sec_devs = ARRAY_SIZE(s2mpu02_devs);
                break;
        default:
-               /* If this happens the probe function is problem */
-               BUG();
+               dev_err(&i2c->dev, "Unsupported device type (%lu)\n",
+                       sec_pmic->device_type);
+               return -ENODEV;
        }
        ret = devm_mfd_add_devices(sec_pmic->dev, -1, sec_devs, num_sec_devs,
                                   NULL, 0, NULL);