From patchwork Tue Jan 7 11:04:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3447091 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 3EBC7C02DC for ; Tue, 7 Jan 2014 11:04:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DFBF2011E for ; Tue, 7 Jan 2014 11:04:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FD5F20109 for ; Tue, 7 Jan 2014 11:04:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751005AbaAGLEP (ORCPT ); Tue, 7 Jan 2014 06:04:15 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:37813 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbaAGLEO (ORCPT ); Tue, 7 Jan 2014 06:04:14 -0500 Received: by mail-pb0-f47.google.com with SMTP id um1so19741625pbc.34 for ; Tue, 07 Jan 2014 03:04:13 -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=fA8OescBrxTIgHKxkNTtWaTA8gl3/n/QEstBqOP2BSs=; b=hL62onzYqYspQTuh0f411BBNSQss6YeBhScB0KgUmKFpKJX/OLWrft+9nyCL4PgmcV aezUm0M+mxkF8R/fd3pd/bcnS1fwelBxCJY5/ev0Q2Ub0QFYWzN7ckEDJUIKAs/eCLlI gabGymSgDCwulvluz66RKauFUeGB/1iZ1XyXDKHLL+q9uI54C+lBLqr+llYZd80p+peG HuFy6MFmVz9NDVjkJwmsrMNrfa0CRxnmvCjVuYwaT7LaaKZ3FfT/KUYj9TaWJMvqiU6h Ud6G4O3PE+krwRybsogvJtvMnUXVQjMNJi1524FYG09HlZtfqz0yq16xuuTOaAgD1Gt9 hKhw== X-Gm-Message-State: ALoCoQmYPUR+m8gXS2DqugboV2bmBxIBU8FNAhbiPDHWrSpdBgeWL834UjngIDjOie/aukY34/zr X-Received: by 10.68.170.66 with SMTP id ak2mr133025622pbc.5.1389092653672; Tue, 07 Jan 2014 03:04:13 -0800 (PST) Received: from [1.167.66.79] (1-167-66-79.dynamic.hinet.net. [1.167.66.79]) by mx.google.com with ESMTPSA id zc6sm127745517pab.0.2014.01.07.03.04.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Jan 2014 03:04:12 -0800 (PST) Message-ID: <1389092643.3991.1.camel@phoenix> Subject: [PATCH v2] spi: ti-qspi: Fix getting correct address for qspi From: Axel Lin To: Mark Brown Cc: Sourav Poddar , linux-spi@vger.kernel.org Date: Tue, 07 Jan 2014 19:04:03 +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 Now platform_get_drvdata() returns the address of qspi rather than master. Also drop unneeded spi_unregister_master() call in ti_qspi_remove() because we use devm_spi_register_master() in probe. commit cbcabb7a300b "spi/qspi: Fix qspi remove path" assumes platform_get_drvdata() returns address of master. However, commit 160a061301c7 "spi/qspi: set correct platform drvdata in ti_qspi_probe()" pass qspi to platform_set_drvdata(). Signed-off-by: Axel Lin Reviewed-by: Sourav Poddar --- v2: Update commit log, and drop fixes tag ( the fixes commit id is wrong). drivers/spi/spi-ti-qspi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 9190e03..4b413e9 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -563,13 +563,9 @@ free_master: static int ti_qspi_remove(struct platform_device *pdev) { - struct spi_master *master; - struct ti_qspi *qspi; + struct ti_qspi *qspi = platform_get_drvdata(pdev); int ret; - master = platform_get_drvdata(pdev); - qspi = spi_master_get_devdata(master); - ret = pm_runtime_get_sync(qspi->dev); if (ret < 0) { dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); @@ -581,8 +577,6 @@ static int ti_qspi_remove(struct platform_device *pdev) pm_runtime_put(qspi->dev); pm_runtime_disable(&pdev->dev); - spi_unregister_master(master); - return 0; }