tprop = of_find_property(target, prop->name, NULL);
- if (of_prop_cmp(prop->name, "name") == 0 ||
- of_prop_cmp(prop->name, "phandle") == 0 ||
- of_prop_cmp(prop->name, "linux,phandle") == 0)
+ if (!of_prop_cmp(prop->name, "name") ||
+ !of_prop_cmp(prop->name, "phandle") ||
+ !of_prop_cmp(prop->name, "linux,phandle"))
return 0;
if (is_symbols_node) {
propn = __of_prop_dup(prop, GFP_KERNEL);
}
- if (propn == NULL)
+ if (!propn)
return -ENOMEM;
- if (tprop == NULL)
+ if (!tprop)
ret = of_changeset_add_property(&ov->cset, target, propn);
else
ret = of_changeset_update_property(&ov->cset, target, propn);
int ret = 0;
cname = kbasename(child->full_name);
- if (cname == NULL)
+ if (!cname)
return -ENOMEM;
for_each_child_of_node(target, tchild)
if (!of_node_cmp(cname, kbasename(tchild->full_name)))
break;
- if (tchild != NULL) {
+ if (tchild) {
if (child->phandle)
return -EINVAL;
for_each_child_of_node(overlay, child) {
ret = of_overlay_apply_single_device_node(ov, target, child);
- if (ret != 0) {
+ if (ret) {
pr_err("Failed to apply single node @%pOF/%s\n",
target, child->name);
of_node_put(child);
err = of_overlay_apply_one(ov, ovinfo->target, ovinfo->overlay,
ovinfo->is_symbols_node);
- if (err != 0) {
+ if (err) {
pr_err("apply failed '%pOF'\n", ovinfo->target);
return err;
}
int ret;
ret = of_property_read_u32(info_node, "target", &val);
- if (ret == 0)
+ if (!ret)
return of_find_node_by_phandle(val);
ret = of_property_read_string(info_node, "target-path", &path);
- if (ret == 0)
+ if (!ret)
return of_find_node_by_path(path);
pr_err("Failed to find target for node %p (%s)\n",
struct device_node *info_node, struct of_overlay_info *ovinfo)
{
ovinfo->overlay = of_get_child_by_name(info_node, "__overlay__");
- if (ovinfo->overlay == NULL)
+ if (!ovinfo->overlay)
goto err_fail;
ovinfo->target = find_target_node(info_node);
- if (ovinfo->target == NULL)
+ if (!ovinfo->target)
goto err_fail;
return 0;
cnt++;
ovinfo = kcalloc(cnt, sizeof(*ovinfo), GFP_KERNEL);
- if (ovinfo == NULL)
+ if (!ovinfo)
return -ENOMEM;
cnt = 0;
for_each_child_of_node(tree, node) {
err = of_fill_overlay_info(ov, node, &ovinfo[cnt]);
- if (err == 0)
+ if (!err)
cnt++;
}
cnt++;
}
- if (cnt == 0) {
+ if (!cnt) {
kfree(ovinfo);
return -ENODEV;
}
int err, id;
ov = kzalloc(sizeof(*ov), GFP_KERNEL);
- if (ov == NULL)
+ if (!ov)
return -ENOMEM;
ov->id = -1;
mutex_lock(&of_mutex);
ov = idr_find(&ov_idr, id);
- if (ov == NULL) {
+ if (!ov) {
err = -ENODEV;
pr_err("destroy: Could not find overlay #%d\n", id);
goto out;