linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] irqchip: sunxi-nmi: misc. / aesthetic improvements
@ 2015-10-05 16:42 Chen-Yu Tsai
  2015-10-05 16:42 ` [PATCH v2 1/2] irqchip: sunxi-nmi: Use driver name instead of DT node name for identification Chen-Yu Tsai
  2015-10-05 16:42 ` [PATCH v2 2/2] irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap() Chen-Yu Tsai
  0 siblings, 2 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2015-10-05 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-kernel, linux-arm-kernel

Hi everyone,

This is v2 of my sunxi-nmi aesthetic improvement series.

sunxi-nmi uses its DT node name, which is normally "interrupt-controller",
as its irqchip name. This only serves to confuse the user when one sees
"interrupt-controller" in /sys/kernel/debug/irq_domain_mapping or
/proc/interrupts. We want it to show something more specific, like
"sunxi-nmi". Also do this for the printk calls.

While at it, also switch to the new of_io_request_and_map() call, so the
IO resource is properly held, and also shows up in /proc/iomem.


Changes since v1:

  - Use the "pr_fmt" macro in patch 1, and also remove __func__ from the
    error message in the interrupt type setter, sunxi_sc_nmi_set_type().

  - Update the commit message of patch 1 to reflect the change above.

  - Add a proper commit message for patch 2.


Regards
ChenYu


Chen-Yu Tsai (2):
  irqchip: sunxi-nmi: Use driver name instead of DT node name for
    identification
  irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap()

 drivers/irqchip/irq-sunxi-nmi.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

-- 
2.5.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/2] irqchip: sunxi-nmi: Use driver name instead of DT node name for identification
  2015-10-05 16:42 [PATCH v2 0/2] irqchip: sunxi-nmi: misc. / aesthetic improvements Chen-Yu Tsai
@ 2015-10-05 16:42 ` Chen-Yu Tsai
  2015-10-05 22:03   ` Maxime Ripard
  2015-10-09 20:55   ` [tip:irq/core] irqchip/sunxi-nmi: " tip-bot for Chen-Yu Tsai
  2015-10-05 16:42 ` [PATCH v2 2/2] irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap() Chen-Yu Tsai
  1 sibling, 2 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2015-10-05 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-kernel, linux-arm-kernel

The device tree node name is typically "interrupt-controller", which is
rather useless when used in printk messages and irq chip names for
identification purposes. Use the driver name "sunxi-nmi" instead.

While at it move the identifier from pr_err() calls to the pr_fmt macro.

Also remove the "__func__" identifier from the error message in the
interrupt type setting callback, sunxi_sc_nmi_set_type(). The driver
name in the pr_fmt macro should be enough.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/irqchip/irq-sunxi-nmi.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c
index c143dd58410c..c4f719664c63 100644
--- a/drivers/irqchip/irq-sunxi-nmi.c
+++ b/drivers/irqchip/irq-sunxi-nmi.c
@@ -8,6 +8,9 @@
  * warranty of any kind, whether express or implied.
  */
 
+#define DRV_NAME	"sunxi-nmi"
+#define pr_fmt(fmt)	DRV_NAME ": " fmt
+
 #include <linux/bitops.h>
 #include <linux/device.h>
 #include <linux/io.h>
@@ -96,8 +99,8 @@ static int sunxi_sc_nmi_set_type(struct irq_data *data, unsigned int flow_type)
 		break;
 	default:
 		irq_gc_unlock(gc);
-		pr_err("%s: Cannot assign multiple trigger modes to IRQ %d.\n",
-			__func__, data->irq);
+		pr_err("Cannot assign multiple trigger modes to IRQ %d.\n",
+			data->irq);
 		return -EBADR;
 	}
 
@@ -130,22 +133,21 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
 
 	domain = irq_domain_add_linear(node, 1, &irq_generic_chip_ops, NULL);
 	if (!domain) {
-		pr_err("%s: Could not register interrupt domain.\n", node->name);
+		pr_err("Could not register interrupt domain.\n");
 		return -ENOMEM;
 	}
 
-	ret = irq_alloc_domain_generic_chips(domain, 1, 2, node->name,
+	ret = irq_alloc_domain_generic_chips(domain, 1, 2, DRV_NAME,
 					     handle_fasteoi_irq, clr, 0,
 					     IRQ_GC_INIT_MASK_CACHE);
 	if (ret) {
-		 pr_err("%s: Could not allocate generic interrupt chip.\n",
-			 node->name);
-		 goto fail_irqd_remove;
+		pr_err("Could not allocate generic interrupt chip.\n");
+		goto fail_irqd_remove;
 	}
 
 	irq = irq_of_parse_and_map(node, 0);
 	if (irq <= 0) {
-		pr_err("%s: unable to parse irq\n", node->name);
+		pr_err("unable to parse irq\n");
 		ret = -EINVAL;
 		goto fail_irqd_remove;
 	}
@@ -153,7 +155,7 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
 	gc = irq_get_domain_generic_chip(domain, 0);
 	gc->reg_base = of_iomap(node, 0);
 	if (!gc->reg_base) {
-		pr_err("%s: unable to map resource\n", node->name);
+		pr_err("unable to map resource\n");
 		ret = -ENOMEM;
 		goto fail_irqd_remove;
 	}
-- 
2.5.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap()
  2015-10-05 16:42 [PATCH v2 0/2] irqchip: sunxi-nmi: misc. / aesthetic improvements Chen-Yu Tsai
  2015-10-05 16:42 ` [PATCH v2 1/2] irqchip: sunxi-nmi: Use driver name instead of DT node name for identification Chen-Yu Tsai
@ 2015-10-05 16:42 ` Chen-Yu Tsai
  2015-10-05 22:02   ` Maxime Ripard
  2015-10-09 20:55   ` [tip:irq/core] irqchip/sunxi-nmi: Switch to of_io_request_and_map () " tip-bot for Chen-Yu Tsai
  1 sibling, 2 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2015-10-05 16:42 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier, Maxime Ripard
  Cc: Chen-Yu Tsai, linux-kernel, linux-arm-kernel

Switch to the new of_io_request_and_map() call, so the IO resource is
properly held, and also shows up in /proc/iomem.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/irqchip/irq-sunxi-nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c
index c4f719664c63..4ef178078e5b 100644
--- a/drivers/irqchip/irq-sunxi-nmi.c
+++ b/drivers/irqchip/irq-sunxi-nmi.c
@@ -153,7 +153,7 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
 	}
 
 	gc = irq_get_domain_generic_chip(domain, 0);
-	gc->reg_base = of_iomap(node, 0);
+	gc->reg_base = of_io_request_and_map(node, 0, of_node_full_name(node));
 	if (!gc->reg_base) {
 		pr_err("unable to map resource\n");
 		ret = -ENOMEM;
-- 
2.5.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/2] irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap()
  2015-10-05 16:42 ` [PATCH v2 2/2] irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap() Chen-Yu Tsai
@ 2015-10-05 22:02   ` Maxime Ripard
  2015-10-09 20:55   ` [tip:irq/core] irqchip/sunxi-nmi: Switch to of_io_request_and_map () " tip-bot for Chen-Yu Tsai
  1 sibling, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2015-10-05 22:02 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Thomas Gleixner, Jason Cooper, Marc Zyngier, linux-kernel,
	linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

On Tue, Oct 06, 2015 at 12:42:14AM +0800, Chen-Yu Tsai wrote:
> Switch to the new of_io_request_and_map() call, so the IO resource is
> properly held, and also shows up in /proc/iomem.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 1/2] irqchip: sunxi-nmi: Use driver name instead of DT node name for identification
  2015-10-05 16:42 ` [PATCH v2 1/2] irqchip: sunxi-nmi: Use driver name instead of DT node name for identification Chen-Yu Tsai
@ 2015-10-05 22:03   ` Maxime Ripard
  2015-10-09 20:55   ` [tip:irq/core] irqchip/sunxi-nmi: " tip-bot for Chen-Yu Tsai
  1 sibling, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2015-10-05 22:03 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Thomas Gleixner, Jason Cooper, Marc Zyngier, linux-kernel,
	linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

On Tue, Oct 06, 2015 at 12:42:13AM +0800, Chen-Yu Tsai wrote:
> The device tree node name is typically "interrupt-controller", which is
> rather useless when used in printk messages and irq chip names for
> identification purposes. Use the driver name "sunxi-nmi" instead.
> 
> While at it move the identifier from pr_err() calls to the pr_fmt macro.
> 
> Also remove the "__func__" identifier from the error message in the
> interrupt type setting callback, sunxi_sc_nmi_set_type(). The driver
> name in the pr_fmt macro should be enough.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:irq/core] irqchip/sunxi-nmi: Use driver name instead of DT node name for identification
  2015-10-05 16:42 ` [PATCH v2 1/2] irqchip: sunxi-nmi: Use driver name instead of DT node name for identification Chen-Yu Tsai
  2015-10-05 22:03   ` Maxime Ripard
@ 2015-10-09 20:55   ` tip-bot for Chen-Yu Tsai
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Chen-Yu Tsai @ 2015-10-09 20:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, tglx, jason, linux-kernel, marc.zyngier, wens, maxime.ripard, mingo

Commit-ID:  2d6caaed0997f335ce341703083c989c91ad76f4
Gitweb:     http://git.kernel.org/tip/2d6caaed0997f335ce341703083c989c91ad76f4
Author:     Chen-Yu Tsai <wens@csie.org>
AuthorDate: Tue, 6 Oct 2015 00:42:13 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 9 Oct 2015 22:47:28 +0200

irqchip/sunxi-nmi: Use driver name instead of DT node name for identification

The device tree node name is typically "interrupt-controller", which is
rather useless when used in printk messages and irq chip names for
identification purposes. Use the driver name "sunxi-nmi" instead.

While at it move the identifier from pr_err() calls to the pr_fmt macro.

Also remove the "__func__" identifier from the error message in the
interrupt type setting callback, sunxi_sc_nmi_set_type(). The driver
name in the pr_fmt macro should be enough.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: http://lkml.kernel.org/r/1444063334-19832-2-git-send-email-wens@csie.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/irqchip/irq-sunxi-nmi.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c
index c143dd5..c4f7196 100644
--- a/drivers/irqchip/irq-sunxi-nmi.c
+++ b/drivers/irqchip/irq-sunxi-nmi.c
@@ -8,6 +8,9 @@
  * warranty of any kind, whether express or implied.
  */
 
+#define DRV_NAME	"sunxi-nmi"
+#define pr_fmt(fmt)	DRV_NAME ": " fmt
+
 #include <linux/bitops.h>
 #include <linux/device.h>
 #include <linux/io.h>
@@ -96,8 +99,8 @@ static int sunxi_sc_nmi_set_type(struct irq_data *data, unsigned int flow_type)
 		break;
 	default:
 		irq_gc_unlock(gc);
-		pr_err("%s: Cannot assign multiple trigger modes to IRQ %d.\n",
-			__func__, data->irq);
+		pr_err("Cannot assign multiple trigger modes to IRQ %d.\n",
+			data->irq);
 		return -EBADR;
 	}
 
@@ -130,22 +133,21 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
 
 	domain = irq_domain_add_linear(node, 1, &irq_generic_chip_ops, NULL);
 	if (!domain) {
-		pr_err("%s: Could not register interrupt domain.\n", node->name);
+		pr_err("Could not register interrupt domain.\n");
 		return -ENOMEM;
 	}
 
-	ret = irq_alloc_domain_generic_chips(domain, 1, 2, node->name,
+	ret = irq_alloc_domain_generic_chips(domain, 1, 2, DRV_NAME,
 					     handle_fasteoi_irq, clr, 0,
 					     IRQ_GC_INIT_MASK_CACHE);
 	if (ret) {
-		 pr_err("%s: Could not allocate generic interrupt chip.\n",
-			 node->name);
-		 goto fail_irqd_remove;
+		pr_err("Could not allocate generic interrupt chip.\n");
+		goto fail_irqd_remove;
 	}
 
 	irq = irq_of_parse_and_map(node, 0);
 	if (irq <= 0) {
-		pr_err("%s: unable to parse irq\n", node->name);
+		pr_err("unable to parse irq\n");
 		ret = -EINVAL;
 		goto fail_irqd_remove;
 	}
@@ -153,7 +155,7 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
 	gc = irq_get_domain_generic_chip(domain, 0);
 	gc->reg_base = of_iomap(node, 0);
 	if (!gc->reg_base) {
-		pr_err("%s: unable to map resource\n", node->name);
+		pr_err("unable to map resource\n");
 		ret = -ENOMEM;
 		goto fail_irqd_remove;
 	}

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [tip:irq/core] irqchip/sunxi-nmi: Switch to of_io_request_and_map () from of_iomap()
  2015-10-05 16:42 ` [PATCH v2 2/2] irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap() Chen-Yu Tsai
  2015-10-05 22:02   ` Maxime Ripard
@ 2015-10-09 20:55   ` tip-bot for Chen-Yu Tsai
  1 sibling, 0 replies; 7+ messages in thread
