icE1usb fw: Use NUM_E1_PORTS in e1.c

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: Id69b4429a67ccb8834fee26b83839539a5ad8b31
This commit is contained in:
Sylvain Munaut 2024-04-29 20:06:46 +02:00
parent e891628c02
commit 681bda07a7
1 changed files with 3 additions and 3 deletions

View File

@ -263,13 +263,13 @@ struct e1_state {
struct e1_error_count errors;
};
static struct e1_state g_e1[2];
static struct e1_state g_e1[NUM_E1_PORTS];
static volatile struct e1_core *
_get_regs(int port)
{
if ((port < 0) || (port > 1))
if ((port < 0) || (port >= NUM_E1_PORTS))
panic("_get_regs invalid port %d", port);
return &e1_regs_base[port];
}
@ -277,7 +277,7 @@ _get_regs(int port)
static struct e1_state *
_get_state(int port)
{
if ((port < 0) || (port > 1))
if ((port < 0) || (port >= NUM_E1_PORTS))
panic("_get_state invalid port %d", port);
return &g_e1[port];
}