On 14/10/2024 09:22, Dan Carpenter wrote:
@@ -1341,8 +1342,6 @@ static int vchiq_probe(struct platform_device *pdev) if (!info) return -EINVAL;
- fw_node = of_find_compatible_node(NULL, NULL,
"raspberrypi,bcm2835-firmware");
Perhaps it's better to declare the variable here so that the function and the error handling are next to each other.
if (!info) return -EINVAL;
struct device_node *fw_node __free(device_node) = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware"); if (!fw_node) {
...
This is why we lifted the rule that variables had to be declared at the start of a function.
Ack, this is how this should look like.
Best regards, Krzysztof