diff mbox series

[net-next,5/5] net: mdio: mscc-miim: use fwnode_mdiobus_register()

Message ID 20220325172234.1259667-6-clement.leger@bootlin.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series add fwnode based mdiobus registration | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 21 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Clément Léger March 25, 2022, 5:22 p.m. UTC
Use fwnode_mdiobus_register() to be compatible with devices described
with fwnode.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 drivers/net/mdio/mdio-mscc-miim.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

kernel test robot March 26, 2022, 2:21 a.m. UTC | #1
Hi "Clément,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Cl-ment-L-ger/net-mdio-fwnode-add-fwnode_mdiobus_register/20220326-040146
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 89695196f0ba78a17453f9616355f2ca6b293402
config: riscv-randconfig-r003-20220325 (https://download.01.org/0day-ci/archive/20220326/202203261006.uZruvRKb-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/24673ffe7514a73903a3bc49585846bce1de8748
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cl-ment-L-ger/net-mdio-fwnode-add-fwnode_mdiobus_register/20220326-040146
        git checkout 24673ffe7514a73903a3bc49585846bce1de8748
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/net/mdio/ fs/gfs2/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from drivers/net/mdio/mdio-mscc-miim.c:10:
>> include/linux/fwnode_mdio.h:27:5: warning: no previous prototype for function 'fwnode_mdiobus_phy_device_register' [-Wmissing-prototypes]
   int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
       ^
   include/linux/fwnode_mdio.h:27:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
   ^
   static 
   1 warning generated.


vim +/fwnode_mdiobus_phy_device_register +27 include/linux/fwnode_mdio.h

8ed21cbab4f71b Clément Léger  2022-03-25  26  
bc1bee3b87ee48 Calvin Johnson 2021-06-11 @27  int fwnode_mdiobus_phy_device_register(struct mii_bus *mdio,
bc1bee3b87ee48 Calvin Johnson 2021-06-11  28  				       struct phy_device *phy,
bc1bee3b87ee48 Calvin Johnson 2021-06-11  29  				       struct fwnode_handle *child, u32 addr)
bc1bee3b87ee48 Calvin Johnson 2021-06-11  30  {
bc1bee3b87ee48 Calvin Johnson 2021-06-11  31  	return -EINVAL;
bc1bee3b87ee48 Calvin Johnson 2021-06-11  32  }
bc1bee3b87ee48 Calvin Johnson 2021-06-11  33
diff mbox series

Patch

diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c
index c483ba67c21f..ea79421fcfd4 100644
--- a/drivers/net/mdio/mdio-mscc-miim.c
+++ b/drivers/net/mdio/mdio-mscc-miim.c
@@ -7,12 +7,12 @@ 
  */
 
 #include <linux/bitops.h>
+#include <linux/fwnode_mdio.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
 #include <linux/kernel.h>
 #include <linux/mdio/mdio-mscc-miim.h>
 #include <linux/module.h>
-#include <linux/of_mdio.h>
 #include <linux/phy.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
@@ -288,7 +288,7 @@  static int mscc_miim_probe(struct platform_device *pdev)
 	if (!miim->info)
 		return -EINVAL;
 
-	ret = of_mdiobus_register(bus, pdev->dev.of_node);
+	ret = fwnode_mdiobus_register(bus, dev_fwnode(&pdev->dev));
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Cannot register MDIO bus (%d)\n", ret);
 		return ret;