Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp184308lql; Fri, 12 Apr 2024 07:28:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDRFdgwxMFR0hZ4yHn21XNtIyIr8KVOrvij1hIu0rbOdMO8EA4wmp0WNhklXrbWMlGjjz8Yo88pdX8gPfndK5wmWMr5Bs//8jr5MjJ6w== X-Google-Smtp-Source: AGHT+IEtV+wcB2BNxzLXlCXhuMFiWng2aRfx/2Cz0SqGWtukl+YgziyYFH8hL8UkgzmM43den/jL X-Received: by 2002:a05:620a:40d5:b0:78d:777e:3351 with SMTP id g21-20020a05620a40d500b0078d777e3351mr3402374qko.33.1712932099103; Fri, 12 Apr 2024 07:28:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712932099; cv=pass; d=google.com; s=arc-20160816; b=MQw42Oh7G2Jl84Xhi6m9HcYg5gwiFRy/+yhUwM2D8I3XtFUlqTOVr6/mzd1o17TkMn 1r8hem1vALyU5EiaIh258OoKgOJN1kfJTvbbWCqnrKdhocWz3cHDTMUTNewCujiC5jmk ixvMRTuYkbWuyayTGDv7uY5mxRgZ3rpgCvCUPkN6xOEFgUU5V93BNcTQYMjZBkLZxn5b dx5jYwcTQZlUo8Z5M06pB6Ir85sSd4+a3lRLCONmasDnXI0BS8TDgH5Ypm4TPeWJQR/f 0wkZMRQG74SWHaYkPgbX5rh93kTREgquBa8d3m1Y8mITKYKf+mr1yPc/7mniCoaBlFa3 5sMw== 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=DAWpmgXV6PrUtIYpHal4V+0TG6cIPqQRmUscp00ed0M=; fh=SYwvbFQ+Ik7/SeB5J9sNJhWYqc7S5BQ2FtAv3BwkM+w=; b=HezPa/kC6kciyS5XIgAGtUKz1+6798SEciHeQl4Je0JN4N3m3i15Slo1RZ0ZbWbII5 d2r0XKpATFyg36jeFjJ+QLgAfWxGHTVcz2/xh+Z6F9DvekV59r4JQ8ep0TUVVM3LTRJr blaCyKWzlWFixsfnxmOb4bXiFjzm5rXIKNEKXdtSRqlMNaPApqFb7/OYYdydB3atzIJD O3sd+BlFNMPpGLux34/n6ykG7WAP2O/l1ejp1u0weEK1UggIuzKGV3cf5307P6iGhKGa GHcLL2HA8wPQ1O41+BsyIYh13X+I7W/eCJM9VMrppNSu0jG2W0RiyII7WL8lfx0FDw06 7nag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=G7MJAlsu; 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-142833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142833-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. [147.75.199.223]) by mx.google.com with ESMTPS id r2-20020a05620a298200b0078d496c674asi4067433qkp.331.2024.04.12.07.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 07:28:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=G7MJAlsu; 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-142833-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142833-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 8B4911C24603 for ; Fri, 12 Apr 2024 14:27:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6E46132C39; Fri, 12 Apr 2024 14:24:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G7MJAlsu" Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 ABBC61327E8; Fri, 12 Apr 2024 14:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931846; cv=none; b=ZxQM0fe7sL/mN07AvEKdQ081GPS10QLR4QQF+jC1ok+Kg0I0eyTYVfdOKlqS2vq+1b/TU7x5RSmH2GNf5EErffb8luqcELTcWd8p9Rf/hj+ZdkjSHFRp9QBDRgZj2c/4SYoe+TvEDxxzZiNh8EfFkqVS5JQ8XYxnZI29CuuWl4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712931846; c=relaxed/simple; bh=pvXRn+SGEozybqS3lhGoTzYl9NGJHGRBmtZjeThvLDU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g6zn6mcwsBOqeLDbDZL7R+fh6zaPAWuUafZ51jsXYeLZGCHU+RKlZ/PrV6ghuJyij+161/iVQgOjGC+4vfcRM/+VP+T/mCQN4DXierj7BM77soQJaKyhC0C/O2NZyPObOBDncKqXM1NLRV7VbCCv2dOhvajFve2Vo0ffFy4ZviQ= 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=G7MJAlsu; arc=none smtp.client-ip=209.85.210.170 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-f170.google.com with SMTP id d2e1a72fcca58-6ecf3943040so856158b3a.0; 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=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=DAWpmgXV6PrUtIYpHal4V+0TG6cIPqQRmUscp00ed0M=; b=G7MJAlsuVLIRuhGaGesqPK5VxkY1R7sL2AXNUzLDY2ejAIITu0WAmVQrJEsM1uj4xa IAEcIpXJGkSOR/MNMB0F/elWR6YBS6yhz+uUBoC/OuFs6G3ETxTrDtIquCF57JYp1cGp rUrpl0SJnECb95p82ALPIATSyD34Jw1yE0CHp+bRdHFaDio1Ue1GHEUGIm9sWk1pwdFE rWdHVPx9YGg26/QMAKPIWqj21mkO/60uVrdVkAWq9T6mel7LU8SaOFYilj13ozn4LRv0 nKBzBSjrlASvKVjMHNPUQ/Ozm2fsUdCaBYG8nxaKSbqAfcap+zxLN2eL2fwOEZfYTKQj BHeQ== 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=YgV3C96Ed2DdEfyrLjPUmw5RYOyjVYiehCEPVKgFHHXPdX5czvdQgTcmsNNC1iK64M cLk3gdIn6fpD4ZP8GKVO9Z/TPpoXQiPFwQkDEckakTEq+r7LrLlahV0x92sGhwGQFli5 bPQcFNAxui/tnQ2+CJaVKjMMN2GkUab06b+BISTOw0uXhKTLvqd9Qkj7DM+6JId8cXH/ +Thivjax/WzjhiMdFwBfua6Z2Jiy/QYgi7NlROxGXTP68oLgnM6pYyMmDz01jtVOb6y9 G7v/QTZfYtfZc7vV34PlbRCi10pEKCbT3Ol1MVdddwHguMVbSjJCnrcm0cUP5pFtXywJ Digw== X-Forwarded-Encrypted: i=1; AJvYcCU8DguMeetFdNIGudSAH7WfX1AY3P8dHaCHSRWCjHw7oWcMttGLrwJvBM95LBcmBNcryPVzL0ZASUujMebvw7TiypOCFWIVikWpZihej5yxU9PEqeDiC3cq05kXuMYLGoWyytnvna/EcnXGBWzzNjkvzAYeXbyXlfvSnS//sKrB3iLufQHfp/it6CQ= X-Gm-Message-State: AOJu0YzDtEfK6nfwUj3puSCd+mpC0hHCLZ2cuU8I3JhlPDRIdd7askcA 8Odj6zg6/nUCAPJZDFdUUSWpiP2PDYMkFy8bIZEacOX5dAxPXpJq 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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), } }; -- 2.44.0