aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2019-02-03 09:27:00 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2019-02-25 08:40:58 +0100
commitc58ccf2b6de7d52994f9bb93227dfabf8077de24 (patch)
treedde415f6e1e29f1d00045b9877506d0fb4d3af4d /include/linux/mmc
parentmmc: bcm2835: Drop DMA channel error pointer check (diff)
downloadlinux-dev-c58ccf2b6de7d52994f9bb93227dfabf8077de24.tar.xz
linux-dev-c58ccf2b6de7d52994f9bb93227dfabf8077de24.zip
mmc: bcm2835: Drop pointer to mmc_host from bcm2835_host
The BCM2835 MMC host driver uses a pointer to get from the private bcm2835_host structure to the generic mmc_host structure. However the latter is always immediately preceding the former in memory, so compute its address with a subtraction (which is cheaper than a dereference) and drop the superfluous pointer. No functional change intended. Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Alexander Graf <agraf@suse.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/host.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 4d35ff36ceff..d893902b2f1c 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -478,6 +478,11 @@ static inline void *mmc_priv(struct mmc_host *host)
return (void *)host->private;
}
+static inline struct mmc_host *mmc_from_priv(void *priv)
+{
+ return container_of(priv, struct mmc_host, private);
+}
+
#define mmc_host_is_spi(host) ((host)->caps & MMC_CAP_SPI)
#define mmc_dev(x) ((x)->parent)