Explorar el Código

sparc64: Fix irq_of_parse_and_map() and irq_dispose_mapping().

Stephen Rothwell noticed that I committed an earlier version
of the patch that didn't have two things fixed:

1) irq_of_parse_and_map() should return "unsigned int" not "int"
   and it should return zero for "no irq"

2) irq_dispose_mapping() should be an inline function, not a macro,
   for type checking

With feedback and suggestions from Anton Vorontsov.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller hace 16 años
padre
commit
51e0f004a9

+ 4 - 2
arch/sparc/include/asm/prom.h

@@ -101,8 +101,10 @@ static inline void of_node_put(struct device_node *node)
  * register them in the of_device objects, whereas powerpc computes them
  * register them in the of_device objects, whereas powerpc computes them
  * on request.
  * on request.
  */
  */
-extern int irq_of_parse_and_map(struct device_node *node, int index);
-#define irq_dispose_mapping(irq) do { } while (0)
+extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);
+static inline void irq_dispose_mapping(unsigned int virq)
+{
+}
 
 
 /*
 /*
  * NB:  This is here while we transition from using asm/prom.h
  * NB:  This is here while we transition from using asm/prom.h

+ 2 - 2
arch/sparc/kernel/of_device.c

@@ -29,12 +29,12 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
 }
 }
 EXPORT_SYMBOL(of_find_device_by_node);
 EXPORT_SYMBOL(of_find_device_by_node);
 
 
-int irq_of_parse_and_map(struct device_node *node, int index)
+unsigned int irq_of_parse_and_map(struct device_node *node, int index)
 {
 {
 	struct of_device *op = of_find_device_by_node(node);
 	struct of_device *op = of_find_device_by_node(node);
 
 
 	if (!op || index >= op->num_irqs)
 	if (!op || index >= op->num_irqs)
-		return 0xffffffff;
+		return 0;
 
 
 	return op->irqs[index];
 	return op->irqs[index];
 }
 }

+ 2 - 2
arch/sparc64/kernel/of_device.c

@@ -55,12 +55,12 @@ struct of_device *of_find_device_by_node(struct device_node *dp)
 }
 }
 EXPORT_SYMBOL(of_find_device_by_node);
 EXPORT_SYMBOL(of_find_device_by_node);
 
 
-int irq_of_parse_and_map(struct device_node *node, int index)
+unsigned int irq_of_parse_and_map(struct device_node *node, int index)
 {
 {
 	struct of_device *op = of_find_device_by_node(node);
 	struct of_device *op = of_find_device_by_node(node);
 
 
 	if (!op || index >= op->num_irqs)
 	if (!op || index >= op->num_irqs)
-		return 0xffffffff;
+		return 0;
 
 
 	return op->irqs[index];
 	return op->irqs[index];
 }
 }