Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1762065ybh; Mon, 20 Jul 2020 06:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD3tOSc3OLbPwlbZv0/0oqouSc9f6TPqb+ma8io2znv4gLR70d6dNGFjgxnybDEWf4OELG X-Received: by 2002:a17:907:205c:: with SMTP id pg28mr19624349ejb.22.1595252387204; Mon, 20 Jul 2020 06:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595252387; cv=none; d=google.com; s=arc-20160816; b=h7lGliCpe+4azQZarE1cBOKMQ9bFQWYkbk+2lbyWXEUtggre1BanY3Pr2ekqb10otk Zgvknc/Q1FzEq70atuZMjCstTXTDrbggHu858HhKvrmQCaG+SC5xetwQsXOTZZoXBcVI OZ9msUCLxcVH/btyCx0mRP1V/0XzHP6iGOJKt8pM2HjUMtKbSdtozJIWhzN2Bx8lzW/c AvKsa6XsCJurOU56yWCkiC3AyFtljhIgwrnonJaTeMHoGMfyROCPZ3oT7bdCifs8Hjcd MMGr3mujXToHMSu/L5WdL/p5CA41tW/iS3LR/gwEcZ/LEn4grKXe11CgfvZWafwHEOg7 Se6g== 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=uomQmJlWIjhkvxxLfQSyf1nH+prda88V/9IK/Q2lWjA=; b=x+tpjUFbnyyFMQ3JQW1FQUfn9bPCiWr3VvE/NZ/7HV2lNS/zENH4vsnTK9kIqsVGLq DIF8N74GGsKBnIed3ItzgWXcWGrslap9r3YMjxRyYTR7UM41CFyUpErizkTtPevBkN+r L2xEtXUNWZd2ILb70WRkXb4rN3RGBBHpQfeEbR+Cj7MWkHi/E8RzOBOzPCJcKv8W83SO OiY14OargjvPRTZyuol7I92NQ+p1NUmxPet6uS4kGgTm8F08yD3vQxfvFJZvf9DiI7kE EKf+hlTMM/res9vQx9ZcOJI5pcQo7FK4yIMNxuha61q0uxcQjKtQhVLKCoHDvv65nus6 ZjMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oDMqReuO; 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 dk6si10249228ejb.129.2020.07.20.06.39.24; Mon, 20 Jul 2020 06:39:47 -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=oDMqReuO; 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 S1728409AbgGTNiZ (ORCPT + 99 others); Mon, 20 Jul 2020 09:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbgGTNiZ (ORCPT ); Mon, 20 Jul 2020 09:38:25 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1602AC061794; Mon, 20 Jul 2020 06:38:25 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id m16so8697082pls.5; Mon, 20 Jul 2020 06:38:25 -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=uomQmJlWIjhkvxxLfQSyf1nH+prda88V/9IK/Q2lWjA=; b=oDMqReuO6Jhic+XYaL95OsSZOx2EFUg2Yf3XDHPc0PvD+RcT1g8EtT3CMrG41D2ZiI Ga3VZsqM/NHDk1FgyIgwyq0ma2vRuUA6IqAjpvl/fTgtPY2DhaNOZjXKRUNUAWyd1fQk /fvqEKSePC7GcXz9CVZzL/SK8fMFKuojHydPsWB24d516D3ofSwwLHjcYZL5DXxJ6Y7f 1EJXkaSyff50tb47qyo2iw6Th0D/dng4oEyqX2h3GHxBFtyrWz6Uuf6G2DN61RzBjZIj Qzbo6VtnMxea+3kMREDRAD6jbqwTIB+hny8MXD2m5D1LxYonLt6Y+j6cIx26cY6CBVVN 4RfQ== 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=uomQmJlWIjhkvxxLfQSyf1nH+prda88V/9IK/Q2lWjA=; b=snk1mUyQrtZ2bXUn9Jo+zgME+ZkvgNH4/WdVQdk9/aa3l4W/uTwuH3mnUHuC8HXpQC HdVYBP4+ysoWWhofWzBtf9uwdCuBhEriznWKr9a0NVo9f7W/2ujDpu2Hb5pjUNANqX9Y c4YbvrVqyImqsXPhHtm/NfG1Xu6Tfye+eKDSwK9FKD72JOu2aChnOFnY0gC015YIMTKq YxhHtWQ0CsMJwXj2MtoOS+FlBJuWYRlwxJic0ekbdFYBgFbUMQc7XkCsU+AURiQkN8T6 rLqs5dv2xmpIdnewFycaPnHZx0x8qd3Khw3ytDZqRzBBODxlAAVxsv+rR9a7QfGrrF6O iA+A== X-Gm-Message-State: AOAM5307Ek4iIlAtpL88bCZ5GxiKadZhJPHMTgcSRvd4XITcK86xiNZD cgWs649e4JFzTHnEKQ5Bz/Q= X-Received: by 2002:a17:902:c181:: with SMTP id d1mr17792705pld.176.1595252304597; Mon, 20 Jul 2020 06:38:24 -0700 (PDT) Received: from varodek.iballbatonwifi.com ([103.105.153.67]) by smtp.gmail.com with ESMTPSA id s6sm17042183pfd.20.2020.07.20.06.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jul 2020 06:38:24 -0700 (PDT) From: Vaibhav Gupta To: Bjorn Helgaas , Bjorn Helgaas , Bjorn Helgaas , Vaibhav Gupta , Adam Radford , "James E.J. Bottomley" , "Martin K. Petersen" , Adaptec OEM Raid Solutions , Hannes Reinecke , Bradley Grove , John Garry , Don Brace , James Smart , Dick Kennedy , Kashyap Desai , Sumit Saxena , Shivasharan S , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , Jack Wang Cc: Vaibhav Gupta , Shuah Khan , linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-scsi@vger.kernel.org, esc.storagedev@microsemi.com, megaraidlinux.pdl@broadcom.com, MPT-FusionLinux.pdl@broadcom.com Subject: [PATCH v2 11/15] scsi: hpsa: use generic power management Date: Mon, 20 Jul 2020 19:04:24 +0530 Message-Id: <20200720133427.454400-12-vaibhavgupta40@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200720133427.454400-1-vaibhavgupta40@gmail.com> References: <20200720133427.454400-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 Drivers using legacy PM have to manage PCI states and device's PM states themselves. They also need to take care of configuration registers. With improved and powerful support of generic PM, PCI Core takes care of above mentioned, device-independent, jobs. Change function parameter in both .suspend() and .resume() to "struct device*" type. The function body remains unchanged as it was empty. Also, bind callbacks with "static const struct dev_pm_ops" variable. Compile-tested only. Signed-off-by: Vaibhav Gupta --- drivers/scsi/hpsa.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 81d0414e2117..70bdd6fe91ee 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -9070,25 +9070,27 @@ static void hpsa_remove_one(struct pci_dev *pdev) hpda_free_ctlr_info(h); /* init_one 1 */ } -static int hpsa_suspend(__attribute__((unused)) struct pci_dev *pdev, - __attribute__((unused)) pm_message_t state) +static int __maybe_unused hpsa_suspend( + __attribute__((unused)) struct device *dev) { return -ENOSYS; } -static int hpsa_resume(__attribute__((unused)) struct pci_dev *pdev) +static int __maybe_unused hpsa_resume + (__attribute__((unused)) struct device *dev) { return -ENOSYS; } +static SIMPLE_DEV_PM_OPS(hpsa_pm_ops, hpsa_suspend, hpsa_resume); + static struct pci_driver hpsa_pci_driver = { .name = HPSA, .probe = hpsa_init_one, .remove = hpsa_remove_one, .id_table = hpsa_pci_device_id, /* id_table */ .shutdown = hpsa_shutdown, - .suspend = hpsa_suspend, - .resume = hpsa_resume, + .driver.pm = &hpsa_pm_ops, }; /* Fill in bucket_map[], given nsgs (the max number of -- 2.27.0