mirror of
https://github.com/t2linux/kernel.git
synced 2026-04-30 13:48:59 -07:00
Merge tag 'net-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski:
"Current release - regressions:
- dsa: bcm_sf2: fix array overrun in bcm_sf2_num_active_ports()
Previous releases - regressions:
- introduce a shutdown method to mdio device drivers, and make DSA
switch drivers compatible with masters disappearing on shutdown;
preventing infinite reference wait
- fix issues in mdiobus users related to ->shutdown vs ->remove
- virtio-net: fix pages leaking when building skb in big mode
- xen-netback: correct success/error reporting for the
SKB-with-fraglist
- dsa: tear down devlink port regions when tearing down the devlink
port on error
- nexthop: fix division by zero while replacing a resilient group
- hns3: check queue, vf, vlan ids range before using
Previous releases - always broken:
- napi: fix race against netpoll causing NAPI getting stuck
- mlx4_en: ensure link operstate is updated even if link comes up
before netdev registration
- bnxt_en: fix TX timeout when TX ring size is set to the smallest
- enetc: fix illegal access when reading affinity_hint; prevent oops
on sysfs access
- mtk_eth_soc: avoid creating duplicate offload entries
Misc:
- core: correct the sock::sk_lock.owned lockdep annotations"
* tag 'net-5.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (51 commits)
atlantic: Fix issue in the pm resume flow.
net/mlx4_en: Don't allow aRFS for encapsulated packets
net: mscc: ocelot: fix forwarding from BLOCKING ports remaining enabled
net: ethernet: mtk_eth_soc: avoid creating duplicate offload entries
nfc: st-nci: Add SPI ID matching DT compatible
MAINTAINERS: remove Guvenc Gulce as net/smc maintainer
nexthop: Fix memory leaks in nexthop notification chain listeners
mptcp: ensure tx skbs always have the MPTCP ext
qed: rdma - don't wait for resources under hw error recovery flow
s390/qeth: fix deadlock during failing recovery
s390/qeth: Fix deadlock in remove_discipline
s390/qeth: fix NULL deref in qeth_clear_working_pool_list()
net: dsa: realtek: register the MDIO bus under devres
net: dsa: don't allocate the slave_mii_bus using devres
Doc: networking: Fox a typo in ice.rst
net: dsa: fix dsa_tree_setup error path
net/smc: fix 'workqueue leaked lock' in smc_conn_abort_work
net/smc: add missing error check in smc_clc_prfx_set()
net: hns3: fix a return value error in hclge_get_reset_status()
net: hns3: check vlan id before using it
...
This commit is contained in:
@@ -851,7 +851,7 @@ NOTES:
|
||||
- 0x88A8 traffic will not be received unless VLAN stripping is disabled with
|
||||
the following command::
|
||||
|
||||
# ethool -K <ethX> rxvlan off
|
||||
# ethtool -K <ethX> rxvlan off
|
||||
|
||||
- 0x88A8/0x8100 double VLANs cannot be used with 0x8100 or 0x8100/0x8100 VLANS
|
||||
configured on the same port. 0x88a8/0x8100 traffic will not be received if
|
||||
|
||||
@@ -16955,7 +16955,6 @@ F: drivers/misc/sgi-xp/
|
||||
|
||||
SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
|
||||
M: Karsten Graul <kgraul@linux.ibm.com>
|
||||
M: Guvenc Gulce <guvenc@linux.ibm.com>
|
||||
L: linux-s390@vger.kernel.org
|
||||
S: Supported
|
||||
W: http://www.ibm.com/developerworks/linux/linux390/
|
||||
|
||||
@@ -55,7 +55,7 @@ int ccwgroup_create_dev(struct device *root, struct ccwgroup_driver *gdrv,
|
||||
int num_devices, const char *buf);
|
||||
|
||||
extern int ccwgroup_set_online(struct ccwgroup_device *gdev);
|
||||
extern int ccwgroup_set_offline(struct ccwgroup_device *gdev);
|
||||
int ccwgroup_set_offline(struct ccwgroup_device *gdev, bool call_gdrv);
|
||||
|
||||
extern int ccwgroup_probe_ccwdev(struct ccw_device *cdev);
|
||||
extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);
|
||||
|
||||
@@ -351,9 +351,25 @@ static int b53_mdio_probe(struct mdio_device *mdiodev)
|
||||
static void b53_mdio_remove(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct b53_device *dev = dev_get_drvdata(&mdiodev->dev);
|
||||
struct dsa_switch *ds = dev->ds;
|
||||
|
||||
dsa_unregister_switch(ds);
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
b53_switch_remove(dev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void b53_mdio_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct b53_device *dev = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id b53_of_match[] = {
|
||||
@@ -373,6 +389,7 @@ MODULE_DEVICE_TABLE(of, b53_of_match);
|
||||
static struct mdio_driver b53_mdio_driver = {
|
||||
.probe = b53_mdio_probe,
|
||||
.remove = b53_mdio_remove,
|
||||
.shutdown = b53_mdio_shutdown,
|
||||
.mdiodrv.driver = {
|
||||
.name = "bcm53xx",
|
||||
.of_match_table = b53_of_match,
|
||||
|
||||
@@ -316,9 +316,21 @@ static int b53_mmap_remove(struct platform_device *pdev)
|
||||
if (dev)
|
||||
b53_switch_remove(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b53_mmap_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct b53_device *dev = platform_get_drvdata(pdev);
|
||||
|
||||
if (dev)
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id b53_mmap_of_table[] = {
|
||||
{ .compatible = "brcm,bcm3384-switch" },
|
||||
{ .compatible = "brcm,bcm6328-switch" },
|
||||
@@ -331,6 +343,7 @@ MODULE_DEVICE_TABLE(of, b53_mmap_of_table);
|
||||
static struct platform_driver b53_mmap_driver = {
|
||||
.probe = b53_mmap_probe,
|
||||
.remove = b53_mmap_remove,
|
||||
.shutdown = b53_mmap_shutdown,
|
||||
.driver = {
|
||||
.name = "b53-switch",
|
||||
.of_match_table = b53_mmap_of_table,
|
||||
|
||||
@@ -228,6 +228,11 @@ static inline void b53_switch_remove(struct b53_device *dev)
|
||||
dsa_unregister_switch(dev->ds);
|
||||
}
|
||||
|
||||
static inline void b53_switch_shutdown(struct b53_device *dev)
|
||||
{
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
}
|
||||
|
||||
#define b53_build_op(type_op_size, val_type) \
|
||||
static inline int b53_##type_op_size(struct b53_device *dev, u8 page, \
|
||||
u8 reg, val_type val) \
|
||||
|
||||
@@ -321,9 +321,21 @@ static int b53_spi_remove(struct spi_device *spi)
|
||||
if (dev)
|
||||
b53_switch_remove(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b53_spi_shutdown(struct spi_device *spi)
|
||||
{
|
||||
struct b53_device *dev = spi_get_drvdata(spi);
|
||||
|
||||
if (dev)
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id b53_spi_of_match[] = {
|
||||
{ .compatible = "brcm,bcm5325" },
|
||||
{ .compatible = "brcm,bcm5365" },
|
||||
@@ -344,6 +356,7 @@ static struct spi_driver b53_spi_driver = {
|
||||
},
|
||||
.probe = b53_spi_probe,
|
||||
.remove = b53_spi_remove,
|
||||
.shutdown = b53_spi_shutdown,
|
||||
};
|
||||
|
||||
module_spi_driver(b53_spi_driver);
|
||||
|
||||
@@ -629,17 +629,34 @@ static int b53_srab_probe(struct platform_device *pdev)
|
||||
static int b53_srab_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct b53_device *dev = platform_get_drvdata(pdev);
|
||||
struct b53_srab_priv *priv = dev->priv;
|
||||
|
||||
b53_srab_intr_set(priv, false);
|
||||
if (!dev)
|
||||
return 0;
|
||||
|
||||
b53_srab_intr_set(dev->priv, false);
|
||||
b53_switch_remove(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void b53_srab_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct b53_device *dev = platform_get_drvdata(pdev);
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
b53_switch_shutdown(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static struct platform_driver b53_srab_driver = {
|
||||
.probe = b53_srab_probe,
|
||||
.remove = b53_srab_remove,
|
||||
.shutdown = b53_srab_shutdown,
|
||||
.driver = {
|
||||
.name = "b53-srab-switch",
|
||||
.of_match_table = b53_srab_of_match,
|
||||
|
||||
@@ -68,7 +68,7 @@ static unsigned int bcm_sf2_num_active_ports(struct dsa_switch *ds)
|
||||
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
|
||||
unsigned int port, count = 0;
|
||||
|
||||
for (port = 0; port < ARRAY_SIZE(priv->port_sts); port++) {
|
||||
for (port = 0; port < ds->num_ports; port++) {
|
||||
if (dsa_is_cpu_port(ds, port))
|
||||
continue;
|
||||
if (priv->port_sts[port].enabled)
|
||||
@@ -1512,6 +1512,9 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct bcm_sf2_priv *priv = platform_get_drvdata(pdev);
|
||||
|
||||
if (!priv)
|
||||
return 0;
|
||||
|
||||
priv->wol_ports_mask = 0;
|
||||
/* Disable interrupts */
|
||||
bcm_sf2_intr_disable(priv);
|
||||
@@ -1523,6 +1526,8 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev)
|
||||
if (priv->type == BCM7278_DEVICE_ID)
|
||||
reset_control_assert(priv->rcdev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1530,6 +1535,9 @@ static void bcm_sf2_sw_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct bcm_sf2_priv *priv = platform_get_drvdata(pdev);
|
||||
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
/* For a kernel about to be kexec'd we want to keep the GPHY on for a
|
||||
* successful MDIO bus scan to occur. If we did turn off the GPHY
|
||||
* before (e.g: port_disable), this will also power it back on.
|
||||
@@ -1538,6 +1546,10 @@ static void bcm_sf2_sw_shutdown(struct platform_device *pdev)
|
||||
*/
|
||||
if (priv->hw_params.num_gphy == 1)
|
||||
bcm_sf2_gphy_enable_set(priv->dev->ds, true);
|
||||
|
||||
dsa_switch_shutdown(priv->dev->ds);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
||||
@@ -340,10 +340,29 @@ static int dsa_loop_drv_probe(struct mdio_device *mdiodev)
|
||||
static void dsa_loop_drv_remove(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
struct dsa_loop_priv *ps = ds->priv;
|
||||
struct dsa_loop_priv *ps;
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
ps = ds->priv;
|
||||
|
||||
dsa_unregister_switch(ds);
|
||||
dev_put(ps->netdev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void dsa_loop_drv_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!ds)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static struct mdio_driver dsa_loop_drv = {
|
||||
@@ -352,6 +371,7 @@ static struct mdio_driver dsa_loop_drv = {
|
||||
},
|
||||
.probe = dsa_loop_drv_probe,
|
||||
.remove = dsa_loop_drv_remove,
|
||||
.shutdown = dsa_loop_drv_shutdown,
|
||||
};
|
||||
|
||||
#define NUM_FIXED_PHYS (DSA_LOOP_NUM_PORTS - 2)
|
||||
|
||||
@@ -1916,6 +1916,9 @@ static int hellcreek_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct hellcreek *hellcreek = platform_get_drvdata(pdev);
|
||||
|
||||
if (!hellcreek)
|
||||
return 0;
|
||||
|
||||
hellcreek_hwtstamp_free(hellcreek);
|
||||
hellcreek_ptp_free(hellcreek);
|
||||
dsa_unregister_switch(hellcreek->ds);
|
||||
@@ -1924,6 +1927,18 @@ static int hellcreek_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void hellcreek_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct hellcreek *hellcreek = platform_get_drvdata(pdev);
|
||||
|
||||
if (!hellcreek)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(hellcreek->ds);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct hellcreek_platform_data de1soc_r1_pdata = {
|
||||
.name = "r4c30",
|
||||
.num_ports = 4,
|
||||
@@ -1946,6 +1961,7 @@ MODULE_DEVICE_TABLE(of, hellcreek_of_match);
|
||||
static struct platform_driver hellcreek_driver = {
|
||||
.probe = hellcreek_probe,
|
||||
.remove = hellcreek_remove,
|
||||
.shutdown = hellcreek_shutdown,
|
||||
.driver = {
|
||||
.name = "hellcreek",
|
||||
.of_match_table = hellcreek_of_match,
|
||||
|
||||
@@ -1379,6 +1379,12 @@ int lan9303_remove(struct lan9303 *chip)
|
||||
}
|
||||
EXPORT_SYMBOL(lan9303_remove);
|
||||
|
||||
void lan9303_shutdown(struct lan9303 *chip)
|
||||
{
|
||||
dsa_switch_shutdown(chip->ds);
|
||||
}
|
||||
EXPORT_SYMBOL(lan9303_shutdown);
|
||||
|
||||
MODULE_AUTHOR("Juergen Borleis <kernel@pengutronix.de>");
|
||||
MODULE_DESCRIPTION("Core driver for SMSC/Microchip LAN9303 three port ethernet switch");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -10,3 +10,4 @@ extern const struct lan9303_phy_ops lan9303_indirect_phy_ops;
|
||||
|
||||
int lan9303_probe(struct lan9303 *chip, struct device_node *np);
|
||||
int lan9303_remove(struct lan9303 *chip);
|
||||
void lan9303_shutdown(struct lan9303 *chip);
|
||||
|
||||
@@ -67,13 +67,28 @@ static int lan9303_i2c_probe(struct i2c_client *client,
|
||||
|
||||
static int lan9303_i2c_remove(struct i2c_client *client)
|
||||
{
|
||||
struct lan9303_i2c *sw_dev;
|
||||
struct lan9303_i2c *sw_dev = i2c_get_clientdata(client);
|
||||
|
||||
sw_dev = i2c_get_clientdata(client);
|
||||
if (!sw_dev)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
return lan9303_remove(&sw_dev->chip);
|
||||
lan9303_remove(&sw_dev->chip);
|
||||
|
||||
i2c_set_clientdata(client, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void lan9303_i2c_shutdown(struct i2c_client *client)
|
||||
{
|
||||
struct lan9303_i2c *sw_dev = i2c_get_clientdata(client);
|
||||
|
||||
if (!sw_dev)
|
||||
return;
|
||||
|
||||
lan9303_shutdown(&sw_dev->chip);
|
||||
|
||||
i2c_set_clientdata(client, NULL);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -97,6 +112,7 @@ static struct i2c_driver lan9303_i2c_driver = {
|
||||
},
|
||||
.probe = lan9303_i2c_probe,
|
||||
.remove = lan9303_i2c_remove,
|
||||
.shutdown = lan9303_i2c_shutdown,
|
||||
.id_table = lan9303_i2c_id,
|
||||
};
|
||||
module_i2c_driver(lan9303_i2c_driver);
|
||||
|
||||
@@ -138,6 +138,20 @@ static void lan9303_mdio_remove(struct mdio_device *mdiodev)
|
||||
return;
|
||||
|
||||
lan9303_remove(&sw_dev->chip);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void lan9303_mdio_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct lan9303_mdio *sw_dev = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (!sw_dev)
|
||||
return;
|
||||
|
||||
lan9303_shutdown(&sw_dev->chip);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
@@ -155,6 +169,7 @@ static struct mdio_driver lan9303_mdio_driver = {
|
||||
},
|
||||
.probe = lan9303_mdio_probe,
|
||||
.remove = lan9303_mdio_remove,
|
||||
.shutdown = lan9303_mdio_shutdown,
|
||||
};
|
||||
mdio_module_driver(lan9303_mdio_driver);
|
||||
|
||||
|
||||
@@ -2184,6 +2184,9 @@ static int gswip_remove(struct platform_device *pdev)
|
||||
struct gswip_priv *priv = platform_get_drvdata(pdev);
|
||||
int i;
|
||||
|
||||
if (!priv)
|
||||
return 0;
|
||||
|
||||
/* disable the switch */
|
||||
gswip_mdio_mask(priv, GSWIP_MDIO_GLOB_ENABLE, 0, GSWIP_MDIO_GLOB);
|
||||
|
||||
@@ -2197,9 +2200,23 @@ static int gswip_remove(struct platform_device *pdev)
|
||||
for (i = 0; i < priv->num_gphy_fw; i++)
|
||||
gswip_gphy_fw_remove(priv, &priv->gphy_fw[i]);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gswip_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct gswip_priv *priv = platform_get_drvdata(pdev);
|
||||
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
dsa_switch_shutdown(priv->ds);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
static const struct gswip_hw_info gswip_xrx200 = {
|
||||
.max_ports = 7,
|
||||
.cpu_port = 6,
|
||||
@@ -2223,6 +2240,7 @@ MODULE_DEVICE_TABLE(of, gswip_of_match);
|
||||
static struct platform_driver gswip_driver = {
|
||||
.probe = gswip_probe,
|
||||
.remove = gswip_remove,
|
||||
.shutdown = gswip_shutdown,
|
||||
.driver = {
|
||||
.name = "gswip",
|
||||
.of_match_table = gswip_of_match,
|
||||
|
||||
@@ -94,6 +94,8 @@ static int ksz8795_spi_remove(struct spi_device *spi)
|
||||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -101,8 +103,15 @@ static void ksz8795_spi_shutdown(struct spi_device *spi)
|
||||
{
|
||||
struct ksz_device *dev = spi_get_drvdata(spi);
|
||||
|
||||
if (dev && dev->dev_ops->shutdown)
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
if (dev->dev_ops->shutdown)
|
||||
dev->dev_ops->shutdown(dev);
|
||||
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id ksz8795_dt_ids[] = {
|
||||
|
||||
@@ -191,6 +191,18 @@ static void ksz8863_smi_remove(struct mdio_device *mdiodev)
|
||||
|
||||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static void ksz8863_smi_shutdown(struct mdio_device *mdiodev)
|
||||
{
|
||||
struct ksz_device *dev = dev_get_drvdata(&mdiodev->dev);
|
||||
|
||||
if (dev)
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
dev_set_drvdata(&mdiodev->dev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id ksz8863_dt_ids[] = {
|
||||
@@ -203,6 +215,7 @@ MODULE_DEVICE_TABLE(of, ksz8863_dt_ids);
|
||||
static struct mdio_driver ksz8863_driver = {
|
||||
.probe = ksz8863_smi_probe,
|
||||
.remove = ksz8863_smi_remove,
|
||||
.shutdown = ksz8863_smi_shutdown,
|
||||
.mdiodrv.driver = {
|
||||
.name = "ksz8863-switch",
|
||||
.of_match_table = ksz8863_dt_ids,
|
||||
|
||||
@@ -56,7 +56,10 @@ static int ksz9477_i2c_remove(struct i2c_client *i2c)
|
||||
{
|
||||
struct ksz_device *dev = i2c_get_clientdata(i2c);
|
||||
|
||||
ksz_switch_remove(dev);
|
||||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
i2c_set_clientdata(i2c, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -65,8 +68,15 @@ static void ksz9477_i2c_shutdown(struct i2c_client *i2c)
|
||||
{
|
||||
struct ksz_device *dev = i2c_get_clientdata(i2c);
|
||||
|
||||
if (dev && dev->dev_ops->shutdown)
|
||||
if (!dev)
|
||||
return;
|
||||
|
||||
if (dev->dev_ops->shutdown)
|
||||
dev->dev_ops->shutdown(dev);
|
||||
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
i2c_set_clientdata(i2c, NULL);
|
||||
}
|
||||
|
||||
static const struct i2c_device_id ksz9477_i2c_id[] = {
|
||||
|
||||
@@ -72,6 +72,8 @@ static int ksz9477_spi_remove(struct spi_device *spi)
|
||||
if (dev)
|
||||
ksz_switch_remove(dev);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -79,8 +81,10 @@ static void ksz9477_spi_shutdown(struct spi_device *spi)
|
||||
{
|
||||
struct ksz_device *dev = spi_get_drvdata(spi);
|
||||
|
||||
if (dev && dev->dev_ops->shutdown)
|
||||
dev->dev_ops->shutdown(dev);
|
||||
if (dev)
|
||||
dsa_switch_shutdown(dev->ds);
|
||||
|
||||
spi_set_drvdata(spi, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id ksz9477_dt_ids[] = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user