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 CC4A3C4345F for ; Sun, 21 Apr 2024 13:49:12 +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=Mq020QjMa8U/JzjsdWz4MU3Nh18mXC2NHQTwvwbKuxw=; b=e06qXiEjdSwVUE yaTkA65dAgNRYgWtydHJho1roMI4uU3KckxJ7WhseCKTCCJrfcHik7QhpQlLEjpmK9bUEXi0WocNO 8uDGc/UAuDrXAhK0jZ3+Cvciv0KZyfeDqkaO5JSJ4qi0eF97YxHezIN9vuHuBtTyAjL/gprGXOYlB O499/QQuInFZgmnBsaEH7G+4iKFT/HEPosfi8TWvWkNhLEfoULziPQP4ACeZ2CxYjNbtYxPSRZeSU 3DQfBIiJnBGC174jWgwJGuvTjfuiVV0gt3+6Lfbtp3CzJyRymtH2dFOpIucQlG+SJeyMCfKzpmyem egEaz/MNtQhDaJYVMa6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryXZ1-0000000Ab1d-1IXP; Sun, 21 Apr 2024 13:49:03 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ryXYq-0000000AauG-2NJ1 for linux-arm-kernel@lists.infradead.org; Sun, 21 Apr 2024 13:48:55 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5cddfe0cb64so2142721a12.0 for ; Sun, 21 Apr 2024 06:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713707331; x=1714312131; 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=Fr8lwupgPbBOYuK2auIrCKM8IcU0Dw3SnEDCwy+iiEE=; b=FLTDQNrZXa7u7XVesa1/enmZXULNWAPOwH3uabAFWaglVowbl3/pAMa+m/MGPQSPlQ k93CZPWH+WkvXYzb+m683MceS9bGlN4hQv7y4YIqKXK575cCzokOeuC6mY9Ho1pqanIN a40CDBUDK0tfKdxocP1l9mZnaqmNcBXByO54wsHAmevqc4cHcQEbIDq4nyPQRgaBSSSq ffV34vua0yQvwKb9ItbhD1p1ra0rLNUD3pQXoc5t3b22HAj1YNQn281ojHgBAbN0I7cw xlM+SnfuXJaHeZm50pNnI3amQCZ+xL5BE6GnqFhci+7uvnMk8E1es41jGxhkpjgFBbxm sgog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713707331; x=1714312131; 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=Fr8lwupgPbBOYuK2auIrCKM8IcU0Dw3SnEDCwy+iiEE=; b=FIztzImRGsbbjGTTjQqWyyqaMHkXg0Cvof0Bkxum3Aac5PCpaw9jrzlD5kNNUa5OCu 8qdmWCVl9NEzJp+PtBjwxCrxI5mnbk07Dm5ULSmIxgs5gQs51ttlh7MKGe2geqqrtfyU Aan/lG04QKXcIcvbOfqFBq4GBk7aQ+8dY5/+h4rrmfP2o4RZDkvjP6t9C2LMYAW2sZwS 3JeMGLYqw/b5rncoTqsF+pkMCAoWf0CSw8kNLJOMdpYE7sHzUskpmogaCydawMHW5G7L ED6VDH9R+jvbgUlxzBWm1Qt2x6aJqtG0ZC7Bw3Q4Oxa5zd8F9Hd68djpHsnGrDRkVl0S HMWw== X-Forwarded-Encrypted: i=1; AJvYcCX2CNgU+QTQuHg1COgPa3KWzAKnuzr3iuwaZ1k1bVm5l8dOm8XhCrzGvNGVCDsDjfXGecvDMbpMgpqrjcr7q3GIe7T/169HJSGS/8QWJTleJqEJqyg= X-Gm-Message-State: AOJu0YyUepZpXY3bKsQyC8O4/uzW4/1E/HR0o7Q6WSxv2jw/YOKZBRLU zPcyeOTAA86EuG9CRL8KkjTg2XN7XVMMnwmyoHxsPjnaAYOvA7o5 X-Google-Smtp-Source: AGHT+IG2cLYEOHRWAkmdXIu5WTnMlfdKTjYNd65KFwSvWcxeRUQLWRPI7PE9DToAr9E/lnxyGyQ++A== X-Received: by 2002:a05:6a21:99a7:b0:1a7:a86a:1132 with SMTP id ve39-20020a056a2199a700b001a7a86a1132mr8649495pzb.13.1713707331300; Sun, 21 Apr 2024 06:48:51 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 06:48:51 -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 4/5] usb: ohci-exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Sun, 21 Apr 2024 19:17:33 +0530 Message-ID: <20240421134752.2652-5-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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240421_064852_677158_9471F68D X-CRM114-Status: GOOD ( 18.77 ) 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 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/ohci-exynos.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c index 89e6587c089b..3c4d68fd5c33 100644 --- a/drivers/usb/host/ohci-exynos.c +++ b/drivers/usb/host/ohci-exynos.c @@ -213,7 +213,6 @@ static void exynos_ohci_shutdown(struct platform_device *pdev) hcd->driver->shutdown(hcd); } -#ifdef CONFIG_PM static int exynos_ohci_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); @@ -250,19 +249,13 @@ static int exynos_ohci_resume(struct device *dev) return 0; } -#else -#define exynos_ohci_suspend NULL -#define exynos_ohci_resume NULL -#endif static const struct ohci_driver_overrides exynos_overrides __initconst = { .extra_priv_size = sizeof(struct exynos_ohci_hcd), }; -static const struct dev_pm_ops exynos_ohci_pm_ops = { - .suspend = exynos_ohci_suspend, - .resume = exynos_ohci_resume, -}; +static DEFINE_SIMPLE_DEV_PM_OPS(exynos_ohci_pm_ops, + exynos_ohci_suspend, exynos_ohci_resume); #ifdef CONFIG_OF static const struct of_device_id exynos_ohci_match[] = { @@ -278,7 +271,7 @@ static struct platform_driver exynos_ohci_driver = { .shutdown = exynos_ohci_shutdown, .driver = { .name = "exynos-ohci", - .pm = &exynos_ohci_pm_ops, + .pm = pm_ptr(&exynos_ohci_pm_ops), .of_match_table = of_match_ptr(exynos_ohci_match), } }; -- 2.44.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel