xref: /linux/drivers/net/dsa/realtek/realtek-mdio.h (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 
3 #ifndef _REALTEK_MDIO_H
4 #define _REALTEK_MDIO_H
5 
6 #if IS_ENABLED(CONFIG_NET_DSA_REALTEK_MDIO)
7 
realtek_mdio_driver_register(struct mdio_driver * drv)8 static inline int realtek_mdio_driver_register(struct mdio_driver *drv)
9 {
10 	return mdio_driver_register(drv);
11 }
12 
realtek_mdio_driver_unregister(struct mdio_driver * drv)13 static inline void realtek_mdio_driver_unregister(struct mdio_driver *drv)
14 {
15 	mdio_driver_unregister(drv);
16 }
17 
18 int realtek_mdio_probe(struct mdio_device *mdiodev);
19 void realtek_mdio_remove(struct mdio_device *mdiodev);
20 void realtek_mdio_shutdown(struct mdio_device *mdiodev);
21 
22 #else /* IS_ENABLED(CONFIG_NET_DSA_REALTEK_MDIO) */
23 
realtek_mdio_driver_register(struct mdio_driver * drv)24 static inline int realtek_mdio_driver_register(struct mdio_driver *drv)
25 {
26 	return 0;
27 }
28 
realtek_mdio_driver_unregister(struct mdio_driver * drv)29 static inline void realtek_mdio_driver_unregister(struct mdio_driver *drv)
30 {
31 }
32 
realtek_mdio_probe(struct mdio_device * mdiodev)33 static inline int realtek_mdio_probe(struct mdio_device *mdiodev)
34 {
35 	return -ENOENT;
36 }
37 
realtek_mdio_remove(struct mdio_device * mdiodev)38 static inline void realtek_mdio_remove(struct mdio_device *mdiodev)
39 {
40 }
41 
realtek_mdio_shutdown(struct mdio_device * mdiodev)42 static inline void realtek_mdio_shutdown(struct mdio_device *mdiodev)
43 {
44 }
45 
46 #endif /* IS_ENABLED(CONFIG_NET_DSA_REALTEK_MDIO) */
47 
48 #endif /* _REALTEK_MDIO_H */
49