mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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>
This commit is contained in:
parent
e5c1e63c93
commit
c58ccf2b6d
2 changed files with 15 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue