From patchwork Tue Feb 25 11:57:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3716041 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2A8D39F2F7 for ; Tue, 25 Feb 2014 11:57:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52EDA2009C for ; Tue, 25 Feb 2014 11:57:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 341EB201D3 for ; Tue, 25 Feb 2014 11:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbaBYL50 (ORCPT ); Tue, 25 Feb 2014 06:57:26 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:37067 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751463AbaBYL50 (ORCPT ); Tue, 25 Feb 2014 06:57:26 -0500 Received: by mail-pb0-f42.google.com with SMTP id rr13so3446973pbb.15 for ; Tue, 25 Feb 2014 03:57:26 -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=ilyVq4ozW9kig+8ihbyzOQFZH217afjRRXMk7mwrWME=; b=A19oXeiPYk4GmOxzstciBuOpb1fjEzAlOhwzaAOnzAfHm2LEX6shei8g01pWlwwEXE 7eo3132H/8H1q1MDIvr1y533QpBsIHQAbhqWPb6Z2sfwkgdjuKixsvXgFn3k7LXP+0AF 3P1m7w3oPtsPD+Go3XG/izyZmQEtGykMIC1pyfa4CvW0VdfEfdlTC8mQbZVW1nC9K2Rf IzCNmSfk3IKHtT6fmc9w5V1bcfX5sOqqaY+7BiybK6lS56sgWCIXnuwQIbu2uAnA258N BEN3PX+PPtXFdRWF2+UNQssA5gB3DWGdyhnbAGuB2qt44NL+vVjVugOtbLDvegX6hf/f MvPA== X-Gm-Message-State: ALoCoQkMRjMmDzhciSbjG/BAWjldhSBpfVxfe48nHhnfA+VtTUG6jqyEFCsqBrljmLwsfPIVI9yr X-Received: by 10.66.139.169 with SMTP id qz9mr1353627pab.16.1393329446045; Tue, 25 Feb 2014 03:57:26 -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 ns7sm9940574pbc.32.2014.02.25.03.57.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 03:57:25 -0800 (PST) Message-ID: <1393329439.6723.6.camel@phoenix> Subject: [PATCH] spi: atmel: Let spi core handle validating transfer length From: Axel Lin To: Mark Brown Cc: Richard Genoud , Nicolas Ferre , linux-spi@vger.kernel.org Date: Tue, 25 Feb 2014 19:57:19 +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-atmel.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index c3ed7ed..878fe93 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1079,14 +1079,6 @@ static int atmel_spi_one_transfer(struct spi_master *master, } } - if (xfer->bits_per_word > 8) { - if (xfer->len % 2) { - dev_dbg(&spi->dev, - "buffer len should be 16 bits aligned\n"); - return -EINVAL; - } - } - /* * DMA map early, for performance (empties dcache ASAP) and * better fault reporting.