From patchwork Fri Dec 27 05:51:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trent Piepho X-Patchwork-Id: 3408331 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5ECF4C02DC for ; Fri, 27 Dec 2013 05:51:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A47D20144 for ; Fri, 27 Dec 2013 05:51:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B590F2012B for ; Fri, 27 Dec 2013 05:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752325Ab3L0FvX (ORCPT ); Fri, 27 Dec 2013 00:51:23 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:54874 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783Ab3L0FvU (ORCPT ); Fri, 27 Dec 2013 00:51:20 -0500 Received: by mail-pa0-f47.google.com with SMTP id kq14so8976630pab.20 for ; Thu, 26 Dec 2013 21:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=EEGNT+6Bo+DGPz+ysEFI8BLu18G6w2dIuW6VRmoMyfg=; b=Ech3crzKDP/c6uMof5gv2yUxP6NqRYa0jgm5H5eG4vlCUJ3j7p5yA8h836k5yk6Kld i4ftmrGe8pRzL7GyZJRWJKxvqFYKgbS8iFSXtFFinaLQynn9TIpHfXphTlzTm0EASUjp ODl64Y/FvwaOo384FIm/pi5cVclH6W2T51qL/lQsCG+WyHyoiI281ABLpEr2WUzdGHjT FDGijcKzYcb3w6RiR/AjJ+LjxMub9rQbUm5hCcaTJAUBy3zL+mQzrYJXw8ieHFvWkUZj hK7YhuOzoEsCPl4XVl026GYKkludY5yV5C/7juL7HWP0Fir283Mz+bbqSXOw/tdZnANN 4hzQ== X-Received: by 10.68.17.41 with SMTP id l9mr48171394pbd.76.1388123480358; Thu, 26 Dec 2013 21:51:20 -0800 (PST) Received: from localhost.localdomain (174-31-206-19.tukw.qwest.net. [174.31.206.19]) by mx.google.com with ESMTPSA id ik1sm14582270pbb.18.2013.12.26.21.51.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 26 Dec 2013 21:51:19 -0800 (PST) From: Trent Piepho To: linux-spi@vger.kernel.org Cc: Mark Brown , Trent Piepho Subject: [PATCH] spi: Eliminate 3WIRE spi_transfer check Date: Thu, 26 Dec 2013 21:51:06 -0800 Message-Id: <1388123466-7525-1-git-send-email-tpiepho@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Checking for SPI_3WIRE isn't needed. spi_setup() already prevents 3WIRE mode from being combined with DUAL or QUAD mode support. So there is no need to differentiate between a single bit device with SPI_3WIRE set and one with without. It doesn't change the allowed bit widths. Signed-off-by: Trent Piepho --- Extracted from "spi: Simplify bit width checking code" as there seemed to be no debate about this part. drivers/spi/spi.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 98f4b77..302ffac 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1678,9 +1678,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message) if ((xfer->tx_nbits == SPI_NBITS_QUAD) && !(spi->mode & SPI_TX_QUAD)) return -EINVAL; - if ((spi->mode & SPI_3WIRE) && - (xfer->tx_nbits != SPI_NBITS_SINGLE)) - return -EINVAL; } /* check transfer rx_nbits */ if (xfer->rx_buf) { @@ -1694,9 +1691,6 @@ static int __spi_validate(struct spi_device *spi, struct spi_message *message) if ((xfer->rx_nbits == SPI_NBITS_QUAD) && !(spi->mode & SPI_RX_QUAD)) return -EINVAL; - if ((spi->mode & SPI_3WIRE) && - (xfer->rx_nbits != SPI_NBITS_SINGLE)) - return -EINVAL; } }