linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mtd: nand: Use platform_get_irq*() variants to fetch IRQ's
@ 2021-12-21 21:26 Lad Prabhakar
  2021-12-21 21:26 ` [PATCH 1/2] mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt Lad Prabhakar
  2021-12-21 21:26 ` [PATCH 2/2] mtd: rawnand: gpmi: Use platform_get_irq_byname() " Lad Prabhakar
  0 siblings, 2 replies; 5+ messages in thread
From: Lad Prabhakar @ 2021-12-21 21:26 UTC (permalink / raw)
  To: Han Xu, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar

Hi All,

This patch series aims to drop using platform_get_resource*() for IRQ
types in preparation for removal of static setup of IRQ resource from
DT core code.

Dropping usage of platform_get_resource*() was agreed based on
the discussion [0].

[0] https://patchwork.kernel.org/project/linux-renesas-soc/
patch/20211209001056.29774-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

Note: I have just build tested the patches.

Cheers,
Prabhakar

Lad Prabhakar (2):
  mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt
  mtd: rawnand: gpmi: Use platform_get_irq_byname() to get the interrupt

 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 11 ++++-------
 drivers/mtd/nand/raw/omap_elm.c            | 16 +++++++---------
 2 files changed, 11 insertions(+), 16 deletions(-)

-- 
2.17.1


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

* [PATCH 1/2] mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt
  2021-12-21 21:26 [PATCH 0/2] mtd: nand: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
@ 2021-12-21 21:26 ` Lad Prabhakar
  2021-12-22 16:26   ` Miquel Raynal
  2021-12-21 21:26 ` [PATCH 2/2] mtd: rawnand: gpmi: Use platform_get_irq_byname() " Lad Prabhakar
  1 sibling, 1 reply; 5+ messages in thread
From: Lad Prabhakar @ 2021-12-21 21:26 UTC (permalink / raw)
  To: Han Xu, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar

platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/mtd/nand/raw/omap_elm.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/nand/raw/omap_elm.c b/drivers/mtd/nand/raw/omap_elm.c
index 8bab753211e9..db105d9b560c 100644
--- a/drivers/mtd/nand/raw/omap_elm.c
+++ b/drivers/mtd/nand/raw/omap_elm.c
@@ -384,8 +384,8 @@ static irqreturn_t elm_isr(int this_irq, void *dev_id)
 static int elm_probe(struct platform_device *pdev)
 {
 	int ret = 0;
-	struct resource *irq;
 	struct elm_info *info;
+	int irq;
 
 	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
 	if (!info)
@@ -393,20 +393,18 @@ static int elm_probe(struct platform_device *pdev)
 
 	info->dev = &pdev->dev;
 
-	irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!irq) {
-		dev_err(&pdev->dev, "no irq resource defined\n");
-		return -ENODEV;
-	}
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	info->elm_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(info->elm_base))
 		return PTR_ERR(info->elm_base);
 
-	ret = devm_request_irq(&pdev->dev, irq->start, elm_isr, 0,
-			pdev->name, info);
+	ret = devm_request_irq(&pdev->dev, irq, elm_isr, 0,
+			       pdev->name, info);
 	if (ret) {
-		dev_err(&pdev->dev, "failure requesting %pr\n", irq);
+		dev_err(&pdev->dev, "failure requesting %d\n", irq);
 		return ret;
 	}
 
-- 
2.17.1


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

* [PATCH 2/2] mtd: rawnand: gpmi: Use platform_get_irq_byname() to get the interrupt
  2021-12-21 21:26 [PATCH 0/2] mtd: nand: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
  2021-12-21 21:26 ` [PATCH 1/2] mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2021-12-21 21:26 ` Lad Prabhakar
  2021-12-22 16:26   ` Miquel Raynal
  1 sibling, 1 reply; 5+ messages in thread
From: Lad Prabhakar @ 2021-12-21 21:26 UTC (permalink / raw)
  To: Han Xu, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	linux-mtd
  Cc: Rob Herring, linux-kernel, Prabhakar, Lad Prabhakar

platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_byname().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
index feccff8bdd15..1b64c5a5140d 100644
--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
@@ -991,16 +991,13 @@ static int acquire_bch_irq(struct gpmi_nand_data *this, irq_handler_t irq_h)
 {
 	struct platform_device *pdev = this->pdev;
 	const char *res_name = GPMI_NAND_BCH_INTERRUPT_RES_NAME;
-	struct resource *r;
 	int err;
 
-	r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, res_name);
-	if (!r) {
-		dev_err(this->dev, "Can't get resource for %s\n", res_name);
-		return -ENODEV;
-	}
+	err = platform_get_irq_byname(pdev, res_name);
+	if (err < 0)
+		return err;
 
-	err = devm_request_irq(this->dev, r->start, irq_h, 0, res_name, this);
+	err = devm_request_irq(this->dev, err, irq_h, 0, res_name, this);
 	if (err)
 		dev_err(this->dev, "error requesting BCH IRQ\n");
 
-- 
2.17.1


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

* Re: [PATCH 2/2] mtd: rawnand: gpmi: Use platform_get_irq_byname() to get the interrupt
  2021-12-21 21:26 ` [PATCH 2/2] mtd: rawnand: gpmi: Use platform_get_irq_byname() " Lad Prabhakar
@ 2021-12-22 16:26   ` Miquel Raynal
  0 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2021-12-22 16:26 UTC (permalink / raw)
  To: Lad Prabhakar, Han Xu, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd
  Cc: Rob Herring, linux-kernel, Prabhakar

On Tue, 2021-12-21 at 21:26:09 UTC, Lad Prabhakar wrote:
> platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
> 
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq_byname().
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

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

* Re: [PATCH 1/2] mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt
  2021-12-21 21:26 ` [PATCH 1/2] mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2021-12-22 16:26   ` Miquel Raynal
  0 siblings, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2021-12-22 16:26 UTC (permalink / raw)
  To: Lad Prabhakar, Han Xu, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd
  Cc: Rob Herring, linux-kernel, Prabhakar

On Tue, 2021-12-21 at 21:26:08 UTC, Lad Prabhakar wrote:
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
> 
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq().
> 
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

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

end of thread, other threads:[~2021-12-22 16:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 21:26 [PATCH 0/2] mtd: nand: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
2021-12-21 21:26 ` [PATCH 1/2] mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt Lad Prabhakar
2021-12-22 16:26   ` Miquel Raynal
2021-12-21 21:26 ` [PATCH 2/2] mtd: rawnand: gpmi: Use platform_get_irq_byname() " Lad Prabhakar
2021-12-22 16:26   ` Miquel Raynal

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).