9
0
Fork 0

mci: core: Check return value of dev_add_param_bool

Commit 03b59bdb64 changed the
return values of dev_add_param_* to ERR_PTR(-ENOSYS) and broke a few boards.
We have now to care about the return value of dev_add_param_bool() in
mci_register().

Also set the ret variable when dev_add_param_bool() fails.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Wadim Egorov 2015-03-18 15:13:42 +01:00 committed by Sascha Hauer
parent ccee789e67
commit f28ea92181
1 changed files with 2 additions and 1 deletions

View File

@ -1774,7 +1774,8 @@ int mci_register(struct mci_host *host)
mci->param_probe = dev_add_param_bool(&mci->dev, "probe",
mci_set_probe, NULL, &mci->probe, mci);
if (IS_ERR(mci->param_probe)) {
if (IS_ERR(mci->param_probe) && PTR_ERR(mci->param_probe) != -ENOSYS) {
ret = PTR_ERR(mci->param_probe);
dev_dbg(&mci->dev, "Failed to add 'probe' parameter to the MCI device\n");
goto err_unregister;
}