aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2018-06-02 16:37:24 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-05 08:50:16 -0400
commit9107c05e2e55c1c7abd02ab38f7694e0da08b643 (patch)
tree9a3188f34ac7db2ee7c749a80fc6beb40060950c
parent7f4828ff27d4c92280222f6427981052fd3319e9 (diff)
net: phy: remove PM ops from MDIO bus
Current implementation of MDIO bus PM ops doesn't actually implement bus-specific PM ops but just calls PM ops defined on a device level what doesn't seem to be fully in line with the core PM model. When looking e.g. at __device_suspend() the PM core looks for PM ops of a device in a specific order: 1. device PM domain 2. device type 3. device class 4. device bus I think it has good reason that there's no PM ops on device level. Now that a device type representation of PHY's as special type of MDIO devices was added (only user of MDIO bus PM ops), the MDIO bus PM ops can be removed including member pm of struct mdio_device. If for some other type of MDIO device PM ops are needed, it should be modeled as struct device_type as well. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/mdio_bus.c48
-rw-r--r--include/linux/mdio.h1
2 files changed, 0 insertions, 49 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 24b5511222c8..98f4b1f706df 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -717,58 +717,10 @@ static int mdio_uevent(struct device *dev, struct kobj_uevent_env *env)
717 return 0; 717 return 0;
718} 718}
719 719
720#ifdef CONFIG_PM
721static int mdio_bus_suspend(struct device *dev)
722{
723 struct mdio_device *mdio = to_mdio_device(dev);
724
725 if (mdio->pm_ops && mdio->pm_ops->suspend)
726 return mdio->pm_ops->suspend(dev);
727
728 return 0;
729}
730
731static int mdio_bus_resume(struct device *dev)
732{
733 struct mdio_device *mdio = to_mdio_device(dev);
734
735 if (mdio->pm_ops && mdio->pm_ops->resume)
736 return mdio->pm_ops->resume(dev);
737
738 return 0;
739}
740
741static int mdio_bus_restore(struct device *dev)
742{
743 struct mdio_device *mdio = to_mdio_device(dev);
744
745 if (mdio->pm_ops && mdio->pm_ops->restore)
746 return mdio->pm_ops->restore(dev);
747
748 return 0;
749}
750
751static const struct dev_pm_ops mdio_bus_pm_ops = {
752 .suspend = mdio_bus_suspend,
753 .resume = mdio_bus_resume,
754 .freeze = mdio_bus_suspend,
755 .thaw = mdio_bus_resume,
756 .restore = mdio_bus_restore,
757};
758
759#define MDIO_BUS_PM_OPS (&mdio_bus_pm_ops)
760
761#else
762
763#define MDIO_BUS_PM_OPS NULL
764
765#endif /* CONFIG_PM */
766
767struct bus_type mdio_bus_type = { 720struct bus_type mdio_bus_type = {
768 .name = "mdio_bus", 721 .name = "mdio_bus",
769 .match = mdio_bus_match, 722 .match = mdio_bus_match,
770 .uevent = mdio_uevent, 723 .uevent = mdio_uevent,
771 .pm = MDIO_BUS_PM_OPS,
772}; 724};
773EXPORT_SYMBOL(mdio_bus_type); 725EXPORT_SYMBOL(mdio_bus_type);
774 726
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 2cfffe586885..bfa7114167d7 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -29,7 +29,6 @@ enum mdio_mutex_lock_class {
29struct mdio_device { 29struct mdio_device {
30 struct device dev; 30 struct device dev;
31 31
32 const struct dev_pm_ops *pm_ops;
33 struct mii_bus *bus; 32 struct mii_bus *bus;
34 char modalias[MDIO_NAME_SIZE]; 33 char modalias[MDIO_NAME_SIZE];
35 34