From: Simon Glass Date: Wed, 8 Apr 2020 14:33:00 +0000 (-0600) Subject: dm: mmc: Update mmc_get_mmc_dev() to use const * X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B%20%24style.Permalink%20%7D%7D?a=commitdiff_plain;h=3a905cd231de8834cda329f20854dc1f91328ae5;p=u-boot.git dm: mmc: Update mmc_get_mmc_dev() to use const * This function does not modify the device to change it to use const *, so that callers with a const udevice * can call it without a cast. Signed-off-by: Simon Glass Reviewed-by: Jaehoon Chung --- diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index cb26d841be..f313bc1734 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -239,7 +239,7 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg) return 0; } -struct mmc *mmc_get_mmc_dev(struct udevice *dev) +struct mmc *mmc_get_mmc_dev(const struct udevice *dev) { struct mmc_uclass_priv *upriv; diff --git a/include/mmc.h b/include/mmc.h index 5e9d15cb41..6a2e9739e0 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -377,7 +377,7 @@ struct mmc_uclass_priv { * @dev: Device * @return associated mmc struct pointer if available, else NULL */ -struct mmc *mmc_get_mmc_dev(struct udevice *dev); +struct mmc *mmc_get_mmc_dev(const struct udevice *dev); /* End of driver model support */