mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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>
This commit is contained in:
@@ -121,10 +121,9 @@ static void pic32_sdhci_shared_bus(struct platform_device *pdev)
|
|||||||
writel(bus, host->ioaddr + SDH_SHARED_BUS_CTRL);
|
writel(bus, host->ioaddr + SDH_SHARED_BUS_CTRL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pic32_sdhci_probe_platform(struct platform_device *pdev,
|
static void pic32_sdhci_probe_platform(struct platform_device *pdev,
|
||||||
struct pic32_sdhci_priv *pdata)
|
struct pic32_sdhci_priv *pdata)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
u32 caps_slot_type;
|
u32 caps_slot_type;
|
||||||
struct sdhci_host *host = platform_get_drvdata(pdev);
|
struct sdhci_host *host = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
@@ -133,8 +132,6 @@ static int pic32_sdhci_probe_platform(struct platform_device *pdev,
|
|||||||
caps_slot_type = (host->caps & SDH_CAPS_SDH_SLOT_TYPE_MASK) >> 30;
|
caps_slot_type = (host->caps & SDH_CAPS_SDH_SLOT_TYPE_MASK) >> 30;
|
||||||
if (caps_slot_type == SDH_SLOT_TYPE_SHARED_BUS)
|
if (caps_slot_type == SDH_SLOT_TYPE_SHARED_BUS)
|
||||||
pic32_sdhci_shared_bus(pdev);
|
pic32_sdhci_shared_bus(pdev);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pic32_sdhci_probe(struct platform_device *pdev)
|
static int pic32_sdhci_probe(struct platform_device *pdev)
|
||||||
@@ -193,11 +190,7 @@ static int pic32_sdhci_probe(struct platform_device *pdev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto err_base_clk;
|
goto err_base_clk;
|
||||||
|
|
||||||
ret = pic32_sdhci_probe_platform(pdev, sdhci_pdata);
|
pic32_sdhci_probe_platform(pdev, sdhci_pdata);
|
||||||
if (ret) {
|
|
||||||
dev_err(&pdev->dev, "failed to probe platform!\n");
|
|
||||||
goto err_base_clk;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = sdhci_add_host(host);
|
ret = sdhci_add_host(host);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
Reference in New Issue
Block a user