From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85720C4345F for ; Fri, 12 Apr 2024 14:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0bm2eisxOS6Xv/1aPjVda/qCok1rXoypewTU5Wag91k=; b=2UpKtWSGiRrf8S M7KZK8kqkma0TsEOH4aeLN+cD308siASUb3EXkLvslsIF7+xBxntFWBG6gul5zIDDi2ZLPPOzqeFQ JQMEpKWDoGNVWFrWPZSWl+k7v05Yd0Qsh4l874GjwPQ9jVIkHwgkfNkgCqMSiy2UocCYkFu/9h8F1 VbcNeDhLXB9vstKR8yAW+0csAtqxopVnz3vu1L07RcLwpTT08Fbv1yzXQPXZ0xFEoqagUrVhWJggH Rms7QmszbheAPJ7ZmsMZXf8Uk++RSu4yBoHMYl+l4PeavHFk5sgkwOZyzRngYROLJu+CC6Uu5ixEw 73M2/g9rMKsuln+M+i2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvHoo-0000000HXpJ-0tkI; Fri, 12 Apr 2024 14:23:54 +0000 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvHol-0000000HXmH-13Kn for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 14:23:52 +0000 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6eaf1005fcaso681572b3a.3 for ; Fri, 12 Apr 2024 07:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712931829; x=1713536629; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U7xaoM/t7sWthomv9Zj/NBnEov5ePJmCQG8giDyuvlc=; b=U+VTFKzfBexlaStSIMCW7BHRFwMhpEMUjmIWVP8sG/b+GoLv7rN2fbe6W2tStqEe8s K8k0IJI9wbyoCp58jckBD5Keu2PWYeiAnWEsCi0y35xqa920KKgpyCCyMTx6OC6sLYbY 9+Gn49qxh+Sp5rVgXdbkqQ48f1rxibL/451EMxWF/fRzxw6GhYAHFA51eY/z4K83Gq44 riTAXE8BIdmdwROX7XpbYA/usJVU9qE81IWhTXgezrbxXX2fIjOsjFv3Zl+IDjZNHEsg DzN4E9D4aGlzBRW882I65xGBTNMsfV/KAV8+15CYJpvuPfdE/8qifHW1KTJ3zRIuBfnP vzWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712931829; x=1713536629; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U7xaoM/t7sWthomv9Zj/NBnEov5ePJmCQG8giDyuvlc=; b=Ro+ybsWqEyoCjb885nOxEUhhQSaasc4vi9CEHsqWUQk5oxiLQK9aThHhTKz/UtJv8x 3CysRycZPVIKJoAh4YAU9yHT+QcHvw85JqsmK/SMEYSBt1+98nAE+tbB2D4tjsZozsKX 7qywrL1wleRrYphcTprVBsFHU5tRQXbBGcBHxQu5YZPvwpmosMnc4twlAIquzanfBYWA 9VPpM5npGuqa2k8FDowBc3piQMFhCFZuHFsqbw/SdfAwAwUKA8BQFdJRp3fnkoZNnzZh w4KTu1W+whQQ6q33MX7c+b0ry0CSWS9zvpzDFOABFqTju0lSS86veCsUvPhfPX4QNmMz +oLg== X-Forwarded-Encrypted: i=1; AJvYcCU8oixzMZVK/EtIEkFau1NmYTfzrVEFBfZQjFI6zAXY03TZZMydjvhfbE6TOFub/ewy/IpaLSOpXgSqtEU6z5jAn/QFYAA4FmvZ7e/Wxgat0fMo2Zc= X-Gm-Message-State: AOJu0Yx99WHjkCWRC+k11Em3UlKsfKAyz+Ksn3zk9T2jydN+HRdeVFMq F0P1FYgWQA9XaoUQ1SpGLo2tw8MjDOdu9DGieolI2IRfHgf5xSF7 X-Google-Smtp-Source: AGHT+IGgvnF6BriGZyRXskbwwm477hSiQyryuqYwynoyzyRo+4cTcjt9St+9+DXj+W6ilmPPRPfQ3w== X-Received: by 2002:a05:6a00:a87:b0:6ed:4a80:133c with SMTP id b7-20020a056a000a8700b006ed4a80133cmr3144178pfl.1.1712931828510; Fri, 12 Apr 2024 07:23:48 -0700 (PDT) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id n43-20020a056a000d6b00b006e5af565b1dsm2946952pfv.201.2024.04.12.07.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:23:48 -0700 (PDT) From: Anand Moon To: Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar Cc: Anand Moon , Christophe JAILLET , Johan Hovold , Thinh Nguyen , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/5] usb: ehci-exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Fri, 12 Apr 2024 19:52:51 +0530 Message-ID: <20240412142317.5191-3-linux.amoon@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240412142317.5191-1-linux.amoon@gmail.com> References: <20240412142317.5191-1-linux.amoon@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240412_072351_313395_6CAD6CDA X-CRM114-Status: GOOD ( 18.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to care about when the functions are actually used. Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM isn't enabled. Signed-off-by: Anand Moon --- v3: fix using new DEFINE_SIMPLE_DEV_PM_OPS PM macro hence change the $subject and the commit message v2: add __maybe_unused to suspend/resume functions in case CONFIG_PM is disabled. dropped RUNTIME_PM_OPS --- drivers/usb/host/ehci-exynos.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c index e2303757bc0f..f40bc2a7a124 100644 --- a/drivers/usb/host/ehci-exynos.c +++ b/drivers/usb/host/ehci-exynos.c @@ -237,7 +237,6 @@ static void exynos_ehci_remove(struct platform_device *pdev) usb_put_hcd(hcd); } -#ifdef CONFIG_PM static int exynos_ehci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); @@ -280,15 +279,9 @@ static int exynos_ehci_resume(struct device *dev) ehci_resume(hcd, false); return 0; } -#else -#define exynos_ehci_suspend NULL -#define exynos_ehci_resume NULL -#endif -static const struct dev_pm_ops exynos_ehci_pm_ops = { - .suspend = exynos_ehci_suspend, - .resume = exynos_ehci_resume, -}; +static DEFINE_SIMPLE_DEV_PM_OPS(exynos_ehci_pm_ops, + exynos_ehci_suspend, exynos_ehci_resume); #ifdef CONFIG_OF static const struct of_device_id exynos_ehci_match[] = { @@ -304,7 +297,7 @@ static struct platform_driver exynos_ehci_driver = { .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "exynos-ehci", - .pm = &exynos_ehci_pm_ops, + .pm = pm_ptr(&exynos_ehci_pm_ops), .of_match_table = of_match_ptr(exynos_ehci_match), } }; -- 2.44.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel