Hi Pankaj,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on net/master]
[also build test ERROR on v5.0-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Pankaj-Bansal/add-MDIO-bus-multiplexer-driven-by-a-regmap-device/20190204-213429
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=sh 

All errors (new ones prefixed by >>):

>> drivers/net/phy/mdio-mux-regmap.c:72:5: error: redefinition of 
>> 'mdio_mux_regmap_init'
    int mdio_mux_regmap_init(struct device *dev,
        ^~~~~~~~~~~~~~~~~~~~
   In file included from drivers/net/phy/mdio-mux-regmap.c:18:
   include/linux/mdio-mux.h:53:19: note: previous definition of 
'mdio_mux_regmap_init' was here
    static inline int mdio_mux_regmap_init(struct device *dev,
                      ^~~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/mdio-mux-regmap.c:158:5: error: redefinition of 
>> 'mdio_mux_regmap_uninit'
    int mdio_mux_regmap_uninit(void *data)
        ^~~~~~~~~~~~~~~~~~~~~~
   In file included from drivers/net/phy/mdio-mux-regmap.c:18:
   include/linux/mdio-mux.h:60:19: note: previous definition of 
'mdio_mux_regmap_uninit' was here
    static inline int mdio_mux_regmap_uninit(void *data)
                      ^~~~~~~~~~~~~~~~~~~~~~

vim +/mdio_mux_regmap_init +72 drivers/net/phy/mdio-mux-regmap.c

    62  
    63  /**
    64   * mdio_mux_regmap_init - control MDIO bus muxing using regmap 
constructs.
    65   * @dev: device with which regmap construct is associated.
    66   * @mux_node: mdio bus mux node that contains parent mdio bus phandle.
    67   *            This node also contains sub nodes, where each subnode 
denotes
    68   *            a child mdio bus. All the child mdio buses are muxed, 
i.e. at a
    69   *            time only one of the child mdio buses can be used.
    70   * @data: to store the address of data allocated by this function
    71   */
  > 72  int mdio_mux_regmap_init(struct device *dev,
    73                           struct device_node *mux_node,
    74                           void **data)
    75  {
    76          struct device_node *child;
    77          struct mdio_mux_regmap_state *s;
    78          int ret;
    79          u32 val;
    80  
    81          dev_dbg(dev, "probing node %pOF\n", mux_node);
    82  
    83          s = devm_kzalloc(dev, sizeof(*s), GFP_KERNEL);
    84          if (!s)
    85                  return -ENOMEM;
    86  
    87          s->regmap = dev_get_regmap(dev, NULL);
    88          if (IS_ERR(s->regmap)) {
    89                  dev_err(dev, "Failed to get parent regmap\n");
    90                  return PTR_ERR(s->regmap);
    91          }
    92  
    93          ret = of_property_read_u32(mux_node, "reg", &s->mux_reg);
    94          if (ret) {
    95                  dev_err(dev, "missing or invalid reg property\n");
    96                  return -ENODEV;
    97          }
    98  
    99          /* Test Register read write */
   100          ret = regmap_read(s->regmap, s->mux_reg, &val);
   101          if (ret) {
   102                  dev_err(dev, "error while reading reg\n");
   103                  return ret;
   104          }
   105  
   106          ret = regmap_write(s->regmap, s->mux_reg, val);
   107          if (ret) {
   108                  dev_err(dev, "error while writing reg\n");
   109                  return ret;
   110          }
   111  
   112          ret = of_property_read_u32(mux_node, "mux-mask", &s->mask);
   113          if (ret) {
   114                  dev_err(dev, "missing or invalid mux-mask property\n");
   115                  return -ENODEV;
   116          }
   117  
   118          /* Verify that the 'reg' property of each child MDIO bus does 
not
   119           * set any bits outside of the 'mask'.
   120           */
   121          for_each_available_child_of_node(mux_node, child) {
   122                  ret = of_property_read_u32(child, "reg", &val);
   123                  if (ret) {
   124                          dev_err(dev, "%pOF is missing a 'reg' 
property\n",
   125                                  child);
   126                          of_node_put(child);
   127                          return -ENODEV;
   128                  }
   129                  if (val & ~s->mask) {
   130                          dev_err(dev,
   131                                  "%pOF has a 'reg' value with unmasked 
bits\n",
   132                                  child);
   133                          of_node_put(child);
   134                          return -ENODEV;
   135                  }
   136          }
   137  
   138          ret = mdio_mux_init(dev, mux_node, mdio_mux_regmap_switch_fn,
   139                              &s->mux_handle, s, NULL);
   140          if (ret) {
   141                  if (ret != -EPROBE_DEFER)
   142                          dev_err(dev, "failed to register mdio-mux bus 
%pOF\n",
   143                                  mux_node);
   144                  return ret;
   145          }
   146  
   147          *data = s;
   148  
   149          return 0;
   150  }
   151  EXPORT_SYMBOL_GPL(mdio_mux_regmap_init);
   152  
   153  /**
   154   * mdio_mux_regmap_uninit - relinquish the control of MDIO bus muxing 
using
   155   *                          regmap constructs.
   156   * @data: address of data allocated by mdio_mux_regmap_init
   157   */
 > 158  int mdio_mux_regmap_uninit(void *data)
   159  {
   160          struct mdio_mux_regmap_state *s = data;
   161  
   162          mdio_mux_uninit(s->mux_handle);
   163  
   164          return 0;
   165  }
   166  EXPORT_SYMBOL_GPL(mdio_mux_regmap_uninit);
   167  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to