firmware: arm_scpi: add missing of_node_put after calling of_parse_phandle

of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using it.

Besides, of_address_to_resource always returns -EINVAL for error, delete
the assignment for ret.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
This commit is contained in:
Peter Chen 2016-07-04 14:55:57 +08:00 committed by Sudeep Holla
parent 557e37c05f
commit b079bd555f
1 changed files with 3 additions and 2 deletions

View File

@ -709,9 +709,10 @@ static int scpi_probe(struct platform_device *pdev)
struct mbox_client *cl = &pchan->cl; struct mbox_client *cl = &pchan->cl;
struct device_node *shmem = of_parse_phandle(np, "shmem", idx); struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
if (of_address_to_resource(shmem, 0, &res)) { ret = of_address_to_resource(shmem, 0, &res);
of_node_put(shmem);
if (ret) {
dev_err(dev, "failed to get SCPI payload mem resource\n"); dev_err(dev, "failed to get SCPI payload mem resource\n");
ret = -EINVAL;
goto err; goto err;
} }