Re: [PATCH 3/4] mmc: bcm2835: Drop pointer to mmc_host from bcm2835_host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 21, 2019 at 03:20:37PM +0100, Alexander Graf wrote:
> On 01/19/2019 04:31 PM, Lukas Wunner wrote:
> > --- 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 priv - offsetof(struct mmc_host, private);
> 
> Can you use container_of() instead here?

Absolutely.  I've no idea why I didn't use it in the first place.

Thanks,

Lukas



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux