mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
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:
1 parent
e37dbba665
commit
35782e165f
6 files changed
+52
-36
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user