hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/powerpc/kernel/legacy_serial.c
....@@ -192,7 +192,7 @@
192192 /* Add port, irq will be dealt with later. We passed a translated
193193 * IO port value. It will be fixed up later along with the irq
194194 */
195
- if (tsi && !strcmp(tsi->type, "tsi-bridge"))
195
+ if (of_node_is_type(tsi, "tsi-bridge"))
196196 return add_legacy_port(np, -1, UPIO_TSI, addr, addr,
197197 0, legacy_port_flags, 0);
198198 else
....@@ -400,8 +400,7 @@
400400 /* Next, fill our array with ISA ports */
401401 for_each_node_by_type(np, "serial") {
402402 struct device_node *isa = of_get_parent(np);
403
- if (isa && (!strcmp(isa->name, "isa") ||
404
- !strcmp(isa->name, "lpc"))) {
403
+ if (of_node_name_eq(isa, "isa") || of_node_name_eq(isa, "lpc")) {
405404 if (of_device_is_available(np)) {
406405 index = add_legacy_isa_port(np, isa);
407406 if (index >= 0 && np == stdout)
....@@ -415,11 +414,12 @@
415414 /* Next, try to locate PCI ports */
416415 for (np = NULL; (np = of_find_all_nodes(np));) {
417416 struct device_node *pci, *parent = of_get_parent(np);
418
- if (parent && !strcmp(parent->name, "isa")) {
417
+ if (of_node_name_eq(parent, "isa")) {
419418 of_node_put(parent);
420419 continue;
421420 }
422
- if (strcmp(np->name, "serial") && strcmp(np->type, "serial")) {
421
+ if (!of_node_name_eq(np, "serial") &&
422
+ !of_node_is_type(np, "serial")) {
423423 of_node_put(parent);
424424 continue;
425425 }
....@@ -479,8 +479,10 @@
479479 port->irq = virq;
480480
481481 #ifdef CONFIG_SERIAL_8250_FSL
482
- if (of_device_is_compatible(np, "fsl,ns16550"))
482
+ if (of_device_is_compatible(np, "fsl,ns16550")) {
483483 port->handle_irq = fsl8250_handle_irq;
484
+ port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE);
485
+ }
484486 #endif
485487 }
486488