forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/arch/powerpc/platforms/chrp/setup.c
....@@ -34,7 +34,6 @@
3434 #include <linux/timer.h>
3535
3636 #include <asm/io.h>
37
-#include <asm/pgtable.h>
3837 #include <asm/prom.h>
3938 #include <asm/pci-bridge.h>
4039 #include <asm/dma.h>
....@@ -280,20 +279,14 @@
280279 node = of_find_node_by_path(property);
281280 if (!node)
282281 return;
283
- property = of_get_property(node, "device_type", NULL);
284
- if (!property)
285
- goto out_put;
286
- if (strcmp(property, "serial"))
282
+ if (!of_node_is_type(node, "serial"))
287283 goto out_put;
288284 /*
289285 * The 9pin connector is either /failsafe
290286 * or /pci@80000000/isa@C/serial@i2F8
291287 * The optional graphics card has also type 'serial' in VGA mode.
292288 */
293
- property = of_get_property(node, "name", NULL);
294
- if (!property)
295
- goto out_put;
296
- if (!strcmp(property, "failsafe") || !strcmp(property, "serial"))
289
+ if (of_node_name_eq(node, "failsafe") || of_node_name_eq(node, "serial"))
297290 add_preferred_console("ttyS", 0, NULL);
298291 out_put:
299292 of_node_put(node);
....@@ -457,13 +450,6 @@
457450 of_node_put(np);
458451 }
459452
460
-#if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON)
461
-static struct irqaction xmon_irqaction = {
462
- .handler = xmon_irq,
463
- .name = "XMON break",
464
-};
465
-#endif
466
-
467453 static void __init chrp_find_8259(void)
468454 {
469455 struct device_node *np, *pic = NULL;
....@@ -544,19 +530,21 @@
544530 /* see if there is a keyboard in the device tree
545531 with a parent of type "adb" */
546532 for_each_node_by_name(kbd, "keyboard")
547
- if (kbd->parent && kbd->parent->type
548
- && strcmp(kbd->parent->type, "adb") == 0)
533
+ if (of_node_is_type(kbd->parent, "adb"))
549534 break;
550535 of_node_put(kbd);
551
- if (kbd)
552
- setup_irq(HYDRA_INT_ADB_NMI, &xmon_irqaction);
536
+ if (kbd) {
537
+ if (request_irq(HYDRA_INT_ADB_NMI, xmon_irq, 0, "XMON break",
538
+ NULL))
539
+ pr_err("Failed to register XMON break interrupt\n");
540
+ }
553541 #endif
554542 }
555543
556544 static void __init
557545 chrp_init2(void)
558546 {
559
-#ifdef CONFIG_NVRAM
547
+#if IS_ENABLED(CONFIG_NVRAM)
560548 chrp_nvram_init();
561549 #endif
562550
....@@ -580,7 +568,6 @@
580568 if (strcmp(dtype, "chrp"))
581569 return 0;
582570
583
- ISA_DMA_THRESHOLD = ~0L;
584571 DMA_MODE_READ = 0x44;
585572 DMA_MODE_WRITE = 0x48;
586573