chip.c (d1b803f4ca4f25d6f171219d039f9410a10b29ee) | chip.c (0650bf52b31ff35dc6430fc2e37969c36baba724) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Marvell 88e6xxx Ethernet switch single-chip support 4 * 5 * Copyright (c) 2008 Marvell Semiconductor 6 * 7 * Copyright (c) 2016 Andrew Lunn <andrew@lunn.ch> 8 * --- 6375 unchanged lines hidden (view full) --- 6384 dev_put(pdata->netdev); 6385 6386 return err; 6387} 6388 6389static void mv88e6xxx_remove(struct mdio_device *mdiodev) 6390{ 6391 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * Marvell 88e6xxx Ethernet switch single-chip support 4 * 5 * Copyright (c) 2008 Marvell Semiconductor 6 * 7 * Copyright (c) 2016 Andrew Lunn <andrew@lunn.ch> 8 * --- 6375 unchanged lines hidden (view full) --- 6384 dev_put(pdata->netdev); 6385 6386 return err; 6387} 6388 6389static void mv88e6xxx_remove(struct mdio_device *mdiodev) 6390{ 6391 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); |
6392 struct mv88e6xxx_chip *chip = ds->priv; | 6392 struct mv88e6xxx_chip *chip; |
6393 | 6393 |
6394 if (!ds) 6395 return; 6396 6397 chip = ds->priv; 6398 |
|
6394 if (chip->info->ptp_support) { 6395 mv88e6xxx_hwtstamp_free(chip); 6396 mv88e6xxx_ptp_free(chip); 6397 } 6398 6399 mv88e6xxx_phy_destroy(chip); 6400 mv88e6xxx_unregister_switch(chip); 6401 mv88e6xxx_mdios_unregister(chip); 6402 6403 mv88e6xxx_g1_vtu_prob_irq_free(chip); 6404 mv88e6xxx_g1_atu_prob_irq_free(chip); 6405 6406 if (chip->info->g2_irqs > 0) 6407 mv88e6xxx_g2_irq_free(chip); 6408 6409 if (chip->irq > 0) 6410 mv88e6xxx_g1_irq_free(chip); 6411 else 6412 mv88e6xxx_irq_poll_free(chip); | 6399 if (chip->info->ptp_support) { 6400 mv88e6xxx_hwtstamp_free(chip); 6401 mv88e6xxx_ptp_free(chip); 6402 } 6403 6404 mv88e6xxx_phy_destroy(chip); 6405 mv88e6xxx_unregister_switch(chip); 6406 mv88e6xxx_mdios_unregister(chip); 6407 6408 mv88e6xxx_g1_vtu_prob_irq_free(chip); 6409 mv88e6xxx_g1_atu_prob_irq_free(chip); 6410 6411 if (chip->info->g2_irqs > 0) 6412 mv88e6xxx_g2_irq_free(chip); 6413 6414 if (chip->irq > 0) 6415 mv88e6xxx_g1_irq_free(chip); 6416 else 6417 mv88e6xxx_irq_poll_free(chip); |
6418 6419 dev_set_drvdata(&mdiodev->dev, NULL); |
|
6413} 6414 | 6420} 6421 |
6422static void mv88e6xxx_shutdown(struct mdio_device *mdiodev) 6423{ 6424 struct dsa_switch *ds = dev_get_drvdata(&mdiodev->dev); 6425 6426 if (!ds) 6427 return; 6428 6429 dsa_switch_shutdown(ds); 6430 6431 dev_set_drvdata(&mdiodev->dev, NULL); 6432} 6433 |
|
6415static const struct of_device_id mv88e6xxx_of_match[] = { 6416 { 6417 .compatible = "marvell,mv88e6085", 6418 .data = &mv88e6xxx_table[MV88E6085], 6419 }, 6420 { 6421 .compatible = "marvell,mv88e6190", 6422 .data = &mv88e6xxx_table[MV88E6190], --- 5 unchanged lines hidden (view full) --- 6428 { /* sentinel */ }, 6429}; 6430 6431MODULE_DEVICE_TABLE(of, mv88e6xxx_of_match); 6432 6433static struct mdio_driver mv88e6xxx_driver = { 6434 .probe = mv88e6xxx_probe, 6435 .remove = mv88e6xxx_remove, | 6434static const struct of_device_id mv88e6xxx_of_match[] = { 6435 { 6436 .compatible = "marvell,mv88e6085", 6437 .data = &mv88e6xxx_table[MV88E6085], 6438 }, 6439 { 6440 .compatible = "marvell,mv88e6190", 6441 .data = &mv88e6xxx_table[MV88E6190], --- 5 unchanged lines hidden (view full) --- 6447 { /* sentinel */ }, 6448}; 6449 6450MODULE_DEVICE_TABLE(of, mv88e6xxx_of_match); 6451 6452static struct mdio_driver mv88e6xxx_driver = { 6453 .probe = mv88e6xxx_probe, 6454 .remove = mv88e6xxx_remove, |
6455 .shutdown = mv88e6xxx_shutdown, |
|
6436 .mdiodrv.driver = { 6437 .name = "mv88e6085", 6438 .of_match_table = mv88e6xxx_of_match, 6439 .pm = &mv88e6xxx_pm_ops, 6440 }, 6441}; 6442 6443mdio_module_driver(mv88e6xxx_driver); 6444 6445MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>"); 6446MODULE_DESCRIPTION("Driver for Marvell 88E6XXX ethernet switch chips"); 6447MODULE_LICENSE("GPL"); | 6456 .mdiodrv.driver = { 6457 .name = "mv88e6085", 6458 .of_match_table = mv88e6xxx_of_match, 6459 .pm = &mv88e6xxx_pm_ops, 6460 }, 6461}; 6462 6463mdio_module_driver(mv88e6xxx_driver); 6464 6465MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>"); 6466MODULE_DESCRIPTION("Driver for Marvell 88E6XXX ethernet switch chips"); 6467MODULE_LICENSE("GPL"); |