From patchwork Wed Mar 19 03:55:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3857131 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 3BF33BF549 for ; Wed, 19 Mar 2014 18:03:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 790F720120 for ; Wed, 19 Mar 2014 18:03:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B78B2021A for ; Wed, 19 Mar 2014 18:03:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757899AbaCSDzT (ORCPT ); Tue, 18 Mar 2014 23:55:19 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:44938 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756662AbaCSDzS (ORCPT ); Tue, 18 Mar 2014 23:55:18 -0400 Received: by mail-pb0-f49.google.com with SMTP id jt11so8185851pbb.8 for ; Tue, 18 Mar 2014 20:55:18 -0700 (PDT) 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:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=YnwC24CfrVWx6Ri+Ffxvh/TdC0z5ccYbm/dymQ/ZGjg=; b=RT+0VVpWOhbTrOQIywJanW8CPxdVqZtAUG+TqXUItuj8oYHS464Wt3AmJEIRTNS1oX w+xZt0y4lDCq5AjVM6wilQdH7Wc0C9ib8Z7A3no8GtwSrE95B3BWQO/2FzGZCI1eDJee qA9MdQxviA1Ospiwu2YFjm7cTNNAaEl7jlh2XfFcAYW43zKfAUv6tGZo9r5D5B3DZvBQ fdyAWlth3ZN1AyaGWjp47Hk/kAjdsnDhuSdLQ1GdFZinnbDhW7cV1kzduycnbm9Pt07u tuXJw/k6fu+lCB2eD7RzzCUkQB69SUd2xdkKuNq3HfOupyFJntSN/Icjri13Usc/026T DQhQ== X-Gm-Message-State: ALoCoQn+TgAZrUjcQwxB2nw2ialiUbApZCaMw2kh4MV7vuPc96sMEp8PpzQEYdYqbOEZrQUHxuWS X-Received: by 10.68.191.39 with SMTP id gv7mr37151959pbc.90.1395201318093; Tue, 18 Mar 2014 20:55:18 -0700 (PDT) Received: from [192.168.0.102] (218-164-140-191.dynamic.hinet.net. [218.164.140.191]) by mx.google.com with ESMTPSA id xi5sm96807808pab.27.2014.03.18.20.55.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 18 Mar 2014 20:55:17 -0700 (PDT) Message-ID: <1395201313.16346.3.camel@phoenix> Subject: [PATCH 2/7] spi: atmel: Let spi core validate Tx/Rx buffers for non-zero length transfer From: Axel Lin To: Mark Brown Cc: Wenyou Yang , linux-spi@vger.kernel.org Date: Wed, 19 Mar 2014 11:55:13 +0800 In-Reply-To: <1395201227.16346.1.camel@phoenix> References: <1395201227.16346.1.camel@phoenix> X-Mailer: Evolution 3.8.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, T_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 Signed-off-by: Axel Lin --- drivers/spi/spi-atmel.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index bda961e..c54492b 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1065,11 +1065,6 @@ static int atmel_spi_one_transfer(struct spi_master *master, as = spi_master_get_devdata(master); - if (!(xfer->tx_buf || xfer->rx_buf) && xfer->len) { - dev_dbg(&spi->dev, "missing rx or tx buf\n"); - return -EINVAL; - } - if (xfer->bits_per_word) { asd = spi->controller_state; bits = (asd->csr >> 4) & 0xf;