3
3
* Copyright (C) 2017 SiFive
4
4
* Copyright (C) 2018 Christoph Hellwig
5
5
*/
6
- #define pr_fmt (fmt ) "plic: " fmt
7
6
#include <linux/cpu.h>
8
7
#include <linux/interrupt.h>
9
8
#include <linux/io.h>
@@ -371,9 +370,10 @@ static void plic_handle_irq(struct irq_desc *desc)
371
370
while ((hwirq = readl (claim ))) {
372
371
int err = generic_handle_domain_irq (handler -> priv -> irqdomain ,
373
372
hwirq );
374
- if (unlikely (err ))
375
- pr_warn_ratelimited ("can't find mapping for hwirq %lu\n" ,
376
- hwirq );
373
+ if (unlikely (err )) {
374
+ dev_warn_ratelimited (handler -> priv -> dev ,
375
+ "can't find mapping for hwirq %lu\n" , hwirq );
376
+ }
377
377
}
378
378
379
379
chained_irq_exit (chip , desc );
@@ -401,7 +401,7 @@ static int plic_starting_cpu(unsigned int cpu)
401
401
enable_percpu_irq (plic_parent_irq ,
402
402
irq_get_trigger_type (plic_parent_irq ));
403
403
else
404
- pr_warn ( "cpu%d: parent irq not available\n" , cpu );
404
+ dev_warn ( handler -> priv -> dev , "cpu%d: parent irq not available\n" , cpu );
405
405
plic_set_threshold (handler , PLIC_ENABLE_THRESHOLD );
406
406
407
407
return 0 ;
@@ -477,7 +477,7 @@ static int plic_probe(struct platform_device *pdev)
477
477
unsigned long hartid ;
478
478
479
479
if (of_irq_parse_one (to_of_node (dev -> fwnode ), i , & parent )) {
480
- pr_err ( "failed to parse parent for context %d.\n" , i );
480
+ dev_err ( dev , "failed to parse parent for context %d.\n" , i );
481
481
continue ;
482
482
}
483
483
@@ -500,13 +500,13 @@ static int plic_probe(struct platform_device *pdev)
500
500
501
501
error = riscv_of_parent_hartid (parent .np , & hartid );
502
502
if (error < 0 ) {
503
- pr_warn ( "failed to parse hart ID for context %d.\n" , i );
503
+ dev_warn ( dev , "failed to parse hart ID for context %d.\n" , i );
504
504
continue ;
505
505
}
506
506
507
507
cpu = riscv_hartid_to_cpuid (hartid );
508
508
if (cpu < 0 ) {
509
- pr_warn ( "Invalid cpuid for context %d\n" , i );
509
+ dev_warn ( dev , "Invalid cpuid for context %d\n" , i );
510
510
continue ;
511
511
}
512
512
@@ -525,7 +525,7 @@ static int plic_probe(struct platform_device *pdev)
525
525
*/
526
526
handler = per_cpu_ptr (& plic_handlers , cpu );
527
527
if (handler -> present ) {
528
- pr_warn ( "handler already present for context %d.\n" , i );
528
+ dev_warn ( dev , "handler already present for context %d.\n" , i );
529
529
plic_set_threshold (handler , PLIC_DISABLE_THRESHOLD );
530
530
goto done ;
531
531
}
@@ -575,8 +575,8 @@ static int plic_probe(struct platform_device *pdev)
575
575
}
576
576
}
577
577
578
- pr_info ( "%pOFP: mapped %d interrupts with %d handlers for %d contexts.\n" ,
579
- to_of_node ( dev -> fwnode ), nr_irqs , nr_handlers , nr_contexts );
578
+ dev_info ( dev , " mapped %d interrupts with %d handlers for %d contexts.\n" ,
579
+ nr_irqs , nr_handlers , nr_contexts );
580
580
return 0 ;
581
581
582
582
out_free_enable_reg :
0 commit comments