forked from luck/tmp_suning_uos_patched
[media] blackfin: check devm_pinctrl_get() for errors
devm_pinctrl_get() can fail so we should check for that.
Fixes: 0a6824bc10
('[media] v4l2: blackfin: select proper pinctrl state in ppi_set_params if CONFIG_PINCTRL is enabled')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
5911f62926
commit
c9205e18b4
@ -214,6 +214,8 @@ static int ppi_set_params(struct ppi_if *ppi, struct ppi_params *params)
|
||||
if (params->dlen > 24 || params->dlen <= 0)
|
||||
return -EINVAL;
|
||||
pctrl = devm_pinctrl_get(ppi->dev);
|
||||
if (IS_ERR(pctrl))
|
||||
return PTR_ERR(pctrl);
|
||||
pstate = pinctrl_lookup_state(pctrl,
|
||||
pin_state[(params->dlen + 7) / 8 - 1]);
|
||||
if (pinctrl_select_state(pctrl, pstate))
|
||||
|
Loading…
Reference in New Issue
Block a user