From patchwork Wed Feb 12 16:30:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 3639131 X-Patchwork-Delegate: broonie@sirena.org.uk 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 4E7CEBF13A for ; Wed, 12 Feb 2014 16:30:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FED1201EC for ; Wed, 12 Feb 2014 16:30:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A512201ED for ; Wed, 12 Feb 2014 16:30:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751917AbaBLQas (ORCPT ); Wed, 12 Feb 2014 11:30:48 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:64131 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752228AbaBLQas (ORCPT ); Wed, 12 Feb 2014 11:30:48 -0500 Received: by mail-pd0-f175.google.com with SMTP id w10so9141195pde.6 for ; Wed, 12 Feb 2014 08:30:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rIlGzpLWMeS7kiccGgUhjWJ2VjBsKt9cZYXQoPgTuWs=; b=NMxed56lErgKS7Hzi1yuD7Lobdo/E1jIWIzrOKROML8vvmfWLqmWAJrutsBmcVcTIq YUtYHXaGFPxo7pgqUrTd0ZZnPmeiBCbQuTthgYWr10ArJNvlV2LnzJKJwjEQme13IN/w iXF3NWbyA7kqJzxfGrLUEkuR3cn24on5AAzYvmwBG2UcoquNB0kJcwx8A4hE3A6MY0Ya uoYagh/ERa0gI2tyB3kIXVcECPVyw2TbsXRziCh1fgHoDL8UeEPu7+frgyHVJf1Joh3G chLNGeTATDyfnG1KFdZUBst8vfoaDAdLQbLqrQ4CGeadQoZ9u9K8Q24XlwhLeD0UTGAN h71Q== X-Received: by 10.66.139.100 with SMTP id qx4mr23681885pab.141.1392222647511; Wed, 12 Feb 2014 08:30:47 -0800 (PST) Received: from localhost.localdomain ([101.44.43.128]) by mx.google.com with ESMTPSA id pe3sm65109259pbc.23.2014.02.12.08.30.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 08:30:46 -0800 (PST) From: Barry Song <21cnbao@gmail.com> To: broonie@kernel.org, linux-spi@vger.kernel.org Cc: workgroup.linux@csr.com, Qipan Li , Barry Song Subject: [PATCH 3/3] spi: sirf: use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries Date: Thu, 13 Feb 2014 00:30:20 +0800 Message-Id: <1392222620-17273-3-git-send-email-21cnbao@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392222620-17273-1-git-send-email-21cnbao@gmail.com> References: <1392222620-17273-1-git-send-email-21cnbao@gmail.com> 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 From: Qipan Li use SET_SYSTEM_SLEEP_PM_OPS to initialize PM entries, this makes the codes clean and also enable the ability of hibernation support for sirf SPI. Signed-off-by: Qipan Li Signed-off-by: Barry Song --- drivers/spi/spi-sirf.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index a213e87..5bffa5f 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c @@ -739,7 +739,7 @@ static int spi_sirfsoc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int spi_sirfsoc_suspend(struct device *dev) { struct spi_master *master = dev_get_drvdata(dev); @@ -762,12 +762,11 @@ static int spi_sirfsoc_resume(struct device *dev) return 0; } +#endif static const struct dev_pm_ops spi_sirfsoc_pm_ops = { - .suspend = spi_sirfsoc_suspend, - .resume = spi_sirfsoc_resume, + SET_SYSTEM_SLEEP_PM_OPS(spi_sirfsoc_suspend, spi_sirfsoc_resume) }; -#endif static const struct of_device_id spi_sirfsoc_of_match[] = { { .compatible = "sirf,prima2-spi", }, @@ -780,9 +779,7 @@ static struct platform_driver spi_sirfsoc_driver = { .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, -#ifdef CONFIG_PM .pm = &spi_sirfsoc_pm_ops, -#endif .of_match_table = spi_sirfsoc_of_match, }, .probe = spi_sirfsoc_probe,