[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4dvdzVQZDEt09+p@sirena.org.uk>
Date: Wed, 30 Nov 2022 14:57:59 +0000
From: Mark Brown <broonie@...nel.org>
To: "A. Sverdlin" <alexander.sverdlin@...mens.com>
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
Lukas Wunner <lukas@...ner.de>
Subject: Re: [PATCH] spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE
On Wed, Nov 30, 2022 at 03:39:48PM +0100, A. Sverdlin 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...
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists