From patchwork Wed Mar 5 05:37:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3770761 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 3BDCD9F376 for ; Wed, 5 Mar 2014 05:37:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6EBCB20225 for ; Wed, 5 Mar 2014 05:37:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 664AC20221 for ; Wed, 5 Mar 2014 05:37:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751544AbaCEFhK (ORCPT ); Wed, 5 Mar 2014 00:37:10 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:42445 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750747AbaCEFhG (ORCPT ); Wed, 5 Mar 2014 00:37:06 -0500 Received: by mail-pd0-f175.google.com with SMTP id x10so576939pdj.34 for ; Tue, 04 Mar 2014 21:37:06 -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=rvL8e8g5/bNgJ/p5mADi4QYqqMq9aRktWrybSXJ6Jeg=; b=Kio0rTtFANm0yntWVRP/O0mYB3CBE65CACGSwUt6GZgS+uBNcjpDp30X75W/NWlE/Z eR0gJuD/8kCGM8fAzItPj4uaj4O4R5r3SPMEU72nbGSy3A8ultCLeGuyB38Z7ZyDeHom gTdT2sFmW/Wveil/bfqUV0L8o4efBU6MCzVEb7Vj++kjZJcmtAk/GSBXQkkUtnPsM3OS kc2ogN5BU7ZuflyWzxQ+ujucmqw5bIdxjqo770oe+dKrfaRhK4QO1WATlqxhOCKyRa+m O4FzRCMC7WN7zUiEAPBW0wxvKr4pTUPR1gwTK9B0mWGweAe60EuHzLRU6+YdkaoX4s/n f6RA== X-Gm-Message-State: ALoCoQnOrB9Wsj3cQQj7FPnJ5XBklWEcGu10g9bQEC9tEH68QleLb2f97U2bZAVsFvcgfhQQx974 X-Received: by 10.66.118.71 with SMTP id kk7mr4589433pab.14.1393997825916; Tue, 04 Mar 2014 21:37:05 -0800 (PST) Received: from [192.168.0.102] (218-164-139-107.dynamic.hinet.net. [218.164.139.107]) by mx.google.com with ESMTPSA id it4sm3613171pbc.39.2014.03.04.21.37.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 21:37:05 -0800 (PST) Message-ID: <1393997820.19790.2.camel@phoenix> Subject: [PATCH] spi: altera: Use bits_per_word_mask From: Axel Lin To: Mark Brown Cc: Thomas Chou , linux-spi@vger.kernel.org Date: Wed, 05 Mar 2014 13:37:00 +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 This driver does not work for bits_per_word greater than 16. Set bits_per_word_mask so spi core will reject transfers that attempt to use an unsupported bits_per_word value. Signed-off-by: Axel Lin --- drivers/spi/spi-altera.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c index 1928b83..f83f626 100644 --- a/drivers/spi/spi-altera.c +++ b/drivers/spi/spi-altera.c @@ -213,6 +213,7 @@ static int altera_spi_probe(struct platform_device *pdev) master->bus_num = pdev->id; master->num_chipselect = 16; master->mode_bits = SPI_CS_HIGH; + master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 16); hw = spi_master_get_devdata(master); platform_set_drvdata(pdev, hw);