dm: mmc: Update mmc_get_mmc_dev() to use const *
authorSimon Glass <sjg@chromium.org>
Wed, 8 Apr 2020 14:33:00 +0000 (08:33 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 24 Apr 2020 20:40:09 +0000 (16:40 -0400)
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 <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/mmc-uclass.c
include/mmc.h

index cb26d84..f313bc1 100644 (file)
@@ -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;
 
index 5e9d15c..6a2e973 100644 (file)
@@ -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 */