From patchwork Tue Feb 25 11:16:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3715641 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 12DF6BF13A for ; Tue, 25 Feb 2014 11:17:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CA0C201D3 for ; Tue, 25 Feb 2014 11:17:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD201201CD for ; Tue, 25 Feb 2014 11:17:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752212AbaBYLRN (ORCPT ); Tue, 25 Feb 2014 06:17:13 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:43169 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbaBYLRJ (ORCPT ); Tue, 25 Feb 2014 06:17:09 -0500 Received: by mail-pd0-f169.google.com with SMTP id v10so7705546pde.28 for ; Tue, 25 Feb 2014 03:17:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=x3oVz2mLKvFnd+qOkEeiCDzEJ35pVyXApvnLx6iRZxg=; b=lsxIoA2HJmnROkdkEvR1Kwevrlf+tRdmO5WbwH2npN29hR+tSiLm0d8XGBKaw0fBmj +aKS6vnjHm5I4lRpOhQXAItaNnYOFrlzm2X5BLe/9ZmFweTbO9OeygcvXqwfcVO6wJko K8OFHpF7nQvsUlesHu4qxerGAeCEDqv/J6aSMh1TOBczYFTMEgIF3BW6w858ZYqIDCsX HnU2PKE0/nl+2+S21jg8nLYUgK7dsCruKIE+xzS2pwspxeoXr2Ja9vXMrInqkzkAAoi0 Nj+wZAz5wNBUfzE3bGCgHsn5Tg6goxEbMLUuBvkNcAsNFBNdjckwMNgPaeFO/IDmSukF y1Vg== X-Gm-Message-State: ALoCoQnmJlFNBEO0nNto/eueLSDhiIx/+QGQfgS1xRiIQn0EM3NevOBtWpgCvgwboVR0kW2QkHYs X-Received: by 10.66.141.144 with SMTP id ro16mr899650pab.131.1393327028750; Tue, 25 Feb 2014 03:17:08 -0800 (PST) Received: from [220.138.156.149] (220-138-156-149.dynamic.hinet.net. [220.138.156.149]) by mx.google.com with ESMTPSA id tu3sm140939153pab.1.2014.02.25.03.17.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 03:17:08 -0800 (PST) Message-ID: <1393327017.6723.1.camel@phoenix> Subject: [PATCH 1/3] spi: orion: Let spi core handle validating transfer length From: Axel Lin To: Mark Brown Cc: Shadi Ammouri , linux-spi@vger.kernel.org Date: Tue, 25 Feb 2014 19:16:57 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 spi core will handle validating transfer length since commit 4d94bd21b333 "spi: core: Validate length of the transfers in message". So remove the same checking in this driver. Signed-off-by: Axel Lin --- drivers/spi/spi-orion.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index 01bd85f..d018a4a 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -295,17 +295,6 @@ static int orion_spi_transfer_one_message(struct spi_master *master, goto msg_done; list_for_each_entry(t, &m->transfers, transfer_list) { - /* make sure buffer length is even when working in 16 - * bit mode*/ - if ((t->bits_per_word == 16) && (t->len & 1)) { - dev_err(&spi->dev, - "message rejected : " - "odd data length %d while in 16 bit mode\n", - t->len); - status = -EIO; - goto msg_done; - } - if (par_override || t->speed_hz || t->bits_per_word) { par_override = 1; status = orion_spi_setup_transfer(spi, t);