* [PATCH] spi: at91-usart: Remove duplicated checking for spi->bits_per_word
@ 2018-10-02 10:10 Axel Lin
2019-03-06 10:57 ` Nicolas.Ferre
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2018-10-02 10:10 UTC (permalink / raw)
To: linux-kernel
Cc: Mark Brown, Radu Pirea, Nicolas Ferre, Lee Jones, linux-spi, Axel Lin
This checking is already done in __spi_validate_bits_per_word().
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/spi/spi-at91-usart.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index a924657642fa..519853f14934 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -176,12 +176,6 @@ static int at91_usart_spi_setup(struct spi_device *spi)
struct at91_usart_spi *aus = spi_master_get_devdata(spi->controller);
u32 *ausd = spi->controller_state;
unsigned int mr = at91_usart_spi_readl(aus, MR);
- u8 bits = spi->bits_per_word;
-
- if (bits != 8) {
- dev_dbg(&spi->dev, "Only 8 bits per word are supported\n");
- return -EINVAL;
- }
if (spi->mode & SPI_CPOL)
mr |= US_MR_CPOL;
@@ -210,7 +204,7 @@ static int at91_usart_spi_setup(struct spi_device *spi)
dev_dbg(&spi->dev,
"setup: bpw %u mode 0x%x -> mr %d %08x\n",
- bits, spi->mode, spi->chip_select, mr);
+ spi->bits_per_word, spi->mode, spi->chip_select, mr);
return 0;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: at91-usart: Remove duplicated checking for spi->bits_per_word
2018-10-02 10:10 [PATCH] spi: at91-usart: Remove duplicated checking for spi->bits_per_word Axel Lin
@ 2019-03-06 10:57 ` Nicolas.Ferre
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas.Ferre @ 2019-03-06 10:57 UTC (permalink / raw)
To: axel.lin, linux-kernel
Cc: broonie, radu_nicolae.pirea, lee.jones, linux-spi, Tudor.Ambarus,
Cristian.Birsan, alexandre.belloni, linux-arm-kernel
On 02/10/2018 at 12:10, Axel Lin wrote:
> This checking is already done in __spi_validate_bits_per_word().
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Agreed:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
(Axel, sorry for the delay)
Best regards,
Nicolas
> ---
> drivers/spi/spi-at91-usart.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> index a924657642fa..519853f14934 100644
> --- a/drivers/spi/spi-at91-usart.c
> +++ b/drivers/spi/spi-at91-usart.c
> @@ -176,12 +176,6 @@ static int at91_usart_spi_setup(struct spi_device *spi)
> struct at91_usart_spi *aus = spi_master_get_devdata(spi->controller);
> u32 *ausd = spi->controller_state;
> unsigned int mr = at91_usart_spi_readl(aus, MR);
> - u8 bits = spi->bits_per_word;
> -
> - if (bits != 8) {
> - dev_dbg(&spi->dev, "Only 8 bits per word are supported\n");
> - return -EINVAL;
> - }
>
> if (spi->mode & SPI_CPOL)
> mr |= US_MR_CPOL;
> @@ -210,7 +204,7 @@ static int at91_usart_spi_setup(struct spi_device *spi)
>
> dev_dbg(&spi->dev,
> "setup: bpw %u mode 0x%x -> mr %d %08x\n",
> - bits, spi->mode, spi->chip_select, mr);
> + spi->bits_per_word, spi->mode, spi->chip_select, mr);
>
> return 0;
> }
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-06 10:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 10:10 [PATCH] spi: at91-usart: Remove duplicated checking for spi->bits_per_word Axel Lin
2019-03-06 10:57 ` Nicolas.Ferre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).