Skip to contentSkip to conversation

staging: axis-fifo: simplify resource mapping

PATCH In review Josh Law 3 participants 8 messages Mar 1 – Mar 2 Staging

lore
Share & tools
lore

Josh Law

author
#0 lore raw

PATCH 1/3 staging: axis-fifo: simplify resource mapping

Use devm_platform_ioremap_resource() to simplify the code and remove the unused struct resource pointer.

---
 drivers/staging/axis-fifo/axis-fifo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/axis-fifo/axis-fifo.c +1 -2
index d83a0fd5b231..fc8e35696b31 100644
@@ -450,7 +450,6 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 
 static int axis_fifo_probe(struct platform_device *pdev)
 {
-	struct resource *r_mem;
 	struct device *dev = &pdev->dev;
 	struct axis_fifo *fifo = NULL;
 	int rc = 0; /* error return value */
@@ -469,7 +468,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
 	mutex_init(&fifo->read_lock);
 	mutex_init(&fifo->write_lock);
 
-	fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
+	fifo->base_addr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(fifo->base_addr))
 		return PTR_ERR(fifo->base_addr);
 
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 2/3 staging: axis-fifo: use dev_err_probe() for IRQ error handling

Simplify the error handling in the probe function by using dev_err_probe() instead of dev_err() when devm_request_irq() fails.

---
 drivers/staging/axis-fifo/axis-fifo.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/axis-fifo/axis-fifo.c +3 -5
index fc8e35696b31..28268881cda2 100644
@@ -484,11 +484,9 @@ static int axis_fifo_probe(struct platform_device *pdev)
 
 	rc = devm_request_irq(fifo->dt_device, irq, &axis_fifo_irq, 0,
 			      DRIVER_NAME, fifo);
-	if (rc) {
-		dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n",
-			irq);
-		return rc;
-	}
+	if (rc)
+		return dev_err_probe(fifo->dt_device, rc,
+				     "couldn't allocate interrupt %i\n", irq);
 
 	fifo->id = ida_alloc(&axis_fifo_ida, GFP_KERNEL);
 	if (fifo->id < 0)
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH 3/3 staging: axis-fifo: improve IRQ handler

In reply to Josh Law

Return IRQ_NONE when no interrupts were triggered to avoid spurious interrupt storms, and only clear the active interrupts instead of blindly clearing all interrupts by writing 'intr' to the ISR instead of XLLF_INT_CLEAR_ALL.

---
 drivers/staging/axis-fifo/axis-fifo.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/axis-fifo/axis-fifo.c +4 -1
index 28268881cda2..aad2206b481a 100644
@@ -302,6 +302,9 @@ static irqreturn_t axis_fifo_irq(int irq, void *dw)
 	isr = ioread32(fifo->base_addr + XLLF_ISR_OFFSET);
 	intr = ier & isr;
 
+	if (!intr)
+		return IRQ_NONE;
+
 	if (intr & XLLF_INT_RC_MASK)
 		wake_up(&fifo->read_queue);
 
@@ -324,7 +327,7 @@ static irqreturn_t axis_fifo_irq(int irq, void *dw)
 		dev_err(fifo->dt_device,
 			"transmit length mismatch error interrupt\n");
 
-	iowrite32(XLLF_INT_CLEAR_ALL, fifo->base_addr + XLLF_ISR_OFFSET);
+	iowrite32(intr, fifo->base_addr + XLLF_ISR_OFFSET);
 
 	return IRQ_HANDLED;
 }
Signature · 1 line
2.43.0
#4 lore raw
In reply to Josh Law
Quoted 4 lines · Josh Law

Use devm_platform_ioremap_resource() to simplify the code and remove the unused struct resource pointer.

---

I've already told you your patches will *not* be accepted if your from:
and SOB do not match, there is actually legal precedent.

Thanks,

ET

author
#5 lore raw

2 Mar 2026 21:31:31 Ethan Tidmore <[email protected]>:

Quoted 6 lines · Josh Law
Quoted 4 lines

Use devm_platform_ioremap_resource() to simplify the code and remove the unused struct resource pointer.

---

Quoted 6 lines

I've already told you your patches will *not* be accepted if your from:
and SOB do not match, there is actually legal precedent.

Thanks,

ET

Man.... Check my V2 patches, they are all fixed, Please..

#6 lore raw
Quoted 8 lines · Josh Law

2 Mar 2026 21:31:31 Ethan Tidmore <[email protected]>:

Quoted 6 lines · Josh Law
Quoted 4 lines

Use devm_platform_ioremap_resource() to simplify the code and remove the unused struct resource pointer.

---

Quoted 8 lines
Quoted 6 lines

I've already told you your patches will *not* be accepted if your from:
and SOB do not match, there is actually legal precedent.

Thanks,

ET

Man.... Check my V2 patches, they are all fixed, Please..

Sorry about that, just realized this is the old. Dan's message made this pop up.

Thanks,

Et

author
#7 lore raw

2 Mar 2026 21:38:35 Ethan Tidmore <[email protected]>:

Quoted 16 lines · Josh Law
Quoted 15 lines

2 Mar 2026 21:31:31 Ethan Tidmore <[email protected]>:

Quoted 12 lines · Josh Law
Quoted 4 lines

Use devm_platform_ioremap_resource() to simplify the code and remove the unused struct resource pointer.

---

I've already told you your patches will *not* be accepted if your from:
and SOB do not match, there is actually legal precedent.

Thanks,

ET

Quoted 8 lines
Quoted 1 line

Man.... Check my V2 patches, they are all fixed, Please..

Sorry about that, just realized this is the old. Dan's message made this pop up.

Thanks,

Et

Well, at least one has to be merged haha, I think 2-3 has issues (according to Dan), but I will fix those tomorrow

Thanks

V/R

Josh law