Claude review: drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature

Claude Code Review Bot
2026-04-12T02:45:58Z

Patch Review

This adds support for the RZ/G3E-specific GPO0R register for selecting the video input clock, and refactors `vclk` to an array to support two video clocks.

**Bug (indentation/scoping)**:
```c
dsi->vclk[0] = devm_clk_get(dsi->dev, "vclk");
if (IS_ERR(dsi->vclk[0]))
return PTR_ERR(dsi->vclk[0]);
```

The `if` and `return` are indented as if inside a block, but there is no enclosing block — they're at the wrong indentation level. The code will still compile and work correctly (C doesn't care about whitespace), but this is a clear coding style error. The `if` should be at the same level as the `devm_clk_get` call:

```c
dsi->vclk[0] = devm_clk_get(dsi->dev, "vclk");
if (IS_ERR(dsi->vclk[0]))
return PTR_ERR(dsi->vclk[0]);
```

**Issue (potential use of uninitialized variable)**: In `rzg2l_mipi_dsi_get_input_port()`:

```c
bool ep_enabled;
int in_port;

for_each_endpoint_of_node(np, ep_node) {
...
if (ep_enabled) {
in_port = ep.port;
break;
}
}

if (!ep_enabled)
return -EINVAL;
```

If the node has no endpoints at all (the `for_each_endpoint_of_node` loop body never executes), `ep_enabled` is used uninitialized. It should be initialized to `false`:

```c
bool ep_enabled = false;
```

Similarly, `in_port` could be used uninitialized in theory, though the `ep_enabled` check guards against that.

**Issue (OF node refcount)**: The `remote_ep` obtained from `of_graph_get_remote_endpoint()` is a device node that needs to be properly refcounted. The code does `of_node_put(remote_ep)` which is correct. However, `of_device_is_available()` checks the `status` property of a node — but `remote_ep` is an endpoint node, not a device node. Endpoint nodes don't typically have a `status` property. This should probably be checking the availability of the remote device node (the parent of the endpoint), not the endpoint itself. The function should use something like:

```c
remote_dev = of_graph_get_port_parent(remote_ep);
ep_enabled = of_device_is_available(remote_dev);
of_node_put(remote_dev);
of_node_put(remote_ep);
```

**Issue (missing `of_node_put` on early break)**: `for_each_endpoint_of_node` increments the refcount on `ep_node`. When breaking out of the loop early, the current `ep_node` reference should be released with `of_node_put(ep_node)`. The code breaks without putting the node.

---
Generated by Claude Code Patch Reviewer