Skip to content

Commit

Permalink
mmc: host: phytium-mci-plat: Convert to platform remove callback retu…
Browse files Browse the repository at this point in the history
…rning void

0edb555: platform: Make platform_driver::remove() return void
cause build error, so convert .remove from int to void

Log:
drivers/mmc/host/phytium-mci-plat.c:181:19: error: initialization of ‘void (*)(struct platform_device *)’ from incompatible pointer type ‘int (*)(struct platform_device *)’ [-Werror=incompatible-pointer-types]
  181 |         .remove = phytium_mci_remove,
      |                   ^~~~~~~~~~~~~~~~~~
drivers/mmc/host/phytium-mci-plat.c:181:19: note: (near initialization for ‘phytium_mci_driver.<anonymous>.remove’)
  • Loading branch information
opsiff authored and MingcongBai committed Nov 14, 2024
1 parent ed6a641 commit 976e1c4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/mmc/host/phytium-mci-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ static int phytium_mci_probe(struct platform_device *pdev)
return ret;
}

static int phytium_mci_remove(struct platform_device *pdev)
static void phytium_mci_remove(struct platform_device *pdev)
{
struct mmc_host *mmc;
struct phytium_mci_host *host;

mmc = platform_get_drvdata(pdev);
if (!mmc) {
dev_info(&pdev->dev, "%s %d: mmc is null.\n", __func__, __LINE__);
return -1;
return;
}
host = mmc_priv(mmc);
if (!host) {
dev_info(&pdev->dev, "%s %d: host is null.\n", __func__, __LINE__);
mmc_remove_host(mmc);
mmc_free_host(mmc);
return -1;
return;
}
del_timer(&host->hotplug_timer);
mmc_remove_host(host->mmc);
Expand All @@ -155,7 +155,6 @@ static int phytium_mci_remove(struct platform_device *pdev)
phytium_mci_deinit_hw(host);
mmc_free_host(mmc);
platform_set_drvdata(pdev, NULL);
return 0;
}

static const struct of_device_id phytium_mci_of_ids[] = {
Expand Down

0 comments on commit 976e1c4

Please sign in to comment.