Re: [PATCH v4 5/8] mmc: sdhci-pxav2: add optional core clock

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

 



Hi Doug,

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Doug-Brown/mmc-sdhci-pxav2-add-initial-support-for-PXA168-V1-controller/20230112-102921
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link:    https://lore.kernel.org/r/20230112022416.8474-6-doug%40schmorgal.com
patch subject: [PATCH v4 5/8] mmc: sdhci-pxav2: add optional core clock
config: riscv-randconfig-m041-20230113
compiler: riscv64-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Reported-by: Dan Carpenter <error27@xxxxxxxxx>

smatch warnings:
drivers/mmc/host/sdhci-pxav2.c:220 sdhci_pxav2_probe() warn: missing error code 'ret'

vim +/ret +220 drivers/mmc/host/sdhci-pxav2.c

c3be1efd41a97f Bill Pemberton        2012-11-19  185  static int sdhci_pxav2_probe(struct platform_device *pdev)
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  186  {
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  187  	struct sdhci_pltfm_host *pltfm_host;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  188  	struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  189  	struct device *dev = &pdev->dev;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  190  	struct sdhci_host *host = NULL;
568536d7eb1969 Doug Brown            2023-01-11  191  	const struct sdhci_pxa_variant *variant;
b650352dd3df36 Chris Ball            2012-04-10  192  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  193  	int ret;
d8981da5ec7505 Doug Brown            2023-01-11  194  	struct clk *clk, *clk_core;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  195  
0e748234293f5f Christian Daudt       2013-05-29  196  	host = sdhci_pltfm_init(pdev, NULL, 0);
6a686c31324c9e Sebastian Hesselbarth 2014-10-21  197  	if (IS_ERR(host))
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  198  		return PTR_ERR(host);
6a686c31324c9e Sebastian Hesselbarth 2014-10-21  199  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  200  	pltfm_host = sdhci_priv(host);
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  201  
edf4ccd94bbef1 Doug Brown            2023-01-11  202  	clk = devm_clk_get(dev, "io");
edf4ccd94bbef1 Doug Brown            2023-01-11  203  	if (IS_ERR(clk) && PTR_ERR(clk) != -EPROBE_DEFER)
edf4ccd94bbef1 Doug Brown            2023-01-11  204  		clk = devm_clk_get(dev, NULL);
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  205  	if (IS_ERR(clk)) {
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  206  		ret = PTR_ERR(clk);
edf4ccd94bbef1 Doug Brown            2023-01-11  207  		dev_err_probe(dev, ret, "failed to get io clock\n");
3fd1d86f03cbcc Masahiro Yamada       2017-08-23  208  		goto free;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  209  	}
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  210  	pltfm_host->clk = clk;
21b22284619bbb Alexey Khoroshilov    2017-02-11  211  	ret = clk_prepare_enable(clk);
21b22284619bbb Alexey Khoroshilov    2017-02-11  212  	if (ret) {
edf4ccd94bbef1 Doug Brown            2023-01-11  213  		dev_err(dev, "failed to enable io clock\n");
3fd1d86f03cbcc Masahiro Yamada       2017-08-23  214  		goto free;
21b22284619bbb Alexey Khoroshilov    2017-02-11  215  	}
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  216  
d8981da5ec7505 Doug Brown            2023-01-11  217  	clk_core = devm_clk_get_optional_enabled(dev, "core");
d8981da5ec7505 Doug Brown            2023-01-11  218  	if (IS_ERR(clk_core)) {
d8981da5ec7505 Doug Brown            2023-01-11  219  		dev_err_probe(dev, PTR_ERR(clk_core), "failed to enable core clock\n");
d8981da5ec7505 Doug Brown            2023-01-11 @220  		goto disable_clk;

ret = PTR_ERR(clk_core);

d8981da5ec7505 Doug Brown            2023-01-11  221  	}
d8981da5ec7505 Doug Brown            2023-01-11  222  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  223  	host->quirks = SDHCI_QUIRK_BROKEN_ADMA
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  224  		| SDHCI_QUIRK_BROKEN_TIMEOUT_VAL
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  225  		| SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  226  
568536d7eb1969 Doug Brown            2023-01-11  227  	variant = of_device_get_match_data(dev);
568536d7eb1969 Doug Brown            2023-01-11  228  	if (variant)
b650352dd3df36 Chris Ball            2012-04-10  229  		pdata = pxav2_get_mmc_pdata(dev);
568536d7eb1969 Doug Brown            2023-01-11  230  	else
568536d7eb1969 Doug Brown            2023-01-11  231  		variant = &pxav2_variant;
568536d7eb1969 Doug Brown            2023-01-11  232  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  233  	if (pdata) {
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  234  		if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  235  			/* on-chip device */
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  236  			host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  237  			host->mmc->caps |= MMC_CAP_NONREMOVABLE;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  238  		}
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  239  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  240  		/* If slot design supports 8 bit data, indicate this to MMC. */
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  241  		if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT)
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  242  			host->mmc->caps |= MMC_CAP_8_BIT_DATA;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  243  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  244  		if (pdata->quirks)
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  245  			host->quirks |= pdata->quirks;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  246  		if (pdata->host_caps)
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  247  			host->mmc->caps |= pdata->host_caps;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  248  		if (pdata->pm_caps)
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  249  			host->mmc->pm_caps |= pdata->pm_caps;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  250  	}
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  251  
568536d7eb1969 Doug Brown            2023-01-11  252  	host->quirks |= variant->extra_quirks;
568536d7eb1969 Doug Brown            2023-01-11  253  	host->ops = variant->ops;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  254  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  255  	ret = sdhci_add_host(host);
fb8617e1ee4d40 Jisheng Zhang         2018-05-25  256  	if (ret)
3fd1d86f03cbcc Masahiro Yamada       2017-08-23  257  		goto disable_clk;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  258  
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  259  	return 0;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  260  
3fd1d86f03cbcc Masahiro Yamada       2017-08-23  261  disable_clk:
164378efe7612a Chao Xie              2012-07-31  262  	clk_disable_unprepare(clk);
3fd1d86f03cbcc Masahiro Yamada       2017-08-23  263  free:
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  264  	sdhci_pltfm_free(pdev);
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  265  	return ret;
9f5d71e4a78a02 Zhangfei Gao          2011-06-08  266  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests




[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