Skip to contentSkip to conversation

mmc: meson-gx: constify member data of struct meson_host

PATCH In review Heiner Kallweit 2 participants 2 messages Feb 15, 2023 – Feb 17, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: meson-gx: constify member data of struct meson_host

Constify member data of struct meson_host. This also allows to remove the cast as of_device_get_match_data() returns a const void *.

---
 drivers/mmc/host/meson-gx-mmc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/host/meson-gx-mmc.c +2 -3
index 6ed95c555..641ea4292 100644
@@ -150,7 +150,7 @@ struct sd_emmc_desc {
 
 struct meson_host {
 	struct	device		*dev;
-	struct	meson_mmc_data *data;
+	const struct meson_mmc_data *data;
 	struct	mmc_host	*mmc;
 	struct	mmc_command	*cmd;
 
@@ -1195,8 +1195,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
 	if (mmc->caps & MMC_CAP_SDIO_IRQ)
 		mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
 
-	host->data = (struct meson_mmc_data *)
-		of_device_get_match_data(&pdev->dev);
+	host->data = of_device_get_match_data(&pdev->dev);
 	if (!host->data)
 		return -EINVAL;
 
Signature · 1 line
2.39.1
#1 lore raw
Quoted 5 lines · Heiner Kallweit

Constify member data of struct meson_host. This also allows to remove the cast as of_device_get_match_data() returns a const void *.

Applied for next, thanks!

Kind regards
Uffe

Quoted 30 lines
---
 drivers/mmc/host/meson-gx-mmc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mmc/host/meson-gx-mmc.c +2 -4
index 6ed95c555..641ea4292 100644
@@ -150,7 +150,7 @@ struct sd_emmc_desc {
 
 struct meson_host {
        struct  device          *dev;
-       struct  meson_mmc_data *data;
+       const struct meson_mmc_data *data;
        struct  mmc_host        *mmc;
        struct  mmc_command     *cmd;
 
@@ -1195,8 +1195,7 @@ static int meson_mmc_probe(struct platform_device *pdev)
        if (mmc->caps & MMC_CAP_SDIO_IRQ)
                mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD;
 
-       host->data = (struct meson_mmc_data *)
-               of_device_get_match_data(&pdev->dev);
+       host->data = of_device_get_match_data(&pdev->dev);
        if (!host->data)
                return -EINVAL;
 
--

2.39.1