From patchwork Fri Jun 6 11:38:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 4311281 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 2A3E89F3DF for ; Fri, 6 Jun 2014 11:39:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 53FB1201CD for ; Fri, 6 Jun 2014 11:38:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 55646201DD for ; Fri, 6 Jun 2014 11:38:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630AbaFFLi6 (ORCPT ); Fri, 6 Jun 2014 07:38:58 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:62257 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbaFFLi5 (ORCPT ); Fri, 6 Jun 2014 07:38:57 -0400 Received: by mail-wi0-f181.google.com with SMTP id n15so797263wiw.14 for ; Fri, 06 Jun 2014 04:38:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=HYHnMw5azsNcJEJ91JEsaK6eHBlgU9wiDIKiBxd4EXc=; b=IqY60M31al8q64TfoX7r0dW0olwl85EhSjedtZmGQdmUoFTxwKFlzmEDm5LeKiK31w sQs9fEUhCqaRjJ2Ej1uCwF+BNj5vhT+SrGZwpQj03TVpqePfXEpngPr29L8XzEUlY8eZ wW4ZpLh8a6WZ4bDLAk1HKQCbobebI27yKdiE5V1W2NQWnHcA6qgpcLciM94MFj1g932W Sov1PC1bbWVFQthFkI3aVsxWtyk38ZYllZ9RnYkx+c9rEu1SdLrKg/AfU7RSAUeQxsdx DxIJl81F6ZalhivKF8cGoSRh4LSkoi7CXEJ1yZ/D7dWokHh26lQHqSdarXJuNZ0T9gHy NV0w== X-Received: by 10.14.183.5 with SMTP id p5mr157992eem.52.1402054735581; Fri, 06 Jun 2014 04:38:55 -0700 (PDT) Received: from ramsan.of.borg (d54c1488d.access.telenet.be. [84.193.72.141]) by mx.google.com with ESMTPSA id z44sm22276243eep.39.2014.06.06.04.38.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Jun 2014 04:38:55 -0700 (PDT) From: Geert Uytterhoeven X-Google-Original-From: Geert Uytterhoeven To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-sh@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/2] spi: rspi: Pass spi_master pointer to rspi_release_dma() Date: Fri, 6 Jun 2014 13:38:43 +0200 Message-Id: <1402054723-30682-3-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1402054723-30682-1-git-send-email-geert+renesas@glider.be> References: <1402054723-30682-1-git-send-email-geert+renesas@glider.be> 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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 rspi_release_dma() doesn't need access to any fields in the driver private data, except for the pointer to the SPI master object. Hence just pass the needed pointer. Signed-off-by: Geert Uytterhoeven --- drivers/spi/spi-rspi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index ddee9df1547d..38fd938d6360 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -926,19 +926,19 @@ static int rspi_request_dma(struct device *dev, struct spi_master *master, return 0; } -static void rspi_release_dma(struct rspi_data *rspi) +static void rspi_release_dma(struct spi_master *master) { - if (rspi->master->dma_tx) - dma_release_channel(rspi->master->dma_tx); - if (rspi->master->dma_rx) - dma_release_channel(rspi->master->dma_rx); + if (master->dma_tx) + dma_release_channel(master->dma_tx); + if (master->dma_rx) + dma_release_channel(master->dma_rx); } static int rspi_remove(struct platform_device *pdev) { struct rspi_data *rspi = platform_get_drvdata(pdev); - rspi_release_dma(rspi); + rspi_release_dma(rspi->master); pm_runtime_disable(&pdev->dev); return 0; @@ -1140,7 +1140,7 @@ static int rspi_probe(struct platform_device *pdev) return 0; error3: - rspi_release_dma(rspi); + rspi_release_dma(master); error2: pm_runtime_disable(&pdev->dev); error1: