Re: [PATCH 2/5] net: stmmac: Split devicetree parse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jiaxun,

I love your patch! Yet something to improve:

[auto build test ERROR on net-next/master]
[cannot apply to v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jiaxun-Yang/PCI-Devices-for-Loongson-PCH/20191102-045600
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 52340b82cf1a9c8d466b6e36a0881bc44174b969
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.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=7.4.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c: In function 'stmmac_parse_config_dt':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:401:3: error: 'mac' undeclared (first use in this function); did you mean 'max'?
     *mac = of_get_mac_address(np);
      ^~~
      max
   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:401:3: note: each undeclared identifier is reported only once for each function it appears in
   In file included from include/linux/platform_device.h:13:0,
                    from drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:11:
>> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:445:13: error: 'pdev' undeclared (first use in this function); did you mean 'cdev'?
      dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
                ^
   include/linux/device.h:1743:12: note: in definition of macro 'dev_warn'
     _dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
               ^~~
   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c: In function 'stmmac_probe_config_dt':
>> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:633:3: error: implicit declaration of function 'free' [-Werror=implicit-function-declaration]
      free(plat);
      ^~~~
>> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:633:3: warning: incompatible implicit declaration of built-in function 'free'
   drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:633:3: note: include '<stdlib.h>' or provide a declaration of 'free'
   cc1: some warnings being treated as errors

vim +401 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

0060c8783330ab Alexandru Ardelean  2019-09-06  386  
732fdf0e5253e9 Giuseppe CAVALLARO  2014-11-18  387  /**
af5ab092fba22b Jiaxun Yang         2019-10-30  388   * stmmac_parse_config_dt - parse device-tree driver parameters
af5ab092fba22b Jiaxun Yang         2019-10-30  389   * @np: device_mode structure
af5ab092fba22b Jiaxun Yang         2019-10-30  390   * @plat: plat_stmmacenet_data structure
732fdf0e5253e9 Giuseppe CAVALLARO  2014-11-18  391   * Description:
732fdf0e5253e9 Giuseppe CAVALLARO  2014-11-18  392   * this function is to read the driver parameters from device-tree and
732fdf0e5253e9 Giuseppe CAVALLARO  2014-11-18  393   * set some private fields that will be used by the main at runtime.
732fdf0e5253e9 Giuseppe CAVALLARO  2014-11-18  394   */
af5ab092fba22b Jiaxun Yang         2019-10-30  395  int stmmac_parse_config_dt(struct device_node *np,
af5ab092fba22b Jiaxun Yang         2019-10-30  396  				struct plat_stmmacenet_data *plat)
6a228452d11eaf Stefan Roese        2012-03-13  397  {
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  398  	struct stmmac_dma_cfg *dma_cfg;
2ee2132ffb83e3 Niklas Cassel       2018-02-19  399  	int rc;
6a228452d11eaf Stefan Roese        2012-03-13  400  
6a228452d11eaf Stefan Roese        2012-03-13 @401  	*mac = of_get_mac_address(np);
195b2919ccd7ff Martin Blumenstingl 2019-07-27  402  	if (IS_ERR(*mac)) {
195b2919ccd7ff Martin Blumenstingl 2019-07-27  403  		if (PTR_ERR(*mac) == -EPROBE_DEFER)
195b2919ccd7ff Martin Blumenstingl 2019-07-27  404  			return ERR_CAST(*mac);
195b2919ccd7ff Martin Blumenstingl 2019-07-27  405  
195b2919ccd7ff Martin Blumenstingl 2019-07-27  406  		*mac = NULL;
195b2919ccd7ff Martin Blumenstingl 2019-07-27  407  	}
195b2919ccd7ff Martin Blumenstingl 2019-07-27  408  
0060c8783330ab Alexandru Ardelean  2019-09-06  409  	plat->phy_interface = of_get_phy_mode(np);
0060c8783330ab Alexandru Ardelean  2019-09-06  410  	if (plat->phy_interface < 0)
af5ab092fba22b Jiaxun Yang         2019-10-30  411  		return plat->phy_interface;
0060c8783330ab Alexandru Ardelean  2019-09-06  412  
0060c8783330ab Alexandru Ardelean  2019-09-06  413  	plat->interface = stmmac_of_get_mac_mode(np);
0060c8783330ab Alexandru Ardelean  2019-09-06  414  	if (plat->interface < 0)
0060c8783330ab Alexandru Ardelean  2019-09-06  415  		plat->interface = plat->phy_interface;
4838a54050284d Jose Abreu          2019-06-14  416  
4838a54050284d Jose Abreu          2019-06-14  417  	/* Some wrapper drivers still rely on phy_node. Let's save it while
4838a54050284d Jose Abreu          2019-06-14  418  	 * they are not converted to phylink. */
4838a54050284d Jose Abreu          2019-06-14  419  	plat->phy_node = of_parse_phandle(np, "phy-handle", 0);
4838a54050284d Jose Abreu          2019-06-14  420  
4838a54050284d Jose Abreu          2019-06-14  421  	/* PHYLINK automatically parses the phy-handle property */
4838a54050284d Jose Abreu          2019-06-14  422  	plat->phylink_node = np;
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  423  
9cbadf094d9d47 Srinivas Kandagatla 2014-01-16  424  	/* Get max speed of operation from device tree */
9cbadf094d9d47 Srinivas Kandagatla 2014-01-16  425  	if (of_property_read_u32(np, "max-speed", &plat->max_speed))
9cbadf094d9d47 Srinivas Kandagatla 2014-01-16  426  		plat->max_speed = -1;
9cbadf094d9d47 Srinivas Kandagatla 2014-01-16  427  
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  428  	plat->bus_id = of_alias_get_id(np, "ethernet");
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  429  	if (plat->bus_id < 0)
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  430  		plat->bus_id = 0;
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  431  
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17  432  	/* Default to phy auto-detection */
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17  433  	plat->phy_addr = -1;
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17  434  
5e7f7fc538d894 Biao Huang          2019-05-24  435  	/* Default to get clk_csr from stmmac_clk_crs_set(),
5e7f7fc538d894 Biao Huang          2019-05-24  436  	 * or get clk_csr from device tree.
5e7f7fc538d894 Biao Huang          2019-05-24  437  	 */
5e7f7fc538d894 Biao Huang          2019-05-24  438  	plat->clk_csr = -1;
81311c03ab4dca Christophe Roullier 2019-03-05  439  	of_property_read_u32(np, "clk_csr", &plat->clk_csr);
81311c03ab4dca Christophe Roullier 2019-03-05  440  
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17  441  	/* "snps,phy-addr" is not a standard property. Mark it as deprecated
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17  442  	 * and warn of its use. Remove this when phy node support is added.
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17  443  	 */
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17  444  	if (of_property_read_u32(np, "snps,phy-addr", &plat->phy_addr) == 0)
436f7ecdcc08f7 Chen-Yu Tsai        2014-01-17 @445  		dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  446  
a7657f128c279a Giuseppe CAVALLARO  2016-04-01  447  	/* To Configure PHY by using all device-tree supported properties */
ce339abc9a40af Niklas Cassel       2018-02-19  448  	rc = stmmac_dt_phy(plat, np, &pdev->dev);
ce339abc9a40af Niklas Cassel       2018-02-19  449  	if (rc)
af5ab092fba22b Jiaxun Yang         2019-10-30  450  		return rc;
6a228452d11eaf Stefan Roese        2012-03-13  451  
e7877f52fd4a8d Vince Bridgers      2015-04-15  452  	of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
e7877f52fd4a8d Vince Bridgers      2015-04-15  453  
e7877f52fd4a8d Vince Bridgers      2015-04-15  454  	of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
e7877f52fd4a8d Vince Bridgers      2015-04-15  455  
8c2a7a5d2c6ec6 Giuseppe CAVALLARO  2014-10-14  456  	plat->force_sf_dma_mode =
8c2a7a5d2c6ec6 Giuseppe CAVALLARO  2014-10-14  457  		of_property_read_bool(np, "snps,force_sf_dma_mode");
6aedb8c06df732 Chen-Yu Tsai        2014-01-17  458  
b4b7b772e8b018 jpinto              2017-01-09  459  	plat->en_tx_lpi_clockgating =
b4b7b772e8b018 jpinto              2017-01-09  460  		of_property_read_bool(np, "snps,en-tx-lpi-clockgating");
b4b7b772e8b018 jpinto              2017-01-09  461  
2618abb73c8953 Vince Bridgers      2014-01-20  462  	/* Set the maxmtu to a default of JUMBO_LEN in case the
2618abb73c8953 Vince Bridgers      2014-01-20  463  	 * parameter is not present in the device tree.
2618abb73c8953 Vince Bridgers      2014-01-20  464  	 */
2618abb73c8953 Vince Bridgers      2014-01-20  465  	plat->maxmtu = JUMBO_LEN;
2618abb73c8953 Vince Bridgers      2014-01-20  466  
4ed2d8fca7979a Joachim Eastwood    2015-07-17  467  	/* Set default value for multicast hash bins */
4ed2d8fca7979a Joachim Eastwood    2015-07-17  468  	plat->multicast_filter_bins = HASH_TABLE_SIZE;
4ed2d8fca7979a Joachim Eastwood    2015-07-17  469  
4ed2d8fca7979a Joachim Eastwood    2015-07-17  470  	/* Set default value for unicast filter entries */
4ed2d8fca7979a Joachim Eastwood    2015-07-17  471  	plat->unicast_filter_entries = 1;
4ed2d8fca7979a Joachim Eastwood    2015-07-17  472  
6a228452d11eaf Stefan Roese        2012-03-13  473  	/*
6a228452d11eaf Stefan Roese        2012-03-13  474  	 * Currently only the properties needed on SPEAr600
6a228452d11eaf Stefan Roese        2012-03-13  475  	 * are provided. All other properties should be added
6a228452d11eaf Stefan Roese        2012-03-13  476  	 * once needed on other platforms.
6a228452d11eaf Stefan Roese        2012-03-13  477  	 */
84c9f8c41df9f6 Dinh Nguyen         2012-07-18  478  	if (of_device_is_compatible(np, "st,spear600-gmac") ||
f9a09687a87887 Alexandre TORGUE    2016-08-29  479  		of_device_is_compatible(np, "snps,dwmac-3.50a") ||
84c9f8c41df9f6 Dinh Nguyen         2012-07-18  480  		of_device_is_compatible(np, "snps,dwmac-3.70a") ||
84c9f8c41df9f6 Dinh Nguyen         2012-07-18  481  		of_device_is_compatible(np, "snps,dwmac")) {
2618abb73c8953 Vince Bridgers      2014-01-20  482  		/* Note that the max-frame-size parameter as defined in the
2618abb73c8953 Vince Bridgers      2014-01-20  483  		 * ePAPR v1.1 spec is defined as max-frame-size, it's
2618abb73c8953 Vince Bridgers      2014-01-20  484  		 * actually used as the IEEE definition of MAC Client
2618abb73c8953 Vince Bridgers      2014-01-20  485  		 * data, or MTU. The ePAPR specification is confusing as
2618abb73c8953 Vince Bridgers      2014-01-20  486  		 * the definition is max-frame-size, but usage examples
2618abb73c8953 Vince Bridgers      2014-01-20  487  		 * are clearly MTUs
2618abb73c8953 Vince Bridgers      2014-01-20  488  		 */
2618abb73c8953 Vince Bridgers      2014-01-20  489  		of_property_read_u32(np, "max-frame-size", &plat->maxmtu);
3b57de958e2aa3 Vince Bridgers      2014-07-31  490  		of_property_read_u32(np, "snps,multicast-filter-bins",
3b57de958e2aa3 Vince Bridgers      2014-07-31  491  				     &plat->multicast_filter_bins);
3b57de958e2aa3 Vince Bridgers      2014-07-31  492  		of_property_read_u32(np, "snps,perfect-filter-entries",
3b57de958e2aa3 Vince Bridgers      2014-07-31  493  				     &plat->unicast_filter_entries);
3b57de958e2aa3 Vince Bridgers      2014-07-31  494  		plat->unicast_filter_entries = dwmac1000_validate_ucast_entries(
c3a502deaf1f0d Andy Shevchenko     2019-09-05  495  				&pdev->dev, plat->unicast_filter_entries);
3b57de958e2aa3 Vince Bridgers      2014-07-31  496  		plat->multicast_filter_bins = dwmac1000_validate_mcast_bins(
c3a502deaf1f0d Andy Shevchenko     2019-09-05  497  				&pdev->dev, plat->multicast_filter_bins);
6a228452d11eaf Stefan Roese        2012-03-13  498  		plat->has_gmac = 1;
6a228452d11eaf Stefan Roese        2012-03-13  499  		plat->pmt = 1;
6a228452d11eaf Stefan Roese        2012-03-13  500  	}
6a228452d11eaf Stefan Roese        2012-03-13  501  
ee2ae1ed46251d Alexandre TORGUE    2016-04-01  502  	if (of_device_is_compatible(np, "snps,dwmac-4.00") ||
026e57585ff159 Christophe Roullier 2018-05-25  503  	    of_device_is_compatible(np, "snps,dwmac-4.10a") ||
026e57585ff159 Christophe Roullier 2018-05-25  504  	    of_device_is_compatible(np, "snps,dwmac-4.20a")) {
ee2ae1ed46251d Alexandre TORGUE    2016-04-01  505  		plat->has_gmac4 = 1;
7cc99fd29b9829 Niklas Cassel       2016-12-07  506  		plat->has_gmac = 0;
ee2ae1ed46251d Alexandre TORGUE    2016-04-01  507  		plat->pmt = 1;
ee2ae1ed46251d Alexandre TORGUE    2016-04-01  508  		plat->tso_en = of_property_read_bool(np, "snps,tso");
ee2ae1ed46251d Alexandre TORGUE    2016-04-01  509  	}
ee2ae1ed46251d Alexandre TORGUE    2016-04-01  510  
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  511  	if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  512  		of_device_is_compatible(np, "snps,dwmac-3.710")) {
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  513  		plat->enh_desc = 1;
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  514  		plat->bugged_jumbo = 1;
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  515  		plat->force_sf_dma_mode = 1;
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  516  	}
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  517  
a3f142478a5aa1 Jose Abreu          2018-08-08  518  	if (of_device_is_compatible(np, "snps,dwxgmac")) {
a3f142478a5aa1 Jose Abreu          2018-08-08  519  		plat->has_xgmac = 1;
a3f142478a5aa1 Jose Abreu          2018-08-08  520  		plat->pmt = 1;
a3f142478a5aa1 Jose Abreu          2018-08-08  521  		plat->tso_en = of_property_read_bool(np, "snps,tso");
a3f142478a5aa1 Jose Abreu          2018-08-08  522  	}
a3f142478a5aa1 Jose Abreu          2018-08-08  523  
64c3b252e9fc82 Byungho An          2013-08-24  524  	dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg),
64c3b252e9fc82 Byungho An          2013-08-24  525  			       GFP_KERNEL);
277323814e4956 Mathieu Olivari     2015-05-27  526  	if (!dma_cfg) {
d2ed0a7755fe14 Johan Hovold        2016-11-30  527  		stmmac_remove_config_dt(pdev, plat);
af5ab092fba22b Jiaxun Yang         2019-10-30  528  		return -ENOMEM;
277323814e4956 Mathieu Olivari     2015-05-27  529  	}
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  530  	plat->dma_cfg = dma_cfg;
a332e2fa56343c Niklas Cassel       2016-12-07  531  
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  532  	of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl);
a332e2fa56343c Niklas Cassel       2016-12-07  533  	if (!dma_cfg->pbl)
a332e2fa56343c Niklas Cassel       2016-12-07  534  		dma_cfg->pbl = DEFAULT_DMA_PBL;
89caaa2d80b7bf Niklas Cassel       2016-12-07  535  	of_property_read_u32(np, "snps,txpbl", &dma_cfg->txpbl);
89caaa2d80b7bf Niklas Cassel       2016-12-07  536  	of_property_read_u32(np, "snps,rxpbl", &dma_cfg->rxpbl);
4022d039a31595 Niklas Cassel       2016-12-07  537  	dma_cfg->pblx8 = !of_property_read_bool(np, "snps,no-pbl-x8");
a332e2fa56343c Niklas Cassel       2016-12-07  538  
afea03656add70 Giuseppe Cavallaro  2016-02-29  539  	dma_cfg->aal = of_property_read_bool(np, "snps,aal");
a332e2fa56343c Niklas Cassel       2016-12-07  540  	dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst");
a332e2fa56343c Niklas Cassel       2016-12-07  541  	dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst");
a332e2fa56343c Niklas Cassel       2016-12-07  542  
e2a240c7d3bceb Sonic Zhang         2013-08-28  543  	plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode");
e2a240c7d3bceb Sonic Zhang         2013-08-28  544  	if (plat->force_thresh_dma_mode) {
e2a240c7d3bceb Sonic Zhang         2013-08-28  545  		plat->force_sf_dma_mode = 0;
c3a502deaf1f0d Andy Shevchenko     2019-09-05  546  		dev_warn(&pdev->dev,
c3a502deaf1f0d Andy Shevchenko     2019-09-05  547  			 "force_sf_dma_mode is ignored if force_thresh_dma_mode is set.\n");
356f9e74ffaafd Olof Johansson      2013-09-05  548  	}
25c83b5c2e8256 Srinivas Kandagatla 2013-07-04  549  
02e57b9d7c8ce9 Giuseppe CAVALLARO  2016-06-24  550  	of_property_read_u32(np, "snps,ps-speed", &plat->mac_port_sel_speed);
02e57b9d7c8ce9 Giuseppe CAVALLARO  2016-06-24  551  
afea03656add70 Giuseppe Cavallaro  2016-02-29  552  	plat->axi = stmmac_axi_setup(pdev);
afea03656add70 Giuseppe Cavallaro  2016-02-29  553  
2ee2132ffb83e3 Niklas Cassel       2018-02-19  554  	rc = stmmac_mtl_setup(pdev, plat);
2ee2132ffb83e3 Niklas Cassel       2018-02-19  555  	if (rc) {
2ee2132ffb83e3 Niklas Cassel       2018-02-19  556  		stmmac_remove_config_dt(pdev, plat);
af5ab092fba22b Jiaxun Yang         2019-10-30  557  		return rc;
2ee2132ffb83e3 Niklas Cassel       2018-02-19  558  	}
d976a525c37127 Joao Pinto          2017-03-10  559  
f573c0b9c4e026 jpinto              2017-01-09  560  	/* clock setup */
ddfbee9e3204a0 Thierry Reding      2019-07-26  561  	if (!of_device_is_compatible(np, "snps,dwc-qos-ethernet-4.10")) {
f573c0b9c4e026 jpinto              2017-01-09  562  		plat->stmmac_clk = devm_clk_get(&pdev->dev,
f573c0b9c4e026 jpinto              2017-01-09  563  						STMMAC_RESOURCE_NAME);
f573c0b9c4e026 jpinto              2017-01-09  564  		if (IS_ERR(plat->stmmac_clk)) {
f573c0b9c4e026 jpinto              2017-01-09  565  			dev_warn(&pdev->dev, "Cannot get CSR clock\n");
f573c0b9c4e026 jpinto              2017-01-09  566  			plat->stmmac_clk = NULL;
f573c0b9c4e026 jpinto              2017-01-09  567  		}
f573c0b9c4e026 jpinto              2017-01-09  568  		clk_prepare_enable(plat->stmmac_clk);
ddfbee9e3204a0 Thierry Reding      2019-07-26  569  	}
f573c0b9c4e026 jpinto              2017-01-09  570  
f573c0b9c4e026 jpinto              2017-01-09  571  	plat->pclk = devm_clk_get(&pdev->dev, "pclk");
f573c0b9c4e026 jpinto              2017-01-09  572  	if (IS_ERR(plat->pclk)) {
f573c0b9c4e026 jpinto              2017-01-09  573  		if (PTR_ERR(plat->pclk) == -EPROBE_DEFER)
f573c0b9c4e026 jpinto              2017-01-09  574  			goto error_pclk_get;
f573c0b9c4e026 jpinto              2017-01-09  575  
f573c0b9c4e026 jpinto              2017-01-09  576  		plat->pclk = NULL;
f573c0b9c4e026 jpinto              2017-01-09  577  	}
f573c0b9c4e026 jpinto              2017-01-09  578  	clk_prepare_enable(plat->pclk);
f573c0b9c4e026 jpinto              2017-01-09  579  
f573c0b9c4e026 jpinto              2017-01-09  580  	/* Fall-back to main clock in case of no PTP ref is passed */
9fbb9dd8eee459 Thierry Reding      2017-03-10  581  	plat->clk_ptp_ref = devm_clk_get(&pdev->dev, "ptp_ref");
f573c0b9c4e026 jpinto              2017-01-09  582  	if (IS_ERR(plat->clk_ptp_ref)) {
f573c0b9c4e026 jpinto              2017-01-09  583  		plat->clk_ptp_rate = clk_get_rate(plat->stmmac_clk);
f573c0b9c4e026 jpinto              2017-01-09  584  		plat->clk_ptp_ref = NULL;
f573c0b9c4e026 jpinto              2017-01-09  585  		dev_warn(&pdev->dev, "PTP uses main clock\n");
f573c0b9c4e026 jpinto              2017-01-09  586  	} else {
f573c0b9c4e026 jpinto              2017-01-09  587  		plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref);
fd3984e6e78a56 Heiner Kallweit     2017-02-02  588  		dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate);
f573c0b9c4e026 jpinto              2017-01-09  589  	}
f573c0b9c4e026 jpinto              2017-01-09  590  
f573c0b9c4e026 jpinto              2017-01-09  591  	plat->stmmac_rst = devm_reset_control_get(&pdev->dev,
f573c0b9c4e026 jpinto              2017-01-09  592  						  STMMAC_RESOURCE_NAME);
f573c0b9c4e026 jpinto              2017-01-09  593  	if (IS_ERR(plat->stmmac_rst)) {
f573c0b9c4e026 jpinto              2017-01-09  594  		if (PTR_ERR(plat->stmmac_rst) == -EPROBE_DEFER)
f573c0b9c4e026 jpinto              2017-01-09  595  			goto error_hw_init;
f573c0b9c4e026 jpinto              2017-01-09  596  
f573c0b9c4e026 jpinto              2017-01-09  597  		dev_info(&pdev->dev, "no reset control found\n");
f573c0b9c4e026 jpinto              2017-01-09  598  		plat->stmmac_rst = NULL;
f573c0b9c4e026 jpinto              2017-01-09  599  	}
f573c0b9c4e026 jpinto              2017-01-09  600  
af5ab092fba22b Jiaxun Yang         2019-10-30  601  	return 0;
f573c0b9c4e026 jpinto              2017-01-09  602  
f573c0b9c4e026 jpinto              2017-01-09  603  error_hw_init:
f573c0b9c4e026 jpinto              2017-01-09  604  	clk_disable_unprepare(plat->pclk);
f573c0b9c4e026 jpinto              2017-01-09  605  error_pclk_get:
f573c0b9c4e026 jpinto              2017-01-09  606  	clk_disable_unprepare(plat->stmmac_clk);
f573c0b9c4e026 jpinto              2017-01-09  607  
af5ab092fba22b Jiaxun Yang         2019-10-30  608  	return -EPROBE_DEFER;
af5ab092fba22b Jiaxun Yang         2019-10-30  609  }
af5ab092fba22b Jiaxun Yang         2019-10-30  610  

:::::: The code at line 401 was first introduced by commit
:::::: 6a228452d11eaf1f1577261540ec0903a2af7f61 stmmac: Add device-tree support

:::::: TO: Stefan Roese <sr@xxxxxxx>
:::::: CC: David S. Miller <davem@xxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux