realtek: 5.15: fix warning for i2c_mii_valid_phy_id and i2c_mii_phy_addr
Rework exposing i2c_mii_valid_phy_id and i2c_mii_phy_addr in global include. Fix compilation warning: In file included from drivers/net/phy/sfp.c:11: ./include/linux/mdio/mdio-i2c.h:27:21: error: 'i2c_mii_phy_addr' defined but not used [-Werror=unused-function] 27 | static unsigned int i2c_mii_phy_addr(int phy_id) | ^~~~~~~~~~~~~~~~ ./include/linux/mdio/mdio-i2c.h:22:13: error: 'i2c_mii_valid_phy_id' defined but not used [-Werror=unused-function] 22 | static bool i2c_mii_valid_phy_id(int phy_id) | ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
7fa7cbc0b9
commit
f938826a65
1 changed files with 16 additions and 36 deletions
|
@ -120,49 +120,29 @@ Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
|
||||||
|
|
||||||
--- a/include/linux/mdio/mdio-i2c.h
|
--- a/include/linux/mdio/mdio-i2c.h
|
||||||
+++ b/include/linux/mdio/mdio-i2c.h
|
+++ b/include/linux/mdio/mdio-i2c.h
|
||||||
@@ -12,5 +12,21 @@ struct i2c_adapter;
|
@@ -12,5 +12,8 @@ struct i2c_adapter;
|
||||||
struct mii_bus;
|
struct mii_bus;
|
||||||
|
|
||||||
struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c);
|
struct mii_bus *mdio_i2c_alloc(struct device *parent, struct i2c_adapter *i2c);
|
||||||
+struct mii_bus *mdio_smbus_alloc(struct device *parent, struct i2c_adapter *i2c);
|
+struct mii_bus *mdio_smbus_alloc(struct device *parent, struct i2c_adapter *i2c);
|
||||||
+
|
+bool i2c_mii_valid_phy_id(int phy_id);
|
||||||
+/*
|
+unsigned int i2c_mii_phy_addr(int phy_id);
|
||||||
+ * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is
|
|
||||||
+ * specified to be present in SFP modules. These correspond with PHY
|
|
||||||
+ * addresses 16 and 17. Disallow access to these "phy" addresses.
|
|
||||||
+ */
|
|
||||||
+static bool i2c_mii_valid_phy_id(int phy_id)
|
|
||||||
+{
|
|
||||||
+ return phy_id != 0x10 && phy_id != 0x11;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static unsigned int i2c_mii_phy_addr(int phy_id)
|
|
||||||
+{
|
|
||||||
+ return phy_id + 0x40;
|
|
||||||
+}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
--- a/drivers/net/mdio/mdio-i2c.c
|
--- a/drivers/net/mdio/mdio-i2c.c
|
||||||
+++ b/drivers/net/mdio/mdio-i2c.c
|
+++ b/drivers/net/mdio/mdio-i2c.c
|
||||||
@@ -13,21 +13,6 @@
|
@@ -18,12 +18,12 @@
|
||||||
#include <linux/mdio/mdio-i2c.h>
|
* specified to be present in SFP modules. These correspond with PHY
|
||||||
#include <linux/phy.h>
|
* addresses 16 and 17. Disallow access to these "phy" addresses.
|
||||||
|
*/
|
||||||
-/*
|
|
||||||
- * I2C bus addresses 0x50 and 0x51 are normally an EEPROM, which is
|
|
||||||
- * specified to be present in SFP modules. These correspond with PHY
|
|
||||||
- * addresses 16 and 17. Disallow access to these "phy" addresses.
|
|
||||||
- */
|
|
||||||
-static bool i2c_mii_valid_phy_id(int phy_id)
|
-static bool i2c_mii_valid_phy_id(int phy_id)
|
||||||
-{
|
+bool i2c_mii_valid_phy_id(int phy_id)
|
||||||
- return phy_id != 0x10 && phy_id != 0x11;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-static unsigned int i2c_mii_phy_addr(int phy_id)
|
|
||||||
-{
|
|
||||||
- return phy_id + 0x40;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
static int i2c_mii_read(struct mii_bus *bus, int phy_id, int reg)
|
|
||||||
{
|
{
|
||||||
struct i2c_adapter *i2c = bus->priv;
|
return phy_id != 0x10 && phy_id != 0x11;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static unsigned int i2c_mii_phy_addr(int phy_id)
|
||||||
|
+unsigned int i2c_mii_phy_addr(int phy_id)
|
||||||
|
{
|
||||||
|
return phy_id + 0x40;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue