Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-pic32: Make pic32_sdhci_probe_platform() void

pic32_sdhci_probe_platform() always returned 0, so there's no reason for
a return value. In addition, pic32_sdhci_probe() checked the return value
for possible error which is unnecessary.

Convert pic32_sdhci_probe_platform() to a void function and remove the
return value check. Fix the following Coccinelle warning:

./drivers/mmc/host/sdhci-pic32.c:127:5-8: Unneeded variable: "ret". Return "0" on line 137

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Link: https://lore.kernel.org/r/1604847648-13036-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Kaixu Xia and committed by
Ulf Hansson
c24aa7b1 9f7d4c91

+2 -9
+2 -9
drivers/mmc/host/sdhci-pic32.c
··· 121 121 writel(bus, host->ioaddr + SDH_SHARED_BUS_CTRL); 122 122 } 123 123 124 - static int pic32_sdhci_probe_platform(struct platform_device *pdev, 124 + static void pic32_sdhci_probe_platform(struct platform_device *pdev, 125 125 struct pic32_sdhci_priv *pdata) 126 126 { 127 - int ret = 0; 128 127 u32 caps_slot_type; 129 128 struct sdhci_host *host = platform_get_drvdata(pdev); 130 129 ··· 132 133 caps_slot_type = (host->caps & SDH_CAPS_SDH_SLOT_TYPE_MASK) >> 30; 133 134 if (caps_slot_type == SDH_SLOT_TYPE_SHARED_BUS) 134 135 pic32_sdhci_shared_bus(pdev); 135 - 136 - return ret; 137 136 } 138 137 139 138 static int pic32_sdhci_probe(struct platform_device *pdev) ··· 190 193 if (ret) 191 194 goto err_base_clk; 192 195 193 - ret = pic32_sdhci_probe_platform(pdev, sdhci_pdata); 194 - if (ret) { 195 - dev_err(&pdev->dev, "failed to probe platform!\n"); 196 - goto err_base_clk; 197 - } 196 + pic32_sdhci_probe_platform(pdev, sdhci_pdata); 198 197 199 198 ret = sdhci_add_host(host); 200 199 if (ret)