Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp605257ybt; Wed, 1 Jul 2020 06:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbJ4kVqzcNF8AvwW3lT3YHlX3c/1RgAaycYz0Azbhb2tTaWzNhwWnXzmukX8annHZy3Tvw X-Received: by 2002:a17:906:2988:: with SMTP id x8mr14580760eje.141.1593608825024; Wed, 01 Jul 2020 06:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593608825; cv=none; d=google.com; s=arc-20160816; b=t/B1Prc0C5FSDBjjHkaVWWiWHhVl4BsF30fyVYeblzoM5wokpOaXci7n+zwaoN4EZp FtA+3aaAO2lbJ+jPp0OTxvBvmwu3IKowvr6gGoSszPiqLDqdAlUYqAWsUfr+BAVj/6CF Kdlf6gLbS8UXrVSkpJuXSof2bsrMk1k8I39dZQEMDDLx9KSmhsF7KHPb+d6HaPslU8fk KUMsNn9EPFxrNZuf1GpJdmNiHhTgnyiyU6v5cIK60s+h7ig6Yk02+0+k4NVmOevFQ9Bs gkK0d37POvYwZ3K+D8I4jhXQnGx8N14eoOHd9Zg9LEe6kTMsdO4oesEWlZDyX8P+YhuG i5qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kPREycfu6FufAZszREhE/oVuVmbyYHJrTGXZmdD6YwE=; b=TTN1RmUnX/WkMDPAl0uTLICJNYZqybJJ2GlMRREKjj0hqtrdRSurwfppUtndhkiAVE jV0MGU3IRNIbF8X2InzHj5/2m2N4bVMDZvtbYK5tgX2/qS4/ktAwN0aXV2GDOfvJYekS tzkSM/5X0mBRH7a4MWaSy04nzwJMQJ0kJ3JrUm3auiZa6LmiPMNMw0JwnDqG5tFNIJqK LsachTNUIU7z0jleRxQkeeSFeYtzpWKG8Lgjev8dqmj4oqh7CUKd9lxA77w5HKJlJyuV peHtLsRczfLxzKLshmDCJL3X/GEX0ZxRdfm1g0IpBFL9uzxgq3CUn7Ao4aA7GOkO8CEj LzKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TMZ5p3+7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j34si4130227edb.209.2020.07.01.06.06.42; Wed, 01 Jul 2020 06:07:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TMZ5p3+7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730999AbgGAND1 (ORCPT + 99 others); Wed, 1 Jul 2020 09:03:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730581AbgGANDY (ORCPT ); Wed, 1 Jul 2020 09:03:24 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1681C03E979; Wed, 1 Jul 2020 06:03:24 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id u8so10654733pje.4; Wed, 01 Jul 2020 06:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kPREycfu6FufAZszREhE/oVuVmbyYHJrTGXZmdD6YwE=; b=TMZ5p3+7sgsxQxGBW6HSDXQBZpM0VTrAmpdTYUPksKx5zJJFnIGVrQnNApcgiB+hdV //DsxgQDp9KPV9vmywwH0bkPiEK36FgQkcDqqIk4VU/HZwrBnQLcuVsX94oUZAiqAbE9 bbd5vPaofKicESB9tzUbFzmRkN4sUguGsidFi/JQ15PuypUpvQ4tsSBPatTtUFrF/7pK GBknrJUMtZWnotQ8Ziui4rYPdWXXxQXwS0QZv5nuV5oELVx8U2oLK8PuIMsY+FBcdg1f nqkxcD96g8/Z3keJDVzNbgSYc71hgLod0WXW+IoWg9R1DBY7jMVXlAPP5bOM5k0Ah/z4 VQOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kPREycfu6FufAZszREhE/oVuVmbyYHJrTGXZmdD6YwE=; b=IZw2d/ldthRh1YslSRMdr+VdR27V6uZTev6Wa4Jr0mUrK7ByOeFRbOXnyn84B0HMsy 8GEOuVGx+85TjN2/OZSko2KA3YPtPK+M0bdZgf2SNERy0vZpsp6wwT4mT8r+nAFhK5gp JiiJwpyyzjhM7u2I3O2uMFT8XtHiLd+oUW6jdn03RG53iJdQ7DrRvKtoTE7pigXtWdnj t3Mw/JZGOSls5ZAv8k47dGVDnPiDOGgv4ksmYm9yQtZqSmjQG0pumqK0ilZGPJv7JzBR 3EYW22pdBNNQC5+6bwyD5yAwNcfs8p6eZrztKMXE3sv6/tf7ro0Aeay30b1dRNPCOQiS dtRQ== X-Gm-Message-State: AOAM532/VN+LeluOzsCH/Bjot2Gz6ov+KhQWjjpeQf8+kRP93uvKOBNd IuSZt3dC4ImBDq6Kz/bguzk= X-Received: by 2002:a17:90a:a47:: with SMTP id o65mr29280126pjo.70.1593608603918; Wed, 01 Jul 2020 06:03:23 -0700 (PDT) Received: from varodek.iballbatonwifi.com ([103.105.153.57]) by smtp.gmail.com with ESMTPSA id d9sm6070908pgv.45.2020.07.01.06.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 06:03:23 -0700 (PDT) From: Vaibhav Gupta To: Bjorn Helgaas , Bjorn Helgaas , bjorn@helgaas.com, Vaibhav Gupta , "David S. Miller" , Jakub Kicinski , David Dillow , Ion Badulescu , Netanel Belgazal , Arthur Kiyanovski , Guy Tzalik , Saeed Bishara , Zorik Machulsky , Derek Chickles , Satanand Burla , Felix Manlunas , Denis Kirjanov , Ajit Khaparde , Sriharsha Basavapatna , Somnath Kotur , Tariq Toukan , Jon Mason Cc: Vaibhav Gupta , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org Subject: [PATCH v1 10/11] vxge: use generic power management Date: Wed, 1 Jul 2020 18:29:37 +0530 Message-Id: <20200701125938.639447-11-vaibhavgupta40@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701125938.639447-1-vaibhavgupta40@gmail.com> References: <20200701125938.639447-1-vaibhavgupta40@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With legacy PM, drivers themselves were responsible for managing the device's power states and takes care of register states. After upgrading to the generic structure, PCI core will take care of required tasks and drivers should do only device-specific operations. Use "struct dev_pm_ops" variable to bind the callbacks. Compile-tested only. Signed-off-by: Vaibhav Gupta --- drivers/net/ethernet/neterion/vxge/vxge-main.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c index 9b63574b6202..5de85b9e9e35 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c @@ -3999,12 +3999,11 @@ static void vxge_print_parm(struct vxgedev *vdev, u64 vpath_mask) } } -#ifdef CONFIG_PM /** * vxge_pm_suspend - vxge power management suspend entry point * */ -static int vxge_pm_suspend(struct pci_dev *pdev, pm_message_t state) +static int __maybe_unused vxge_pm_suspend(struct device *dev_d) { return -ENOSYS; } @@ -4012,13 +4011,11 @@ static int vxge_pm_suspend(struct pci_dev *pdev, pm_message_t state) * vxge_pm_resume - vxge power management resume entry point * */ -static int vxge_pm_resume(struct pci_dev *pdev) +static int __maybe_unused vxge_pm_resume(struct device *dev_d) { return -ENOSYS; } -#endif - /** * vxge_io_error_detected - called when PCI error is detected * @pdev: Pointer to PCI device @@ -4796,15 +4793,14 @@ static const struct pci_error_handlers vxge_err_handler = { .resume = vxge_io_resume, }; +static SIMPLE_DEV_PM_OPS(vxge_pm_ops, vxge_pm_suspend, vxge_pm_resume); + static struct pci_driver vxge_driver = { .name = VXGE_DRIVER_NAME, .id_table = vxge_id_table, .probe = vxge_probe, .remove = vxge_remove, -#ifdef CONFIG_PM - .suspend = vxge_pm_suspend, - .resume = vxge_pm_resume, -#endif + .driver.pm = &vxge_pm_ops, .err_handler = &vxge_err_handler, }; -- 2.27.0