lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC Patch net-next v3 1/3] net: dsa: microchip: use dev_ops->reset instead of exit in ksz_switch_register
Date
ksz8_switch_exit, ksz9477_switch_exit and lan937x_switch_exit functions
all call the reset function which is assigned to dev_ops->reset hooks.
So instead of calling the dev_ops->exit in ksz_switch_register during
the error condition of dsa_register_switch, dev_ops->reset is used now.
The dev_ops->exit can be extended in lan937x for freeing up the irq
during the ksz_spi_remove. If we add the irq remove in the exit function
and it is called during the dsa_switch_register error condition, kernel
panic happens since irq is setup only in setup operation. To avoid the
kernel panic, dev_ops->reset is used instead of exit.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
---
drivers/net/dsa/microchip/ksz_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 6bd69a7e6809..da9bdf753f7a 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -1963,7 +1963,7 @@ int ksz_switch_register(struct ksz_device *dev)

ret = dsa_register_switch(dev->ds);
if (ret) {
- dev->dev_ops->exit(dev);
+ dev->dev_ops->reset(dev);
return ret;
}

--
2.36.1
\
 
 \ /
  Last update: 2022-08-30 12:54    [W:0.495 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site