Re: [PATCH] iio: adc: max1363: replace mlock with own lock

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

 



On Thu, Feb 27, 2020 at 07:00:31AM +0000, Ardelean, Alexandru wrote:
> On Thu, 2020-02-27 at 00:19 +0530, Rohit Sarkar wrote:
> > [External]
> > 
> > This change replaces indio_dev's mlock with the drivers own lock. In
> > each case the lock is needed to protect the driver's own state.
> > 
> > Signed-off-by: Rohit Sarkar <rohitsarkar5398@xxxxxxxxx>
> > ---
> >  drivers/iio/adc/max1363.c | 13 +++++++------
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
> > index 5c2cc61b666e..b9557f957f3c 100644
> > --- a/drivers/iio/adc/max1363.c
> > +++ b/drivers/iio/adc/max1363.c
> > @@ -169,6 +169,7 @@ struct max1363_state {
> >  	const struct max1363_mode	*current_mode;
> >  	u32				requestedmask;
> >  	struct regulator		*reg;
> > +	struct mutex lock;
> 
> The 'lock' field should be aligned with *reg & requestedmask.
Ah yes, dont know how I missed that.

> Also, it's a good idea to do a 'mutex_init(&st->lock)' in max1363_probe().
> Somewhere after 'st = iio_priv(indio_dev);'

Will do
> Rest looks good
> 

Thanks,
Rohit



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux