From patchwork Tue Nov 18 02:43:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5325311 Return-Path: X-Original-To: patchwork-linux-mmc@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 A3B8F9F1E1 for ; Tue, 18 Nov 2014 02:43:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3C7520176 for ; Tue, 18 Nov 2014 02:43:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1148320173 for ; Tue, 18 Nov 2014 02:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433AbaKRCnu (ORCPT ); Mon, 17 Nov 2014 21:43:50 -0500 Received: from mail-qg0-f48.google.com ([209.85.192.48]:41218 "EHLO mail-qg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbaKRCnt (ORCPT ); Mon, 17 Nov 2014 21:43:49 -0500 Received: by mail-qg0-f48.google.com with SMTP id q107so54105qgd.21 for ; Mon, 17 Nov 2014 18:43:49 -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; bh=Uao73oyLaLPLsPo4ViuKTKX2g5ZL18bgn3DE0XDHVWk=; b=E7Cohh0/BKO2AVrqNU9tHQ8Fd7Xk4MWeF6ndVb1cr3wHy0AQz9DHVGBvzVWRX4lEB6 uPM38cQgY3LBtpOclzRy3hsEvm/YeTqRj7ssUCNplADfFoBMhH8+GA6Au6oKBOvoKhZl +JUFr1woF0iLqoP1wg6+nHLesNQZ6weu1PDS+X9W/JnEo6CHMrMDZuPDlbRH1zEh+7GU 1YH6SqYoH3NLnLzTE9JZHnxoD1L2LuvriQWcQMhcp+vYqlOnl/t56uHFYB90t1rXVvgD v3nyK1tn2VrQl96d3DeDnVvLI0/jB1qKzd6/aL2D8uuao2Pd/hhe9xHuJk/RyvAn8uqS Jq/A== X-Received: by 10.140.43.6 with SMTP id d6mr38387059qga.104.1416278629281; Mon, 17 Nov 2014 18:43:49 -0800 (PST) Received: from localhost.localdomain ([201.82.52.106]) by mx.google.com with ESMTPSA id c3sm7211932qaa.14.2014.11.17.18.43.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Nov 2014 18:43:48 -0800 (PST) From: Fabio Estevam To: ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, Fabio Estevam Subject: [PATCH] mmc: mxs-mmc: Simplify PM hooks Date: Tue, 18 Nov 2014 00:43:39 -0200 Message-Id: <1416278619-1831-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_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 From: Fabio Estevam By using SIMPLE_DEV_PM_OPS we can make the code smaller and cleaner. Signed-off-by: Fabio Estevam --- drivers/mmc/host/mxs-mmc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 339059a..c049ac7 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -702,7 +702,7 @@ static int mxs_mmc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int mxs_mmc_suspend(struct device *dev) { struct mmc_host *mmc = dev_get_drvdata(dev); @@ -722,22 +722,17 @@ static int mxs_mmc_resume(struct device *dev) clk_prepare_enable(ssp->clk); return 0; } - -static const struct dev_pm_ops mxs_mmc_pm_ops = { - .suspend = mxs_mmc_suspend, - .resume = mxs_mmc_resume, -}; #endif +static SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume); + static struct platform_driver mxs_mmc_driver = { .probe = mxs_mmc_probe, .remove = mxs_mmc_remove, .id_table = mxs_ssp_ids, .driver = { .name = DRIVER_NAME, -#ifdef CONFIG_PM .pm = &mxs_mmc_pm_ops, -#endif .of_match_table = mxs_mmc_dt_ids, }, };