Use netdev_err() instead of dev_err() to avoid accessing the spidev->dev
in the interrupt handler. This is the only place which uses the spidev
in this function, so replace it with netdev_err() to get rid of it. This
is done in preparation for unifying the KS8851 SPI and parallel drivers.

Reviewed-by: Andrew Lunn <and...@lunn.ch>
Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: David S. Miller <da...@davemloft.net>
Cc: Lukas Wunner <lu...@wunner.de>
Cc: Petr Stetiar <yn...@true.cz>
Cc: YueHaibing <yuehaib...@huawei.com>
---
V2: Add RB from Andrew
V3: No change
V4: No change
V5: No change
---
 drivers/net/ethernet/micrel/ks8851.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/micrel/ks8851.c 
b/drivers/net/ethernet/micrel/ks8851.c
index 2b85072993c5..0088df970ad6 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -631,7 +631,7 @@ static irqreturn_t ks8851_irq(int irq, void *_ks)
                handled |= IRQ_RXI;
 
        if (status & IRQ_SPIBEI) {
-               dev_err(&ks->spidev->dev, "%s: spi bus error\n", __func__);
+               netdev_err(ks->netdev, "%s: spi bus error\n", __func__);
                handled |= IRQ_SPIBEI;
        }
 
-- 
2.25.1

Reply via email to