diff options
author | Tomasz Figa | 2014-09-23 21:05:37 +0200 |
---|---|---|
committer | Tomasz Figa | 2014-11-09 13:10:28 +0100 |
commit | 87993273feb7f9379ec79cd9c25d195c4b93b7da (patch) | |
tree | 165dbeaee908c8599aed7595dac4d8fd4d57236f /drivers/pinctrl/samsung | |
parent | pinctrl: Add Intel Cherryview/Braswell pin controller support (diff) | |
download | kernel-qcow2-linux-87993273feb7f9379ec79cd9c25d195c4b93b7da.tar.gz kernel-qcow2-linux-87993273feb7f9379ec79cd9c25d195c4b93b7da.tar.xz kernel-qcow2-linux-87993273feb7f9379ec79cd9c25d195c4b93b7da.zip |
pinctrl: samsung: Make samsung_pinctrl_get_soc_data use ERR_PTR()
Currently the function returns a valid pointer on success and NULL on
error, so exact error code is lost. This patch changes return convention
of the function to use ERR_PTR() on error instead.
Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Diffstat (limited to 'drivers/pinctrl/samsung')
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-samsung.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 2d37c8f49f3c..8ac750329f58 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -981,7 +981,7 @@ static struct samsung_pin_ctrl *samsung_pinctrl_get_soc_data( id = of_alias_get_id(node, "pinctrl"); if (id < 0) { dev_err(&pdev->dev, "failed to get alias id\n"); - return NULL; + return ERR_PTR(-ENOENT); } match = of_match_node(samsung_pinctrl_dt_match, node); ctrl = (struct samsung_pin_ctrl *)match->data + id; @@ -1033,9 +1033,9 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) } ctrl = samsung_pinctrl_get_soc_data(drvdata, pdev); - if (!ctrl) { + if (IS_ERR(ctrl)) { dev_err(&pdev->dev, "driver data not available\n"); - return -EINVAL; + return PTR_ERR(ctrl); } drvdata->ctrl = ctrl; drvdata->dev = dev; |