From patchwork Fri Feb 14 01:53:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3649221 X-Patchwork-Delegate: broonie@sirena.org.uk 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 90D669F38E for ; Fri, 14 Feb 2014 01:53:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2AFA20204 for ; Fri, 14 Feb 2014 01:53:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED58D201ED for ; Fri, 14 Feb 2014 01:53:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751582AbaBNBx1 (ORCPT ); Thu, 13 Feb 2014 20:53:27 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:40358 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751558AbaBNBxF (ORCPT ); Thu, 13 Feb 2014 20:53:05 -0500 Received: by mail-pa0-f41.google.com with SMTP id fa1so11659031pad.28 for ; Thu, 13 Feb 2014 17:53:05 -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=8W4UHMH4YkkphNDE1toB9DtSoHwlfuWcags4e2G7Dms=; b=gYZZ3aH6HbF1AifoXZFJRAC/tDmMXxdafZTYT6Deeo6CLNayBa4fpZzFp0wnuy0EjS 1hb7c5BNMSbDfEkX976/M2w2Xt10qLFMuSRUKeiLNDnCP7ePy7YjAHfu9Jta+JC1dsWY nlt6lHKrX7Tag2jlbdgboMt0EQQmLsAMKQRiYstresbUtKC56h+Qs7etXOElfbP01cIL 6OiyfA8cNCvQrM74uA/+psgPWDVx8ZrtUdBa71pK763cgfXxEEW+fe2lR99VAhLikYCZ b82dLtu4kexZPTs/IpwofiKdv7x7vAhO9lZ7YQHxa/eH4tC2+oMV/l0gUwRabhIEOmz+ QgTQ== X-Gm-Message-State: ALoCoQlGOcfrtY7RipulA7gL03fW1Sbm0ATtZKwZU1+hCzK+W+pmdzbP8jN8GMIFKyQLx6BMmF/F X-Received: by 10.68.196.226 with SMTP id ip2mr5583846pbc.106.1392342785253; Thu, 13 Feb 2014 17:53:05 -0800 (PST) Received: from [192.168.0.102] (218-164-130-78.dynamic.hinet.net. [218.164.130.78]) by mx.google.com with ESMTPSA id x5sm11221783pbw.26.2014.02.13.17.53.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Feb 2014 17:53:04 -0800 (PST) Message-ID: <1392342780.22981.0.camel@phoenix> Subject: [PATCH 1/3] spi: coldfire-qspi: Fix getting correct address for *mcfqspi From: Axel Lin To: Mark Brown Cc: Steven King , linux-spi@vger.kernel.org Date: Fri, 14 Feb 2014 09:53:00 +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=-7.5 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 dev_get_drvdata() returns the address of master rather than mcfqspi. Signed-off-by: Axel Lin --- drivers/spi/spi-coldfire-qspi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 0ab2c55..8e4f1c9c 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -508,7 +508,8 @@ static int mcfqspi_resume(struct device *dev) #ifdef CONFIG_PM_RUNTIME static int mcfqspi_runtime_suspend(struct device *dev) { - struct mcfqspi *mcfqspi = dev_get_drvdata(dev); + struct spi_master *master = dev_get_drvdata(dev); + struct mcfqspi *mcfqspi = spi_master_get_devdata(master); clk_disable(mcfqspi->clk); @@ -517,7 +518,8 @@ static int mcfqspi_runtime_suspend(struct device *dev) static int mcfqspi_runtime_resume(struct device *dev) { - struct mcfqspi *mcfqspi = dev_get_drvdata(dev); + struct spi_master *master = dev_get_drvdata(dev); + struct mcfqspi *mcfqspi = spi_master_get_devdata(master); clk_enable(mcfqspi->clk);