From patchwork Fri Apr 12 14:22:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 13627850 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 572A1C4345F for ; Fri, 12 Apr 2024 14:24:23 +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=ugGj8FCFlynuZQ9zQ8x+Zr+hhjAlODwPD/e0ug3Nwl4=; b=0P2BhJL1xXHDWR d8ByFzURBFUDQFfaOBvRk5TVBM2OIAUD3aS7dRkNtGhNYPZRmBKMkZBRE8P2HjFKc1OxPaw88ozuv KOpv7LBn+ldCT+/nwkl/e6R2WyPAsjSY3AEzhI8cvh/hAvhOFWDhZrSkMZU6lvvveMJdQMLcRoRLb A5ps/qtg6Pc/4Zu+LYwFPL1E8caCyKfRDDAX/3WtkwAxpkc+pEaN2kVj488mVyVcurpZIz1s5XHJB EILKUuV2nqC92exq0B2aqTRL2kluUKwWNAHLlNtmO4JF0i1zc7tvvNn3ndM8vWsgzuraQij29ia0d AG0vuBCkPH74O37Cdp2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvHp3-0000000HXyt-2GJr; Fri, 12 Apr 2024 14:24:10 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rvHp0-0000000HXvg-0KtR for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2024 14:24:07 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6ecf406551aso781544b3a.2 for ; Fri, 12 Apr 2024 07:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712931844; x=1713536644; 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=DAWpmgXV6PrUtIYpHal4V+0TG6cIPqQRmUscp00ed0M=; b=mi+VW3eIixnggm1P7X/+qvaZoPGq7Om+RKwzw+LIjisdgYgj+r4P0YsW9QoGkO7nb8 b3wF+dZnxQJvjAC7khPu4of+oYlGISx1Gvy9tLyS/WLXE3fG/Y0nwXinH0vdZgtB1rTX U+RQgIkMEN6dgJhVoux0QFZSCuNwdxtME+3kxZTtoTEwnDvPOPdL+G9iND5DaZ8rgbcP f9G9B/OswckTS2YLzYSuelr7evIqHPf1cpQmJU21iDWmzCUsOigKYpuyZfUh+dO5K+bU 2rpV2rqqbeHARA39hFMktaPWk1ZQ092ganb9aM492tWUZJ+MWr7LmhNcMkDt4zza72C5 eQNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712931844; x=1713536644; 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=DAWpmgXV6PrUtIYpHal4V+0TG6cIPqQRmUscp00ed0M=; b=Ua2I5mCgg6cd0Wi7NmzDj4YT/ovld2Q/9rmq2Dhwzd1Dc/xoyl9iPQBHurZClalce/ Jynmzy+VOz8a4QYGXCPatzxjqac1eRCoocN4RXrjk0muBaE8a4Np5+BCbSUlF8+KDWSd 3aia0S98rkO2+YpJrf2/l++5r0SjX2DDittwbcFj++2J/ZvZi6yYt8mr9xjtjyVfsB9t zA3Y+ha/+Grti0K0XxcRosRWP0opUmkdchvpgoPGN/4PvztemtsRPrURgyWVTOIyNm+t HC4jgkVJHd9YGohWhIyqDo1rLoRbc1b63JJzBZtep15pkIVLSdGg2YeU1pjFZdlLOQZC o00g== X-Forwarded-Encrypted: i=1; AJvYcCUDJcjhUfOYsEQSxKYGynfl0wo6LVThfzgy+4o3bvOFC1Tm4Hab04F7LQ9WDxm2Q4n/+rKPpOh0vve7cXJsEFlJc/QHXMoP5XFfo2c1gCObL2DQp7M= X-Gm-Message-State: AOJu0YyuJ+Sc4eEw6Tf2hj8SwT58H71vMtMxcpvpEwq0q21d/EJfgdYz KRidaWM+SgyOwX/GmBwrAdkyl/evvtMVaQx/CBaSBljQUTD6iCbV X-Google-Smtp-Source: AGHT+IEpGPBZdmTxxL9lDAtC+tf3WS6lK3QOjNLU9P/kh8HtQfqldD/Ks3PSn5Y+HC7kfzAkGlppsQ== X-Received: by 2002:a05:6a20:5659:b0:1a7:34c5:d141 with SMTP id is25-20020a056a20565900b001a734c5d141mr2909862pzc.24.1712931843931; Fri, 12 Apr 2024 07:24:03 -0700 (PDT) Received: from localhost.localdomain ([113.30.217.222]) by smtp.gmail.com with ESMTPSA id n43-20020a056a000d6b00b006e5af565b1dsm2946952pfv.201.2024.04.12.07.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:24:03 -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 4/5] usb: ohci-exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Fri, 12 Apr 2024 19:52:53 +0530 Message-ID: <20240412142317.5191-5-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_072406_198533_7410CC38 X-CRM114-Status: GOOD ( 18.59 ) 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: , 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: new file --- 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), } };