mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 12:56:00 +01:00
cmd: gpio: Skip output on -ENOENT
On the Renesas RZ/G2L SoC family, valid GPIO numbers are not contiguous. This is determined by the device tree, where a fixed number of bits are used for the 'pin' number within a 'port', even though not all ports have the same number of pins. The device tree can't be changed here without breaking backwards compatibility in Linux, which we don't want to do. To avoid printing a status for each of these invalid GPIO numbers when a user executes `gpio status -a`, we allow gpio_get_function() to return -ENOENT when the given offset does not refer to a valid GPIO pin and we skip printing anything if this occurs. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
This commit is contained in:
parent
959fc0bd72
commit
ee0522f520
@ -17,6 +17,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <asm/gpio.h>
|
#include <asm/gpio.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
|
#include <dm/device_compat.h>
|
||||||
|
|
||||||
__weak int name_to_gpio(const char *name)
|
__weak int name_to_gpio(const char *name)
|
||||||
{
|
{
|
||||||
@ -69,6 +70,7 @@ static void gpio_get_description(struct udevice *dev, const char *bank_name,
|
|||||||
printf("%s\n", buf);
|
printf("%s\n", buf);
|
||||||
return;
|
return;
|
||||||
err:
|
err:
|
||||||
|
if (ret != -ENOENT)
|
||||||
printf("Error %d\n", ret);
|
printf("Error %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user