From patchwork Mon May 25 18:26:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= X-Patchwork-Id: 218580 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0596C433DF for ; Mon, 25 May 2020 18:26:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CBC820776 for ; Mon, 25 May 2020 18:26:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389542AbgEYS0Z (ORCPT ); Mon, 25 May 2020 14:26:25 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:46901 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389339AbgEYS0U (ORCPT ); Mon, 25 May 2020 14:26:20 -0400 Received: by mail-ed1-f67.google.com with SMTP id f13so15097900edr.13; Mon, 25 May 2020 11:26:17 -0700 (PDT) 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=Vks0hIgL1NwjWUU2xJ9iHtmVGdxZKzV+xbSUPqXCfwA=; b=LEo9fgX+z93XCPxtZSv4U/aKOUbDnDTtBoqZfzlugxY222bvkXsGvTqSoRX1/97aI+ dTMjuLSZv1dtVyedOqLsI8JydUy0tq14TPWw01aN4PfNRcc2tJOOZtJLJtAVjTmSrNTY tAkbQvRgUAwB6yYjkqNhn/aEUleNcyyW2TTRqvBmqPm7Q7iErv4Io9VFKeffDBRMhacA 66iLNA/HExgrkbhbd4v6z+vUkgysEuNzZcpmgjCmbaMq5XgIwWvL5BUjm6t8qOZQ12hs bQgGKDPe0uQRAlDYksyHLFSIfnTcr3VopYpXHOv6ctKqm32S/fgs7kY3WuNmSThQsfG4 hdcQ== X-Gm-Message-State: AOAM532GazrAOglUcU6mnKLV+GUU7POZv8HIPvPlf2sa8yKKomJUSs0i xGWM9g4OdxFaZAiQMqib78E= X-Google-Smtp-Source: ABdhPJxpk17hj32HQlVxuKMrJl9fav78GF8tiYkjJ3OmXfQxm5boXKtzfcrmijAtVvsY76ZoDX8sKQ== X-Received: by 2002:aa7:c3cb:: with SMTP id l11mr15735650edr.364.1590431177072; Mon, 25 May 2020 11:26:17 -0700 (PDT) Received: from workstation.lan ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id n15sm15555707ejs.10.2020.05.25.11.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 11:26:16 -0700 (PDT) From: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= To: Dan Carpenter Cc: "Rafael J. Wysocki" , Len Brown , Kevin Hilman , Ulf Hansson , Pavel Machek , Greg Kroah-Hartman , Johan Hovold , Alex Elder , Bjorn Helgaas , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , Julian Wiedmann , Karsten Graul , Ursula Braun , Jakub Kicinski , Bjorn Andersson , John Stultz , "David S. Miller" , greybus-dev@lists.linaro.org, netdev@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 4/8] scsi: pm: Use the new device_to_pm() helper to access struct dev_pm_ops Date: Mon, 25 May 2020 18:26:04 +0000 Message-Id: <20200525182608.1823735-5-kw@linux.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200525182608.1823735-1-kw@linux.com> References: <20200525182608.1823735-1-kw@linux.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Use the new device_to_pm() helper to access Power Management callbacs (struct dev_pm_ops) for a particular device (struct device_driver). No functional change intended. Signed-off-by: Krzysztof WilczyƄski --- drivers/scsi/scsi_pm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c index 5f0ad8b32e3a..8f40b60d3383 100644 --- a/drivers/scsi/scsi_pm.c +++ b/drivers/scsi/scsi_pm.c @@ -53,7 +53,7 @@ static int do_scsi_restore(struct device *dev, const struct dev_pm_ops *pm) static int scsi_dev_type_suspend(struct device *dev, int (*cb)(struct device *, const struct dev_pm_ops *)) { - const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; + const struct dev_pm_ops *pm = driver_to_pm(dev->driver); int err; /* flush pending in-flight resume operations, suspend is synchronous */ @@ -72,7 +72,7 @@ static int scsi_dev_type_suspend(struct device *dev, static int scsi_dev_type_resume(struct device *dev, int (*cb)(struct device *, const struct dev_pm_ops *)) { - const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; + const struct dev_pm_ops *pm = driver_to_pm(dev->driver); int err = 0; err = cb(dev, pm); @@ -232,7 +232,7 @@ static int scsi_bus_restore(struct device *dev) static int sdev_runtime_suspend(struct device *dev) { - const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; + const struct dev_pm_ops *pm = driver_to_pm(dev->driver); struct scsi_device *sdev = to_scsi_device(dev); int err = 0; @@ -262,7 +262,7 @@ static int scsi_runtime_suspend(struct device *dev) static int sdev_runtime_resume(struct device *dev) { struct scsi_device *sdev = to_scsi_device(dev); - const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; + const struct dev_pm_ops *pm = driver_to_pm(dev->driver); int err = 0; blk_pre_runtime_resume(sdev->request_queue);