struct pmic_glink_ucsi *ucsi;
struct device *dev = &adev->dev;
const struct of_device_id *match;
- struct fwnode_handle *fwnode;
int ret;
ucsi = devm_kzalloc(dev, sizeof(*ucsi), GFP_KERNEL);
ucsi_set_drvdata(ucsi->ucsi, ucsi);
- device_for_each_child_node(dev, fwnode) {
+ device_for_each_child_node_scoped(dev, fwnode) {
struct gpio_desc *desc;
u32 port;
ret = fwnode_property_read_u32(fwnode, "reg", &port);
if (ret < 0) {
dev_err(dev, "missing reg property of %pOFn\n", fwnode);
- fwnode_handle_put(fwnode);
return ret;
}
if (!desc)
continue;
- if (IS_ERR(desc)) {
- fwnode_handle_put(fwnode);
+ if (IS_ERR(desc))
return dev_err_probe(dev, PTR_ERR(desc),
"unable to acquire orientation gpio\n");
- }
+
ucsi->port_orientation[port] = desc;
}