From patchwork Mon Jun 16 13:06:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 4358841 Return-Path: X-Original-To: patchwork-linux-wireless@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 C08889F314 for ; Mon, 16 Jun 2014 13:06:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E16222020E for ; Mon, 16 Jun 2014 13:06:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 227672016C for ; Mon, 16 Jun 2014 13:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752018AbaFPNGV (ORCPT ); Mon, 16 Jun 2014 09:06:21 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:36424 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbaFPNGU (ORCPT ); Mon, 16 Jun 2014 09:06:20 -0400 Received: by mail-wi0-f176.google.com with SMTP id n3so4032036wiv.3 for ; Mon, 16 Jun 2014 06:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=PM4cCyMIyT4ImKiflx02MqY9F/fPNFmu0E2cn9HzAo8=; b=D1AhMvZ0gTq0xJlE3fifSerBBU8kH/IIczpfLe3WNFXj7qnE3GCnfZkBMR0n4Deq/A CxA57afJoP5TmUq5e/p/RmS7cgZFRcQTaMfh5IXtnvQi3bfDfNHenWF+qMazsmxgE403 R7wH+W+0izLk7D8d6fdjlXumSu2wx7i5rD2GNSWXZirmXr1zxpfbHck8QWkv6D/gm824 hmjAIl60vHbSLOI8EVf6O38kPhCqynkdpWv35GdRnrOV482jrFdFomqYKYy6cW0JAKIv 0MEUdMzYIZ1VxCH9dAlaPhg0pvE7DOzHyQMHEnQgvgRvnXsUR8zCYpNlo5g1seIjD33J Ubzg== X-Received: by 10.194.190.42 with SMTP id gn10mr28683897wjc.9.1402923979252; Mon, 16 Jun 2014 06:06:19 -0700 (PDT) Received: from ramsan.of.borg (d54C1488D.access.telenet.be. [84.193.72.141]) by mx.google.com with ESMTPSA id c43sm1033645eeg.11.2014.06.16.06.06.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jun 2014 06:06:18 -0700 (PDT) From: Geert Uytterhoeven To: "Mark A. Greer" , Samuel Ortiz Cc: linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] NFC: trf7970a: Move trf7970a_init inside #ifdef CONFIG_PM_RUNTIME Date: Mon, 16 Jun 2014 15:06:13 +0200 Message-Id: <1402923973-24316-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 If CONFIG_PM_RUNTIME=n: drivers/nfc/trf7970a.c:755: warning: ‘trf7970a_init’ defined but not used Signed-off-by: Geert Uytterhoeven --- drivers/nfc/trf7970a.c | 80 +++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c index 3b78b031e617..41a153ecc6ed 100644 --- a/drivers/nfc/trf7970a.c +++ b/drivers/nfc/trf7970a.c @@ -751,45 +751,6 @@ static void trf7970a_timeout_work_handler(struct work_struct *work) mutex_unlock(&trf->lock); } -static int trf7970a_init(struct trf7970a *trf) -{ - int ret; - - dev_dbg(trf->dev, "Initializing device - state: %d\n", trf->state); - - ret = trf7970a_cmd(trf, TRF7970A_CMD_SOFT_INIT); - if (ret) - goto err_out; - - ret = trf7970a_cmd(trf, TRF7970A_CMD_IDLE); - if (ret) - goto err_out; - - /* Must clear NFC Target Detection Level reg due to erratum */ - ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL, 0); - if (ret) - goto err_out; - - ret = trf7970a_write(trf, TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS, - TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96 | - TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32); - if (ret) - goto err_out; - - ret = trf7970a_write(trf, TRF7970A_SPECIAL_FCN_REG1, 0); - if (ret) - goto err_out; - - trf->special_fcn_reg1 = 0; - - trf->iso_ctrl = 0xff; - return 0; - -err_out: - dev_dbg(trf->dev, "Couldn't init device: %d\n", ret); - return ret; -} - static void trf7970a_switch_rf_off(struct trf7970a *trf) { dev_dbg(trf->dev, "Switching rf off\n"); @@ -1430,6 +1391,45 @@ static int trf7970a_pm_runtime_suspend(struct device *dev) return ret; } +static int trf7970a_init(struct trf7970a *trf) +{ + int ret; + + dev_dbg(trf->dev, "Initializing device - state: %d\n", trf->state); + + ret = trf7970a_cmd(trf, TRF7970A_CMD_SOFT_INIT); + if (ret) + goto err_out; + + ret = trf7970a_cmd(trf, TRF7970A_CMD_IDLE); + if (ret) + goto err_out; + + /* Must clear NFC Target Detection Level reg due to erratum */ + ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL, 0); + if (ret) + goto err_out; + + ret = trf7970a_write(trf, TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS, + TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96 | + TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32); + if (ret) + goto err_out; + + ret = trf7970a_write(trf, TRF7970A_SPECIAL_FCN_REG1, 0); + if (ret) + goto err_out; + + trf->special_fcn_reg1 = 0; + + trf->iso_ctrl = 0xff; + return 0; + +err_out: + dev_dbg(trf->dev, "Couldn't init device: %d\n", ret); + return ret; +} + static int trf7970a_pm_runtime_resume(struct device *dev) { struct spi_device *spi = container_of(dev, struct spi_device, dev); @@ -1462,7 +1462,7 @@ static int trf7970a_pm_runtime_resume(struct device *dev) return 0; } -#endif +#endif /* CONFIG_PM_RUNTIME */ static const struct dev_pm_ops trf7970a_pm_ops = { SET_RUNTIME_PM_OPS(trf7970a_pm_runtime_suspend,