public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: AyushMukkanwar <ayushmukkanwar@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	AyushMukkanwar <ayushmukkanwar@gmail.com>
Subject: [PATCH v2 1/2] staging: octeon: ethernet-spi: replace pr_err with dev_err
Date: Tue, 31 Mar 2026 16:47:56 +0530	[thread overview]
Message-ID: <20260331111757.110703-2-ayushmukkanwar@gmail.com> (raw)
In-Reply-To: <20260331111757.110703-1-ayushmukkanwar@gmail.com>

Replace pr_err() calls with dev_err() to include device information
in log messages. The device pointer is passed through the interrupt
handler via dev_id, which is changed from &number_spi_ports to
dev->dev.parent in request_irq and free_irq.

Signed-off-by: AyushMukkanwar <ayushmukkanwar@gmail.com>
---
 drivers/staging/octeon/ethernet-spi.c | 59 ++++++++++++++-------------
 1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-spi.c b/drivers/staging/octeon/ethernet-spi.c
index 699c98c5ec13..8c02920c3cdc 100644
--- a/drivers/staging/octeon/ethernet-spi.c
+++ b/drivers/staging/octeon/ethernet-spi.c
@@ -17,67 +17,67 @@
 static int number_spi_ports;
 static int need_retrain[2] = { 0, 0 };
 
