if (!saif)
return -ENOMEM;
- saif->id = of_alias_get_id(np, "saif");
- if (saif->id < 0)
- return saif->id;
+ ret = of_alias_get_id(np, "saif");
+ if (ret < 0)
+ return ret;
+ else
+ saif->id = ret;
+
/*
* If there is no "fsl,saif-master" phandle, it's a saif
* master. Otherwise, it's a slave and its phandle points
if (!master) {
saif->master_id = saif->id;
} else {
- saif->master_id = of_alias_get_id(master, "saif");
- if (saif->master_id < 0)
- return saif->master_id;
+ ret = of_alias_get_id(master, "saif");
+ if (ret < 0)
+ return ret;
+ else
+ saif->master_id = ret;
}
- if (saif->master_id < 0 || saif->master_id >= ARRAY_SIZE(mxs_saif)) {
+ if (saif->master_id >= ARRAY_SIZE(mxs_saif)) {
dev_err(&pdev->dev, "get wrong master id\n");
return -EINVAL;
}