2024-02-22 09:41:02

by Anup Patel

[permalink] [raw]
Subject: [PATCH v14 02/18] irqchip/sifive-plic: Use dev_xyz() in-place of pr_xyz()

Use dev_info(), dev_warn(), and dev_err() in-place of pr_info(),
pr_warn(), and pr_err().

Signed-off-by: Anup Patel <[email protected]>
---
drivers/irqchip/irq-sifive-plic.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index 7400a07fc479..3d7a61c35572 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -3,7 +3,6 @@
* Copyright (C) 2017 SiFive
* Copyright (C) 2018 Christoph Hellwig
*/
-#define pr_fmt(fmt) "plic: " fmt
#include <linux/cpu.h>
#include <linux/interrupt.h>
#include <linux/io.h>
@@ -372,8 +371,8 @@ static void plic_handle_irq(struct irq_desc *desc)
int err = generic_handle_domain_irq(handler->priv->irqdomain,
hwirq);
if (unlikely(err))
- pr_warn_ratelimited("can't find mapping for hwirq %lu\n",
- hwirq);
+ dev_warn_ratelimited(handler->priv->dev,
+ "can't find mapping for hwirq %lu\n", hwirq);
}

chained_irq_exit(chip, desc);
@@ -401,7 +400,7 @@ static int plic_starting_cpu(unsigned int cpu)
enable_percpu_irq(plic_parent_irq,
irq_get_trigger_type(plic_parent_irq));
else
- pr_warn("cpu%d: parent irq not available\n", cpu);
+ dev_warn(handler->priv->dev, "cpu%d: parent irq not available\n", cpu);
plic_set_threshold(handler, PLIC_ENABLE_THRESHOLD);

return 0;
@@ -477,7 +476,7 @@ static int plic_probe(struct platform_device *pdev)
unsigned long hartid;

if (of_irq_parse_one(to_of_node(dev->fwnode), i, &parent)) {
- pr_err("failed to parse parent for context %d.\n", i);
+ dev_err(dev, "failed to parse parent for context %d.\n", i);
continue;
}

@@ -500,13 +499,13 @@ static int plic_probe(struct platform_device *pdev)

error = riscv_of_parent_hartid(parent.np, &hartid);
if (error < 0) {
- pr_warn("failed to parse hart ID for context %d.\n", i);
+ dev_warn(dev, "failed to parse hart ID for context %d.\n", i);
continue;
}

cpu = riscv_hartid_to_cpuid(hartid);
if (cpu < 0) {
- pr_warn("Invalid cpuid for context %d\n", i);
+ dev_warn(dev, "Invalid cpuid for context %d\n", i);
continue;
}

@@ -525,7 +524,7 @@ static int plic_probe(struct platform_device *pdev)
*/
handler = per_cpu_ptr(&plic_handlers, cpu);
if (handler->present) {
- pr_warn("handler already present for context %d.\n", i);
+ dev_warn(dev, "handler already present for context %d.\n", i);
plic_set_threshold(handler, PLIC_DISABLE_THRESHOLD);
goto done;
}
@@ -575,8 +574,8 @@ static int plic_probe(struct platform_device *pdev)
}
}

- pr_info("%pOFP: mapped %d interrupts with %d handlers for %d contexts.\n",
- to_of_node(dev->fwnode), nr_irqs, nr_handlers, nr_contexts);
+ dev_info(dev, "mapped %d interrupts with %d handlers for %d contexts.\n",
+ nr_irqs, nr_handlers, nr_contexts);
return 0;

out_free_enable_reg:
--
2.34.1



2024-02-23 09:45:56

by tip-bot2 for Tony Luck

[permalink] [raw]
Subject: [tip: irq/msi] irqchip/sifive-plic: Use dev_xyz() in-place of pr_xyz()

The following commit has been merged into the irq/msi branch of tip:

Commit-ID: 25d862e183d4efeb5e8b9843d783c90aaae4b14a
Gitweb: https://git.kernel.org/tip/25d862e183d4efeb5e8b9843d783c90aaae4b14a
Author: Anup Patel <[email protected]>
AuthorDate: Thu, 22 Feb 2024 15:09:50 +05:30
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Fri, 23 Feb 2024 10:18:43 +01:00

irqchip/sifive-plic: Use dev_xyz() in-place of pr_xyz()

Use dev_info(), dev_warn(), and dev_err() in-place of pr_info(),
pr_warn(), and pr_err().

Signed-off-by: Anup Patel <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

---
drivers/irqchip/irq-sifive-plic.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index 7400a07..892666f 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -3,7 +3,6 @@
* Copyright (C) 2017 SiFive
* Copyright (C) 2018 Christoph Hellwig
*/
-#define pr_fmt(fmt) "plic: " fmt
#include <linux/cpu.h>
#include <linux/interrupt.h>
#include <linux/io.h>
@@ -371,9 +370,10 @@ static void plic_handle_irq(struct irq_desc *desc)
while ((hwirq = readl(claim))) {
int err = generic_handle_domain_irq(handler->priv->irqdomain,
hwirq);
- if (unlikely(err))
- pr_warn_ratelimited("can't find mapping for hwirq %lu\n",
- hwirq);
+ if (unlikely(err)) {
+ dev_warn_ratelimited(handler->priv->dev,
+ "can't find mapping for hwirq %lu\n", hwirq);
+ }
}

chained_irq_exit(chip, desc);
@@ -401,7 +401,7 @@ static int plic_starting_cpu(unsigned int cpu)
enable_percpu_irq(plic_parent_irq,
irq_get_trigger_type(plic_parent_irq));
else
- pr_warn("cpu%d: parent irq not available\n", cpu);
+ dev_warn(handler->priv->dev, "cpu%d: parent irq not available\n", cpu);
plic_set_threshold(handler, PLIC_ENABLE_THRESHOLD);

return 0;
@@ -477,7 +477,7 @@ static int plic_probe(struct platform_device *pdev)
unsigned long hartid;

if (of_irq_parse_one(to_of_node(dev->fwnode), i, &parent)) {
- pr_err("failed to parse parent for context %d.\n", i);
+ dev_err(dev, "failed to parse parent for context %d.\n", i);
continue;
}

@@ -500,13 +500,13 @@ static int plic_probe(struct platform_device *pdev)

error = riscv_of_parent_hartid(parent.np, &hartid);
if (error < 0) {
- pr_warn("failed to parse hart ID for context %d.\n", i);
+ dev_warn(dev, "failed to parse hart ID for context %d.\n", i);
continue;
}

cpu = riscv_hartid_to_cpuid(hartid);
if (cpu < 0) {
- pr_warn("Invalid cpuid for context %d\n", i);
+ dev_warn(dev, "Invalid cpuid for context %d\n", i);
continue;
}

@@ -525,7 +525,7 @@ static int plic_probe(struct platform_device *pdev)
*/
handler = per_cpu_ptr(&plic_handlers, cpu);
if (handler->present) {
- pr_warn("handler already present for context %d.\n", i);
+ dev_warn(dev, "handler already present for context %d.\n", i);
plic_set_threshold(handler, PLIC_DISABLE_THRESHOLD);
goto done;
}
@@ -575,8 +575,8 @@ done:
}
}

- pr_info("%pOFP: mapped %d interrupts with %d handlers for %d contexts.\n",
- to_of_node(dev->fwnode), nr_irqs, nr_handlers, nr_contexts);
+ dev_info(dev, "mapped %d interrupts with %d handlers for %d contexts.\n",
+ nr_irqs, nr_handlers, nr_contexts);
return 0;

out_free_enable_reg: