Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp1716475lqt; Sun, 21 Apr 2024 06:49:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXa3LlpPx0lJSma7RJPOhD+TPv8IMFYFCUOtw2A3MTDCUpqttgTIKimfoqkZABP3uN0HD3oXo32etLgf3Y26z66L3d7eFppVcd9tZ3BSQ== X-Google-Smtp-Source: AGHT+IF+YNXyssQQDHR86gtaHW3kUY7uRWuHf71UvLcmC2BO0VCAWfu+B0V3rCaz7imnT0G/eTaT X-Received: by 2002:ad4:4e23:0:b0:6a0:8132:14c9 with SMTP id dm3-20020ad44e23000000b006a0813214c9mr1610qvb.19.1713707342578; Sun, 21 Apr 2024 06:49:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713707342; cv=pass; d=google.com; s=arc-20160816; b=TxW1X4UbzusPE2USi67Qoek/Nz4DUEV1f5XmD2EMxsZXxVlxbLFn4q5jEA/LKMtiP9 caXBKxahMyqvVhbpteV0XIk4Jjf0RunmhypVKRtJIZallPfSTFO6jRD3rPJcoTRQlBTy N6VHQRdGcI/9fl1lk9Z5huFwJl08jaOULCnU1kzS4ipjMuUQL6qHvTmLLw4hh/hKgl/+ YWlifdmaYw4YdlsuqHUQCFoAi1ostvyPNKLNh5cJuUjrtpTJznhdTR0UZbp8ynPqwWEg OMuiBihzBi0lO1WGTuO7WThKKLg8JoS74kqjWyQTRODuRCy2qsg5198njFtVQsXvh5Ct T4Hw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ciAsjHwxYvDFWKrK0+bRI8F1DZJnqhJJG3f0Ywfv28Q=; fh=9U4SRHMRqbQUE3YmAx/7ZfkYL2McB5jj5C9gCYEO3v4=; b=rSqcP7FyQgbTTb7vqesWsqd974GrMO2fwC6Jm5z0PEhrA1CYQwZPAkGLkZZYtFV/83 jGYTgKnxRP13PVVeZ+0o+O/VsGqIbS8RFDtL8l65dBo2pYWujzPKz58wFbQCHbbYfKsN q3zqv22BDsM9OQLvz9vxM464fNv8kRDGz3ru9YoDQV4nkyfi3i56VeE4zy5OHXB41it5 FRGkwV5F2ahLM/tDJstboAUnMzSGD5Knd/Y7np96DyrMT3aE8FGj3H6atj0zpeZJu+Pj lCEKuxU0Wc3DdBeZotqa2IH9PFEml7yjw1jWbZ5tnvoIHIMOOOgOnej3FR+wei4Di+rT eRxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TvfU1Scv; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-152499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fv2-20020a056214240200b0069b60b6cf90si8862577qvb.529.2024.04.21.06.49.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 06:49:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TvfU1Scv; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-152499-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152499-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4ECC21C20FFF for ; Sun, 21 Apr 2024 13:49:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D4A317C96; Sun, 21 Apr 2024 13:48:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TvfU1Scv" Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96E9E18E3F; Sun, 21 Apr 2024 13:48:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713707320; cv=none; b=IyAiGY/OMFqTpDqU/xvz/VFlxUGvaFxfy4yuzd8TJN1ssgOv4j0T+aJ++eNO5ZqVfSvNPbcUdHKTR4syMxI9biZFnKcPqpNq3RVXxOzGWyUIHZ50XJaQS9OkN2NEPRVO40Q/0zcaDO17Bm7qMDsZ2JuFJhKXlo7eH0jAmlswK20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713707320; c=relaxed/simple; bh=A4OPctYYUH7PuBa9PxvK7F68AY0rYnDxN+Q+bX9qxmg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YPka2W1cLJ84edcTtImGHLg5ljqQnpOTzVTZSSmKxouLeEgWq9gJNqsDPtlZ1XHU1dw6CxQsbYO5XFA9fiFwmYRZbhSTLyRSpsIx749ezZYo7LrAZ7pcG1ZhEJcyyXpJimYWV5SVWnAdNqJzGUbe/JSIQrURVuz4JN6hnEsH+pc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TvfU1Scv; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6ed9fc77bbfso2753554b3a.1; Sun, 21 Apr 2024 06:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713707318; x=1714312118; darn=vger.kernel.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=ciAsjHwxYvDFWKrK0+bRI8F1DZJnqhJJG3f0Ywfv28Q=; b=TvfU1Scv5GFSW+3Y5S6668UXl6IHEQr6kwaUrIYdZgQxK/uP9rO6PI4Gs5bqYds34i iBPEit7t29x/LuHUhksnokz36i9x4Wizzea70aXGKMry6fhrOli5QVCbwB2j+dnRB1J3 L0V1N+VZNaDTGR69Wz+4ey+ggefhCMoxdPwEfhsze5AHRZLBARK/rb3bcL30TEKQFjX/ lwDqJiAJ3u34XJS+AKiJjzHFvACFHeroe0O3A4Zn624iHSOR7hPrBfpKSL83rmpIqzPD HFf7jneVSsJyukRFO1PzqgCzgRSpeVV2OqGzVIiXfuuSUeukUaI/nr2ckPGhemJr5qqA fqLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713707318; x=1714312118; 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=ciAsjHwxYvDFWKrK0+bRI8F1DZJnqhJJG3f0Ywfv28Q=; b=AE3vrJyQ7PGICkof0WsRx9Af8N0PDbjG+rb6arXG7k3PtWOVEKUgvztVllwcD+dQ7P 4duduw5bdBT6dhB8xqQEFbCxeC1eFD0Z9vU71Wcph4AurI2WLCNs502DBKFmaRqtBgaW VN79oa/qBDvcMrUr3mRyrODwmaqV0g05HM0YseoK4TXoSMevohneV9QCwqfdrHRgHtp7 7GulcACXfXyNfBpr1+EeoD1ko47Fx7YgJFUUnc7mvpjYib0f2DIcN3iWBcl1EgFN6dK8 t+DHUOs9M5cN3apAZh28JG3Jxx2ustFlmweu3AxyLxCe7BjaV2g15NYm0NT+6Ij4OO6c 7dVA== X-Forwarded-Encrypted: i=1; AJvYcCVdjqBvb6NAfomk87oCX8P3Ebq1Bj6ijukTNt95oslmtBbl9zHUHGYp3GnDR9vHWN5/WsdrtBK4cAqhqFJ8WhMMsK6PouBNMgnn5cPO5W+u70oKe/uk96Xsfrv6nHZmEd6xhKbqtGNDVXFhPjkACmROFHbzqGCFn/nBJPNg1fifwuClelF7eYeud2w= X-Gm-Message-State: AOJu0YxR/OQzyUqtxZ+j1OxvCaXQoGma0xTpFQpqEM9XkTydTUgVxbNF 26jDsjQISXB6NQpOqzSayBT4+iNBZn2WhMTDPsFWurgeH04XYerY X-Received: by 2002:a05:6a00:1390:b0:6ec:f9d3:d0c6 with SMTP id t16-20020a056a00139000b006ecf9d3d0c6mr10380392pfg.16.1713707317822; Sun, 21 Apr 2024 06:48:37 -0700 (PDT) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id o13-20020a056a001b4d00b006e6c733bde9sm6175043pfv.155.2024.04.21.06.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 06:48:37 -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 v4 2/5] usb: ehci-exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Sun, 21 Apr 2024 19:17:31 +0530 Message-ID: <20240421134752.2652-3-linux.amoon@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240421134752.2652-1-linux.amoon@gmail.com> References: <20240421134752.2652-1-linux.amoon@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use DEFINE_SIMPLE_DEV_PM_OPS macro to progressively switch from a code model where PM callbacks are all protected behind CONFIG_PM guards, to a code model where the PM callbacks are always seen by the compiler, but discarded if not used. Reviewed-by: Alan Stern Signed-off-by: Anand Moon --- v4: rephrase commit message add reviewed by RB Alan Stern 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. --- 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