From patchwork Wed Sep 16 14:23:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 518432 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7759A14010F for ; Thu, 17 Sep 2015 00:24:20 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754415AbbIPOYM (ORCPT ); Wed, 16 Sep 2015 10:24:12 -0400 Received: from mga03.intel.com ([134.134.136.65]:59069 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754407AbbIPOYJ (ORCPT ); Wed, 16 Sep 2015 10:24:09 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 16 Sep 2015 07:24:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,539,1437462000"; d="scan'208";a="562841085" Received: from black.fi.intel.com ([10.237.72.93]) by FMSMGA003.fm.intel.com with ESMTP; 16 Sep 2015 07:24:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A06434A; Wed, 16 Sep 2015 17:24:05 +0300 (EEST) From: Andy Shevchenko To: linux-i2c@vger.kernel.org, Wolfram Sang , Neil Horman , Mika Westerberg Cc: Andy Shevchenko Subject: [PATCH 2/6] i2c: ismt: PCI core handles power state for us Date: Wed, 16 Sep 2015 17:23:59 +0300 Message-Id: <1442413443-123579-2-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1442413443-123579-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1442413443-123579-1-git-send-email-andriy.shevchenko@linux.intel.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org There is no need to repeat the work that is already done in the PCI driver core. Remove suspend and resume callbacks. Note that there is no more calls performed to enable or disable a PCI device during suspend-resume cycle. Nowadays they seems to be superflous. Someone can read more in [1]. [1] https://www.kernel.org/doc/ols/2009/ols2009-pages-319-330.pdf Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-ismt.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c index b7a68b5..570b0a0 100644 --- a/drivers/i2c/busses/i2c-ismt.c +++ b/drivers/i2c/busses/i2c-ismt.c @@ -947,44 +947,11 @@ static void ismt_remove(struct pci_dev *pdev) i2c_del_adapter(&priv->adapter); } -/** - * ismt_suspend() - place the device in suspend - * @pdev: PCI-Express device - * @mesg: PM message - */ -#ifdef CONFIG_PM -static int ismt_suspend(struct pci_dev *pdev, pm_message_t mesg) -{ - pci_save_state(pdev); - pci_set_power_state(pdev, pci_choose_state(pdev, mesg)); - return 0; -} - -/** - * ismt_resume() - PCI resume code - * @pdev: PCI-Express device - */ -static int ismt_resume(struct pci_dev *pdev) -{ - pci_set_power_state(pdev, PCI_D0); - pci_restore_state(pdev); - return pci_enable_device(pdev); -} - -#else - -#define ismt_suspend NULL -#define ismt_resume NULL - -#endif - static struct pci_driver ismt_driver = { .name = "ismt_smbus", .id_table = ismt_ids, .probe = ismt_probe, .remove = ismt_remove, - .suspend = ismt_suspend, - .resume = ismt_resume, }; module_pci_driver(ismt_driver);