From patchwork Wed Jul 30 15:50:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 4650141 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 6B876C0338 for ; Wed, 30 Jul 2014 15:51:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 463F720158 for ; Wed, 30 Jul 2014 15:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B61D120122 for ; Wed, 30 Jul 2014 15:51:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754238AbaG3PvP (ORCPT ); Wed, 30 Jul 2014 11:51:15 -0400 Received: from mga01.intel.com ([192.55.52.88]:1155 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753783AbaG3PvO (ORCPT ); Wed, 30 Jul 2014 11:51:14 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 30 Jul 2014 08:50:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,764,1400050800"; d="scan'208";a="577751292" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.73]) by fmsmga002.fm.intel.com with ESMTP; 30 Jul 2014 08:50:32 -0700 Received: from andy by smile with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XCW99-0004wB-AO; Wed, 30 Jul 2014 18:50:31 +0300 From: Andy Shevchenko To: Mark Brown , linux-spi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v2] spi: topcliff-pch: don't hardcode PCI slot to get DMA device Date: Wed, 30 Jul 2014 18:50:30 +0300 Message-Id: <1406735430-18943-1-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.0.1 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.6 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 The DMA is a function 0 of the multifunction device where SPI host is attached. Thus, we may avoid to hardcode PCI slot number. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-topcliff-pch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index af51d6a..0a87ec3 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -874,8 +874,8 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw) dma_cap_set(DMA_SLAVE, mask); /* Get DMA's dev information */ - dma_dev = pci_get_bus_and_slot(data->board_dat->pdev->bus->number, - PCI_DEVFN(12, 0)); + dma_dev = pci_get_slot(data->board_dat->pdev->bus, + PCI_DEVFN(PCI_SLOT(data->board_dat->pdev->devfn), 0)); /* Set Tx DMA */ param = &dma->param_tx;