pinctrl: rzg2l: Variable may not have been assigned to

In rzg2l_pinconf_set and rzg2l_get_pin_muxing if the call to
rzg2l_selector_decode fails then the variable pin may not have been
assigned to. Remove the use of pin from the error message. Also update
the error message to show the invalid selector used instead of port
which will be the error code returned.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Paul Barker <paul@pbarker.dev>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
This commit is contained in:
Andrew Goodbody
2025-09-03 02:45:08 +02:00
committed by Marek Vasut
parent d367be2b13
commit 8705ee4b6d
+2 -2
View File
@@ -353,7 +353,7 @@ static int rzg2l_pinconf_set(struct udevice *dev, unsigned int pin_selector,
/* The pin selector refers to a multiplexed pin */
int port = rzg2l_selector_decode(data, pin_selector, &pin);
if (port < 0) {
dev_err(dev, "Invalid pin selector %u:%u\n", port, pin);
dev_err(dev, "Invalid pin selector %u\n", pin_selector);
return port;
}
@@ -550,7 +550,7 @@ static int rzg2l_get_pin_muxing(struct udevice *dev, unsigned int selector,
port = rzg2l_selector_decode(data, selector, &pin);
if (port < 0) {
dev_err(dev, "Invalid pin selector %u:%u\n", port, pin);
dev_err(dev, "Invalid pin selector %u\n", selector);
return port;
}