powerpc/powermac: constify device_node in of_irq_parse_oldworld()
authorKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Fri, 24 Sep 2021 10:56:53 +0000 (12:56 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 22 May 2022 05:59:54 +0000 (15:59 +1000)
The of_irq_parse_oldworld() does not modify passed device_node so make
it a pointer to const for safety.  Drop the extern while modifying the
line.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210924105653.46963-2-krzysztof.kozlowski@canonical.com
arch/powerpc/platforms/powermac/pic.c
include/linux/of_irq.h

index 71a3f62..8c8d8e0 100644 (file)
@@ -384,7 +384,7 @@ static void __init pmac_pic_probe_oldstyle(void)
 #endif
 }
 
-int of_irq_parse_oldworld(struct device_node *device, int index,
+int of_irq_parse_oldworld(const struct device_node *device, int index,
                        struct of_phandle_args *out_irq)
 {
        const u32 *ints = NULL;
index aaf219b..83fccd0 100644 (file)
@@ -20,12 +20,12 @@ typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *);
 #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC)
 extern unsigned int of_irq_workarounds;
 extern struct device_node *of_irq_dflt_pic;
-extern int of_irq_parse_oldworld(struct device_node *device, int index,
-                              struct of_phandle_args *out_irq);
+int of_irq_parse_oldworld(const struct device_node *device, int index,
+                         struct of_phandle_args *out_irq);
 #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
 #define of_irq_workarounds (0)
 #define of_irq_dflt_pic (NULL)
-static inline int of_irq_parse_oldworld(struct device_node *device, int index,
+static inline int of_irq_parse_oldworld(const struct device_node *device, int index,
                                      struct of_phandle_args *out_irq)
 {
        return -EINVAL;