From patchwork Tue Jan 7 08:25:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3446101 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 709E79F1C4 for ; Tue, 7 Jan 2014 08:26:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AC6C200F4 for ; Tue, 7 Jan 2014 08:26:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6882220109 for ; Tue, 7 Jan 2014 08:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752059AbaAGIZ7 (ORCPT ); Tue, 7 Jan 2014 03:25:59 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36175 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752024AbaAGIZ6 (ORCPT ); Tue, 7 Jan 2014 03:25:58 -0500 Received: by mail-pa0-f52.google.com with SMTP id ld10so77032pab.39 for ; Tue, 07 Jan 2014 00:25:56 -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=dw1eTQuPcS8g3/n5VAxBzl72mYB+UQt2Wh34JkkY7Ow=; b=AnssyBd+nkhHxa8NenfxX2Wm6FWGR68DFoCuDlQTi7+pwm6tF2RuVVGavn+AHDHFfa xe8ZlNE/ZvR50knXg+HgcOFPdAP9HSg67evSn+VOf02LtRiiEX9Z7kGCaC54ThEYXNvc 1P73pOI7vJEXpgTqe0wOF0GX2rHy0/TWLq6zTPtluhe40vndypfGfS9EDoSnm+L7SO1R aMQJGxt+hGSMSbkGkL3pM/6EO7Uy7Wcc7QV1kE4UF+z4tF/vYchsdbaWpO/nakWbjSwC BBLYlDi2i9EUGknfXSJ6CQi69QfJukT4YWHJ5Hcd3KXQa2TH+xICRWWbubKN81m3rEOg rQWA== X-Gm-Message-State: ALoCoQm2jg2FkOsg8/Aqh+6CNl5QM1BOIgRO/6x60VgeK4H6/phnPRqTbZbg3nANw6M/GCOBjb1m X-Received: by 10.66.162.74 with SMTP id xy10mr3726446pab.4.1389083156635; Tue, 07 Jan 2014 00:25:56 -0800 (PST) Received: from [192.168.1.102] (111-240-80-205.dynamic.hinet.net. [111.240.80.205]) by mx.google.com with ESMTPSA id sx8sm175670832pab.5.2014.01.07.00.25.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Jan 2014 00:25:55 -0800 (PST) Message-ID: <1389083150.24471.0.camel@phoenix> Subject: [PATCH] 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 16:25:50 +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 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. Fixes: f17414c4fcf1 (spi/qspi: set correct platform drvdata in ti_qspi_probe()) Signed-off-by: Axel Lin --- 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; }