Re: [PATCH] spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE

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

 



Hello Mark,

On Wed, 2022-11-30 at 14:57 +0000, Mark Brown wrote:
> >   	/* read requests */
> >   	case SPI_IOC_RD_MODE:
> > -		retval = put_user(spi->mode & SPI_MODE_MASK,
> > -					(__u8 __user *)arg);
> > +		tmp = spi->mode;
> > +
> > +		{
> > +			struct spi_controller *ctlr = spi-
> > >controller;
> > +
> > +			if (ctlr->use_gpio_descriptors && ctlr-
> > >cs_gpiods &&
> > +			    ctlr->cs_gpiods[spi->chip_select])
> > +				tmp &= ~SPI_CS_HIGH;
> > +		}
> > +
> > +		retval = put_user(tmp & SPI_MODE_MASK, (__u8
> > __user *)arg);
> >   		break;
> >   	case SPI_IOC_RD_MODE32:
> >   		retval = put_user(spi->mode & SPI_MODE_MASK,
> 
> What about SPI_IOC_RD_MODE_32?  On the write path the code is
> shared...

you are right, thanks for this hint!
I'll re-send if there are no objections to this approach in general.

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux