From patchwork Wed Feb 26 01:47:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3720241 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 878269F2ED for ; Wed, 26 Feb 2014 01:48:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5B11201EF for ; Wed, 26 Feb 2014 01:48:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B66DE201F0 for ; Wed, 26 Feb 2014 01:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751088AbaBZBsA (ORCPT ); Tue, 25 Feb 2014 20:48:00 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:41868 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbaBZBsA (ORCPT ); Tue, 25 Feb 2014 20:48:00 -0500 Received: by mail-pd0-f181.google.com with SMTP id p10so250578pdj.12 for ; Tue, 25 Feb 2014 17:47:59 -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=yk5DEJqKrpinkFP8PcYDlPRfiiniCwTWUbH61X7H5A0=; b=N3/5VS9RCs6r1HGqeLjhNCpYxhAYdCKXV5luWso+exvQObUNk345B1wGRmy6Dyg5LQ yRu2QkS/dF+dByfe/3eYrlLNjK6HSWY0gd+AWNYAzBZI3luqHnKaV9PiIKG4PPUxt+/P rl4tVNJHAQWRqwIp73V1Ou8uaDl8L6wnca2Gy4o5KfIgsvCtCj7uiRx5b9xq/3sxjWmv YaFh77sa7uvQro1Ob2lbSYYfraYkJgdEdmpeVyDTbQ3QFaTMSZsGHDLFv0YKf3173eqg cyNhpmWhhtNzG+tifbHRuCb8XUxsnqgApj7Z3/keAmClJyqK/v436oxth63CAwDJIwIw gCLw== X-Gm-Message-State: ALoCoQk9HLoJWg+bE8kGAbtCQSWkEtGAgT33gr296VnIEj5ej7L6geUzga5w4BfXkNfLkCDTI0bD X-Received: by 10.68.241.198 with SMTP id wk6mr3285931pbc.11.1393379279645; Tue, 25 Feb 2014 17:47:59 -0800 (PST) Received: from [192.168.1.102] (111-240-56-42.dynamic.hinet.net. [111.240.56.42]) by mx.google.com with ESMTPSA id dc4sm15134726pbc.34.2014.02.25.17.47.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 17:47:58 -0800 (PST) Message-ID: <1393379275.7490.1.camel@phoenix> Subject: [PATCH] spi: coldfire-qspi: Enable clock before calling spi_master_resume From: Axel Lin To: Mark Brown Cc: Steven King , linux-spi@vger.kernel.org Date: Wed, 26 Feb 2014 09:47:55 +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 This ensures clock has been enabled before calling spi_master_resume(). while at it, also add checking return value of spi_master_suspend and spi_master_resume because they may fail. Signed-off-by: Axel Lin --- drivers/spi/spi-coldfire-qspi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index c29bbb0..62daf87 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -467,8 +467,11 @@ static int mcfqspi_suspend(struct device *dev) { struct spi_master *master = dev_get_drvdata(dev); struct mcfqspi *mcfqspi = spi_master_get_devdata(master); + int ret; - spi_master_suspend(master); + ret = spi_master_suspend(master); + if (ret) + return ret; clk_disable(mcfqspi->clk); @@ -480,11 +483,9 @@ static int mcfqspi_resume(struct device *dev) struct spi_master *master = dev_get_drvdata(dev); struct mcfqspi *mcfqspi = spi_master_get_devdata(master); - spi_master_resume(master); - clk_enable(mcfqspi->clk); - return 0; + return spi_master_resume(master); } #endif