From: tip-bot for Chen-Yu Tsai @ 2015-10-09 20:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, maxime.ripard, tglx, jason, linux-kernel, wens, marc.zyngier, hpa

Commit-ID:  0e841b04c829f59a5d5745f98d2857f48882efe9
Gitweb:     http://git.kernel.org/tip/0e841b04c829f59a5d5745f98d2857f48882efe9
Author:     Chen-Yu Tsai <wens@csie.org>
AuthorDate: Tue, 6 Oct 2015 00:42:14 +0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 9 Oct 2015 22:47:28 +0200

irqchip/sunxi-nmi: Switch to of_io_request_and_map() from of_iomap()

Switch to the new of_io_request_and_map() call, so the IO resource is
properly held, and also shows up in /proc/iomem.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Cc: linux-arm-kernel@lists.infradead.org
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: http://lkml.kernel.org/r/1444063334-19832-3-git-send-email-wens@csie.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/irqchip/irq-sunxi-nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c
index c4f7196..4ef1780 100644
--- a/drivers/irqchip/irq-sunxi-nmi.c
+++ b/drivers/irqchip/irq-sunxi-nmi.c
@@ -153,7 +153,7 @@ static int __init sunxi_sc_nmi_irq_init(struct device_node *node,
 	}
 
 	gc = irq_get_domain_generic_chip(domain, 0);
-	gc->reg_base = of_iomap(node, 0);
+	gc->reg_base = of_io_request_and_map(node, 0, of_node_full_name(node));
 	if (!gc->reg_base) {
 		pr_err("unable to map resource\n");
 		ret = -ENOMEM;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-09 20:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05 16:42 [PATCH v2 0/2] irqchip: sunxi-nmi: misc. / aesthetic improvements Chen-Yu Tsai
2015-10-05 16:42 ` [PATCH v2 1/2] irqchip: sunxi-nmi: Use driver name instead of DT node name for identification Chen-Yu Tsai
2015-10-05 22:03   ` Maxime Ripard
2015-10-09 20:55   ` [tip:irq/core] irqchip/sunxi-nmi: " tip-bot for Chen-Yu Tsai
2015-10-05 16:42 ` [PATCH v2 2/2] irqchip: sunxi-nmi: switch to of_io_request_and_map() from of_iomap() Chen-Yu Tsai
2015-10-05 22:02   ` Maxime Ripard
2015-10-09 20:55   ` [tip:irq/core] irqchip/sunxi-nmi: Switch to of_io_request_and_map () " tip-bot for Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).