-static void cvm_oct_spxx_int_pr(union cvmx_spxx_int_reg spx_int_reg, int index)
+static void cvm_oct_spxx_int_pr(union cvmx_spxx_int_reg spx_int_reg, int index, struct device *dev)
 {
 	if (spx_int_reg.s.spf)
-		pr_err("SPI%d: SRX Spi4 interface down\n", index);
+		dev_err(dev, "SPI%d: SRX Spi4 interface down\n", index);
 	if (spx_int_reg.s.calerr)
-		pr_err("SPI%d: SRX Spi4 Calendar table parity error\n", index);
+		dev_err(dev, "SPI%d: SRX Spi4 Calendar table parity error\n", index);
 	if (spx_int_reg.s.syncerr)
-		pr_err("SPI%d: SRX Consecutive Spi4 DIP4 errors have exceeded SPX_ERR_CTL[ERRCNT]\n",
+		dev_err(dev, "SPI%d: SRX Consecutive Spi4 DIP4 errors have exceeded SPX_ERR_CTL[ERRCNT]\n",
 		       index);
 	if (spx_int_reg.s.diperr)
-		pr_err("SPI%d: SRX Spi4 DIP4 error\n", index);
+		dev_err(dev, "SPI%d: SRX Spi4 DIP4 error\n", index);
 	if (spx_int_reg.s.tpaovr)
-		pr_err("SPI%d: SRX Selected port has hit TPA overflow\n",
+		dev_err(dev, "SPI%d: SRX Selected port has hit TPA overflow\n",
 		       index);
 	if (spx_int_reg.s.rsverr)
-		pr_err("SPI%d: SRX Spi4 reserved control word detected\n",
+		dev_err(dev, "SPI%d: SRX Spi4 reserved control word detected\n",
 		       index);
 	if (spx_int_reg.s.drwnng)
-		pr_err("SPI%d: SRX Spi4 receive FIFO drowning/overflow\n",
+		dev_err(dev, "SPI%d: SRX Spi4 receive FIFO drowning/overflow\n",
 		       index);
 	if (spx_int_reg.s.clserr)
-		pr_err("SPI%d: SRX Spi4 packet closed on non-16B alignment without EOP\n",
+		dev_err(dev, "SPI%d: SRX Spi4 packet closed on non-16B alignment without EOP\n",
 		       index);
 	if (spx_int_reg.s.spiovr)
-		pr_err("SPI%d: SRX Spi4 async FIFO overflow\n", index);
+		dev_err(dev, "SPI%d: SRX Spi4 async FIFO overflow\n", index);
 	if (spx_int_reg.s.abnorm)
-		pr_err("SPI%d: SRX Abnormal packet termination (ERR bit)\n",
+		dev_err(dev, "SPI%d: SRX Abnormal packet termination (ERR bit)\n",
 		       index);
 	if (spx_int_reg.s.prtnxa)
-		pr_err("SPI%d: SRX Port out of range\n", index);
+		dev_err(dev, "SPI%d: SRX Port out of range\n", index);
 }
 
-static void cvm_oct_stxx_int_pr(union cvmx_stxx_int_reg stx_int_reg, int index)
+static void cvm_oct_stxx_int_pr(union cvmx_stxx_int_reg stx_int_reg, int index, struct device *dev)
 {
 	if (stx_int_reg.s.syncerr)
-		pr_err("SPI%d: STX Interface encountered a fatal error\n",
+		dev_err(dev, "SPI%d: STX Interface encountered a fatal error\n",
 		       index);
 	if (stx_int_reg.s.frmerr)
-		pr_err("SPI%d: STX FRMCNT has exceeded STX_DIP_CNT[MAXFRM]\n",
+		dev_err(dev, "SPI%d: STX FRMCNT has exceeded STX_DIP_CNT[MAXFRM]\n",
 		       index);
 	if (stx_int_reg.s.unxfrm)
-		pr_err("SPI%d: STX Unexpected framing sequence\n", index);
+		dev_err(dev, "SPI%d: STX Unexpected framing sequence\n", index);
 	if (stx_int_reg.s.nosync)
-		pr_err("SPI%d: STX ERRCNT has exceeded STX_DIP_CNT[MAXDIP]\n",
+		dev_err(dev, "SPI%d: STX ERRCNT has exceeded STX_DIP_CNT[MAXDIP]\n",
 		       index);
 	if (stx_int_reg.s.diperr)
-		pr_err("SPI%d: STX DIP2 error on the Spi4 Status channel\n",
+		dev_err(dev, "SPI%d: STX DIP2 error on the Spi4 Status channel\n",
 		       index);
 	if (stx_int_reg.s.datovr)
-		pr_err("SPI%d: STX Spi4 FIFO overflow error\n", index);
+		dev_err(dev, "SPI%d: STX Spi4 FIFO overflow error\n", index);
 	if (stx_int_reg.s.ovrbst)
-		pr_err("SPI%d: STX Transmit packet burst too big\n", index);
+		dev_err(dev, "SPI%d: STX Transmit packet burst too big\n", index);
 	if (stx_int_reg.s.calpar1)
-		pr_err("SPI%d: STX Calendar Table Parity Error Bank%d\n",
+		dev_err(dev, "SPI%d: STX Calendar Table Parity Error Bank%d\n",
 		       index, 1);
 	if (stx_int_reg.s.calpar0)
-		pr_err("SPI%d: STX Calendar Table Parity Error Bank%d\n",
+		dev_err(dev, "SPI%d: STX Calendar Table Parity Error Bank%d\n",
 		       index, 0);
 }
 
-static irqreturn_t cvm_oct_spi_spx_int(int index)
+static irqreturn_t cvm_oct_spi_spx_int(int index, struct device *dev)
 {
 	union cvmx_spxx_int_reg spx_int_reg;
 	union cvmx_stxx_int_reg stx_int_reg;
@@ -86,14 +86,14 @@ static irqreturn_t cvm_oct_spi_spx_int(int index)
 	cvmx_write_csr(CVMX_SPXX_INT_REG(index), spx_int_reg.u64);
 	if (!need_retrain[index]) {
 		spx_int_reg.u64 &= cvmx_read_csr(CVMX_SPXX_INT_MSK(index));
-		cvm_oct_spxx_int_pr(spx_int_reg, index);
+		cvm_oct_spxx_int_pr(spx_int_reg, index, dev);
 	}
 
 	stx_int_reg.u64 = cvmx_read_csr(CVMX_STXX_INT_REG(index));
 	cvmx_write_csr(CVMX_STXX_INT_REG(index), stx_int_reg.u64);
 	if (!need_retrain[index]) {
 		stx_int_reg.u64 &= cvmx_read_csr(CVMX_STXX_INT_MSK(index));
-		cvm_oct_stxx_int_pr(stx_int_reg, index);
+		cvm_oct_stxx_int_pr(stx_int_reg, index, dev);
 	}
 
 	cvmx_write_csr(CVMX_SPXX_INT_MSK(index), 0);
@@ -107,14 +107,15 @@ static irqreturn_t cvm_oct_spi_rml_interrupt(int cpl, void *dev_id)
 {
 	irqreturn_t return_status = IRQ_NONE;
 	union cvmx_npi_rsl_int_blocks rsl_int_blocks;
+	struct device *dev = dev_id;
 
 	/* Check and see if this interrupt was caused by the GMX block */
 	rsl_int_blocks.u64 = cvmx_read_csr(CVMX_NPI_RSL_INT_BLOCKS);
 	if (rsl_int_blocks.s.spx1) /* 19 - SPX1_INT_REG & STX1_INT_REG */
-		return_status = cvm_oct_spi_spx_int(1);
+		return_status = cvm_oct_spi_spx_int(1, dev);
 
 	if (rsl_int_blocks.s.spx0) /* 18 - SPX0_INT_REG & STX0_INT_REG */
-		return_status = cvm_oct_spi_spx_int(0);
+		return_status = cvm_oct_spi_spx_int(0, dev);
 
 	return return_status;
 }
@@ -196,7 +197,7 @@ int cvm_oct_spi_init(struct net_device *dev)
 
 	if (number_spi_ports == 0) {
 		r = request_irq(OCTEON_IRQ_RML, cvm_oct_spi_rml_interrupt,
-				IRQF_SHARED, "SPI", &number_spi_ports);
+				IRQF_SHARED, "SPI", dev->dev.parent);
 		if (r)
 			return r;
 	}
@@ -221,6 +222,6 @@ void cvm_oct_spi_uninit(struct net_device *dev)
 			cvmx_write_csr(CVMX_SPXX_INT_MSK(interface), 0);
 			cvmx_write_csr(CVMX_STXX_INT_MSK(interface), 0);
 		}
-		free_irq(OCTEON_IRQ_RML, &number_spi_ports);
+		free_irq(OCTEON_IRQ_RML, dev->dev.parent);
 	}
 }
-- 
2.53.0


  reply	other threads:[~2026-03-31 11:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 13:30 [PATCH 0/3] staging: octeon: add pr_fmt macro to ethernet drivers AyushMukkanwar
2026-03-24 13:30 ` [PATCH 1/3] staging: octeon: ethernet-mem: add pr_fmt macro AyushMukkanwar
2026-03-24 13:30 ` [PATCH 2/3] staging: octeon: ethernet-spi: " AyushMukkanwar
2026-03-24 13:30 ` [PATCH 3/3] staging: octeon: ethernet: " AyushMukkanwar
2026-03-24 14:28   ` Greg KH
2026-03-25  9:03     ` Ayush Mukkanwar
2026-03-25  9:11       ` Greg KH
2026-03-25 19:12         ` Ayush Mukkanwar
2026-03-30 15:56           ` Greg KH
2026-03-31  7:16             ` Ayush Mukkanwar
2026-03-31  8:28               ` Greg KH
2026-03-31 11:17                 ` [PATCH v2 0/2] staging: octeon: replace pr_*() calls with dev_*() and netdev_*() AyushMukkanwar
2026-03-31 11:17                   ` AyushMukkanwar [this message]
2026-04-01 10:09                     ` [PATCH v2 1/2] staging: octeon: ethernet-spi: replace pr_err with dev_err Greg KH
2026-04-04  9:17                       ` Ayush Mukkanwar
2026-04-04  9:20                       ` Ayush Mukkanwar
2026-04-05  8:02                         ` Greg KH
2026-03-31 11:17                   ` [PATCH v2 2/2] staging: octeon: ethernet: replace pr_* with dev_* and netdev_* AyushMukkanwar
2026-04-01  1:10                     ` kernel test robot
2026-04-01  9:32                     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260331111757.110703-2-ayushmukkanwar@gmail.com \
    --to=ayushmukkanwar@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox