From patchwork Mon Jan 13 09:17:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Westerberg X-Patchwork-Id: 3474031 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 01AA09F2E9 for ; Mon, 13 Jan 2014 09:17:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 011A720114 for ; Mon, 13 Jan 2014 09:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC4FE200DF for ; Mon, 13 Jan 2014 09:17:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751396AbaAMJRM (ORCPT ); Mon, 13 Jan 2014 04:17:12 -0500 Received: from mga02.intel.com ([134.134.136.20]:36799 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbaAMJRL (ORCPT ); Mon, 13 Jan 2014 04:17:11 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 13 Jan 2014 01:17:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,651,1384329600"; d="scan'208";a="465729358" Received: from blue.fi.intel.com ([10.237.72.156]) by orsmga002.jf.intel.com with ESMTP; 13 Jan 2014 01:17:05 -0800 Received: by blue.fi.intel.com (Postfix, from userid 1004) id 85408E0090; Mon, 13 Jan 2014 11:17:04 +0200 (EET) From: Mika Westerberg To: linux-spi@vger.kernel.org Cc: Eric Miao , Russell King , Haojian Zhuang , Mark Brown , linux-kernel@vger.kernel.org, Mika Westerberg Subject: [PATCH] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match Date: Mon, 13 Jan 2014 11:17:04 +0200 Message-Id: <1389604624-8412-1-git-send-email-mika.westerberg@linux.intel.com> X-Mailer: git-send-email 1.8.5.2 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.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Commit cddb339badb0 (spi/pxa2xx: convert to dma_request_slave_channel_compat()) converted the driver to use ACPI provided DMA helpers but it forgot to initialize the platform data for the channels to -1. Failing to do so will result inadvertent match in the filter function because 0 is a valid channel number. Prevent this from happening by initializing both platform data channels correctly to -1. Signed-off-by: Mika Westerberg --- drivers/spi/spi-pxa2xx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 7765b1999537..cbc68848789d 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1066,6 +1066,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) pdata->num_chipselect = 1; pdata->enable_dma = true; + pdata->tx_chan_id = -1; + pdata->rx_chan_id = -1; return pdata; }