Messages in this thread Patch in this message | | | From | Laszlo Papp <> | Subject | [PATCH] mfd: (max8997) Handle the potential error for mfd_add_devices | Date | Mon, 16 Dec 2013 12:01:11 +0000 |
| |
Signed-off-by: Laszlo Papp <lpapp@kde.org> --- drivers/mfd/max8997.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index 791aea3..c7cc235 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -227,19 +227,19 @@ static int max8997_i2c_probe(struct i2c_client *i2c, pm_runtime_set_active(max8997->dev); max8997_irq_init(max8997); - - mfd_add_devices(max8997->dev, -1, max8997_devs, + ret = mfd_add_devices(max8997->dev, -1, max8997_devs, ARRAY_SIZE(max8997_devs), NULL, 0, NULL); + if (ret < 0) { + dev_err(dev, "cannot add mfd cells\n"); + goto err_mfd; + } /* * TODO: enable others (flash, muic, rtc, battery, ...) and * check the return value */ - if (ret < 0) - goto err_mfd; - /* MAX8997 has a power button input. */ device_init_wakeup(max8997->dev, pdata->wakeup); -- 1.8.5.1
| |