term/serial: Improve detection of duplicate serial ports

We currently rely on some pretty fragile comparison by name to
identify whether a serial port being configured is identical

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Benjamin Herrenschmidt authored and Daniel Kiper committed 2023-01-19 17:39:04 +01:00
1 parent e37dbba665
commit 35782e165f
6 files changed
+52 -36

No files matched your search

+5 -1
View File
@@ -227,6 +227,10 @@ add_port (struct ofserial_hash_ent *ent)
if (!ent->shortest)
return NULL;
FOR_SERIAL_PORTS (port)
if (port->elem == ent)
return port;
port = grub_zalloc (sizeof (*port));
if (!port)
return NULL;
@@ -248,7 +252,7 @@ add_port (struct ofserial_hash_ent *ent)
return port;
}
const struct grub_serial_port *
struct grub_serial_port *
grub_ofserial_add_port (const char *path)
{
struct ofserial_hash_ent *ent;