From nobody Fri Sep 25 16:02:04 2026 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (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 4C57E4BB266 for ; Thu, 10 Sep 2026 14:51:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789051875; cv=none; b=N9l8y7lA0M5Vy+BKJLWk8NggQENJ1IguN09kWgsNvR2b1r1Zw8ZGtSlurnx/3tvj3pXYuHf6VQppjsfHeHJmwUt2SkLzXuen7DVUGwTzr2HWVY00Uv3QPRPPrX0udRJLzx+AMj6X/xl3p6PNv7g9h9Vr2EAxdK71k6Y+sLVbw9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789051875; c=relaxed/simple; bh=Wsosi7+zRF+Zd/bIRFV/BRB65RlCubyCxSqesFNv+8A=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=aC9NFhfsaBo8kySav9eqjnV+2101ujZ0xlYW46Jp83SHZrQ4xT6toWOSK/L7jgSyGw5dswk9NQt1G/JKuNU7PGB11I+Uq596qXbjRCVrvkgtV2sQpQNW+9VYUgrYkQmII/EA+f8Cq/Fan4Ij9ZGza34hjPC9XRDcE7jresnMhqs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ericchancf.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=BJ6dyejc; arc=none smtp.client-ip=209.85.214.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ericchancf.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="BJ6dyejc" Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2db0a41434bso131260115ad.0 for ; Thu, 10 Sep 2026 07:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1789051872; x=1789656672; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VFhy93n6Rb/y4cA3aaIcOvTxc0gTIiwSK8DV0XBamcA=; b=BJ6dyejcZBllc1AT56GZeuTZA6pC11EeudKWQ1ARTvrUuHV6AjAuh1EYjk8/1mb7+L 3yQbPGxekyQrXmQn26/GpVgLglDemryOIn/IECN2h42s+BV9G+e3VXNz2OFCRBztTdrX 0OqFvX85CN6g3QCzc82OGcm7aYAUGdT3MRjKghPTFamo7JG1E86t4LcnBXc7wVB055Ap bx34wbnIhr1iH2rGQGuPjB4/5eDcAgTfQzfp2e07dfTNDDhVFCPeWsMP4mJjiCsEXrjl c2tx+MFKHvPQhdJk25wzFweyxG5GjIhu7If/8tqM4j69O+8UqDA4NvKMomKGYyukXKM0 onMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789051872; x=1789656672; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=VFhy93n6Rb/y4cA3aaIcOvTxc0gTIiwSK8DV0XBamcA=; b=cNDaUZst5hWbaGbeT8PsYvvw3u/nVNezfZT+OJpslLeOzPGLmOPDraIrQrHAyPdZvm a+4jRCgw4g3zyevndHAwh0rKgOXmMYknLXzqSxGS86cdG5AxA0jL64/XzuMDX6G/sXg6 eKadKmBGBKRAeocgMKv3lT6G61UFUF7oG+oXsq+DY595K45Vh/QDgztIPL49/odc/v8C KxQLXNQPAArtO2Om6RQ5M/nTiT71AtMZC6F8ItKRoERb30OXoi7Vs3TI5aE9k4J1B8fu rfsyg/vVaiHKUaDetICG4D1+Xi434TSyKgJYqQTSMb7Yjl4fEN87dVu50ZEY5wtnoOy0 p2gw== X-Forwarded-Encrypted: i=1; AKwUvBwdobcjagCr3W5wiEjdRJNyGeKv4ZC92NDZhcAT7zUsV9kcag4BFXKgKZu1tsUlnqf0ovFUB3nMom+75Ws=@vger.kernel.org X-Gm-Message-State: AFuF++ls+1thD+wvNoereuXnXVuQM4y0+NxjTbMdEXx84NZ36zh9UQTw X9ww9MznEyZi8F4cRdw9P8yqyszFlFKr0RgnR84K1AbYPdhlhEoKt+z8MHkhSXrylz+6tLBuJQn xupmRCh4I3L/biSuwuXUatA== X-Received: from pllx5.prod.google.com ([2002:a17:902:7c05:b0:2dd:1e7c:bcec]) (user=ericchancf job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:46cd:b0:2db:39da:90f2 with SMTP id d9443c01a7336-2dd07809f49mr112539965ad.8.1789051872100; Thu, 10 Sep 2026 07:51:12 -0700 (PDT) Date: Thu, 10 Sep 2026 14:51:06 +0000 In-Reply-To: <20260910145107.3640991-1-ericchancf@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260910145107.3640991-1-ericchancf@google.com> X-Mailer: git-send-email 2.55.0.1003.g10538fe699-goog Message-ID: <20260910145107.3640991-2-ericchancf@google.com> Subject: [PATCH 1/2] coresight: Add missing dev_pm_ops to AMBA drivers From: Eric Chan To: Suzuki K Poulose , Alexander Shishkin Cc: Mike Leach , James Clark , Leo Yan , Anshuman Khandual , Sudeep Holla , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Eric Chan Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When ACPI or MMIO platform driver support was added for TMC, CATU, and ETM4x, runtime PM support was hooked up for their platform drivers via respective dev_pm_ops, but setting the .pm pointer in their AMBA drivers was missed. As a result, when these devices are probed via the AMBA bus, runtime power management does not invoke their runtime suspend/resume callbacks, leaving device clocks (such as atclk and pclk) unmanaged during runtime PM transitions. Move the AMBA drivers next to their platform drivers and hook up dev_pm_ops to their drv.pm pointers across TMC, CATU, and ETM4x. Fixes: 70750e257aab ("coresight: tmc: Move ACPI support from AMBA driver to= platform driver") Fixes: 23567323857d ("coresight: catu: Move ACPI support from AMBA driver t= o platform driver") Fixes: 73d779a03a76 ("coresight: etm4x: Change etm4_platform_driver driver = for MMIO devices") Cc: stable@vger.kernel.org Signed-off-by: Eric Chan --- drivers/hwtracing/coresight/coresight-catu.c | 21 +++++++++-------- .../coresight/coresight-etm4x-core.c | 21 +++++++++-------- .../hwtracing/coresight/coresight-tmc-core.c | 23 ++++++++++--------- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtraci= ng/coresight/coresight-catu.c index ad8dafea7d2f..d9a12d5e48fa 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -612,16 +612,6 @@ static const struct amba_id catu_ids[] =3D { =20 MODULE_DEVICE_TABLE(amba, catu_ids); =20 -static struct amba_driver catu_driver =3D { - .drv =3D { - .name =3D "coresight-catu", - .suppress_bind_attrs =3D true, - }, - .probe =3D catu_probe, - .remove =3D catu_remove, - .id_table =3D catu_ids, -}; - static int catu_platform_probe(struct platform_device *pdev) { struct resource *res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -702,6 +692,17 @@ static struct platform_driver catu_platform_driver =3D= { }, }; =20 +static struct amba_driver catu_driver =3D { + .drv =3D { + .name =3D "coresight-catu", + .pm =3D &catu_dev_pm_ops, + .suppress_bind_attrs =3D true, + }, + .probe =3D catu_probe, + .remove =3D catu_remove, + .id_table =3D catu_ids, +}; + static int __init catu_init(void) { int ret; diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/h= wtracing/coresight/coresight-etm4x-core.c index 2247ad55d444..ace5e077a10c 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -2460,16 +2460,6 @@ static const struct amba_id etm4_ids[] =3D { =20 MODULE_DEVICE_TABLE(amba, etm4_ids); =20 -static struct amba_driver etm4x_amba_driver =3D { - .drv =3D { - .name =3D "coresight-etm4x", - .suppress_bind_attrs =3D true, - }, - .probe =3D etm4_probe_amba, - .remove =3D etm4_remove_amba, - .id_table =3D etm4_ids, -}; - #ifdef CONFIG_PM static int etm4_runtime_suspend(struct device *dev) { @@ -2528,6 +2518,17 @@ static struct platform_driver etm4_platform_driver = =3D { }, }; =20 +static struct amba_driver etm4x_amba_driver =3D { + .drv =3D { + .name =3D "coresight-etm4x", + .pm =3D &etm4_dev_pm_ops, + .suppress_bind_attrs =3D true, + }, + .probe =3D etm4_probe_amba, + .remove =3D etm4_remove_amba, + .id_table =3D etm4_ids, +}; + static int __init etm4x_init(void) { int ret; diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwt= racing/coresight/coresight-tmc-core.c index bc5a133ada3e..ece2e8c9be26 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -953,17 +953,6 @@ static const struct amba_id tmc_ids[] =3D { =20 MODULE_DEVICE_TABLE(amba, tmc_ids); =20 -static struct amba_driver tmc_driver =3D { - .drv =3D { - .name =3D "coresight-tmc", - .suppress_bind_attrs =3D true, - }, - .probe =3D tmc_probe, - .shutdown =3D tmc_shutdown, - .remove =3D tmc_remove, - .id_table =3D tmc_ids, -}; - static int tmc_platform_probe(struct platform_device *pdev) { struct resource *res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1044,6 +1033,18 @@ static struct platform_driver tmc_platform_driver = =3D { }, }; =20 +static struct amba_driver tmc_driver =3D { + .drv =3D { + .name =3D "coresight-tmc", + .pm =3D &tmc_dev_pm_ops, + .suppress_bind_attrs =3D true, + }, + .probe =3D tmc_probe, + .shutdown =3D tmc_shutdown, + .remove =3D tmc_remove, + .id_table =3D tmc_ids, +}; + static int __init tmc_init(void) { return coresight_init_driver("tmc", &tmc_driver, &tmc_platform_driver); --=20 2.55.0.1003.g10538fe699-goog From nobody Fri Sep 25 16:02:04 2026 Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) (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 EBBA14B5CA2 for ; Thu, 10 Sep 2026 14:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789051877; cv=none; b=EqG2peA4w93icY4jpmVNUruvm8/v18Nta6WA0N6LBna7E0XzniHHbxbGwdbk91RtY6WhFyJ76Movnz6kifsKaqbjgtImjJQkssHmSVVdmA/A38WRPCIFb5GCy3nwPXUiVeguCt/Sojd4ATE75sR3Ju8N5mQR6Dqv3SbiQ9t0cz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789051877; c=relaxed/simple; bh=MhddNrmrZwmeTvC1OhCTLgh7ZbHYoDZbylqC1X1rPIs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ZCqGaohTUsmhGh5gfINmB2s67udbPB+TKfeFncUny8f20MSHKDU9ZHWnMboyOvjDElAYOFz/89kP4XbiXIiVQD1C80gPKnpqc9xBZ7xZhbQ3gpea1YBnuUazqIxq0oF54CrK4HoFg8pgYBIplMGhIAt6ENx7Sea/5OTk9ogBfAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--ericchancf.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=MoQ+DEU4; arc=none smtp.client-ip=209.85.214.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--ericchancf.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="MoQ+DEU4" Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2cfc52ddc55so102785195ad.3 for ; Thu, 10 Sep 2026 07:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1789051874; x=1789656674; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iPR+8RLWsIHJc9acjgG1g7ANa3O2x38Ojpgbt/bpoPQ=; b=MoQ+DEU4FAs/1fNcUWcgR3MLmbR+34wnAYv8cAcWL285060C1YuLyKv1byMxoDnuvh LYHHNjMtVZ8cXrZrMQFS1ztDVON+9VeCIeMZABivZGQiaY/gCzzNBJG2B1lrjNUoB7KN dyZpLPgGD/p9tRIZMjct9l1+rKghMaWLVMLNEArkV1MMm18hry5FGFcUy4ToFqTS7h2D CHcXUg8A+Reuq8JMqxhqIMam0pCEZhpawVf1xzmsdgHgTG73ei27+CohTN1nZmwxqvkJ UdZTMSPUQHGJ1sNeXJSCrIZnsDb8cEh399Q7jP82RMGuTN2OkJ8hk5NffS+tpGdXZWZv BpQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789051874; x=1789656674; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iPR+8RLWsIHJc9acjgG1g7ANa3O2x38Ojpgbt/bpoPQ=; b=j+57gVMMz3ZOIVkYTa8IqfgeSXsJaZPwx4DhU1LCRCULIPid8zt1V06aFYGtrRijBt 6p3x1L7ac7j9qbmX60rpzk9F36Fp5Jhrbna+KpFpc4g0tcyMJDO85Hnar6rsDvD9iQyW vYpLyoxuKKxxYTi3J79AHGE9Tka8YMInbhzV0laCEDJUoJB7LIFzJqQhyUCv2G7Qgdnv xVue95kKdRfNBb4pQ3wzhz+i986FdvgpRxDsGuLY23lddmGW5he/eSBY832k19VvkVLp lOGCn+rfZK6pYcw6W9p8N7/jaCS6gn4SqqTmRB6WANh1xBVekIP011tfXf4yKH8mf/pY 3emw== X-Forwarded-Encrypted: i=1; AKwUvBzrG57rz5zVDak5hA/4Z1QlY0cjjjGxtM0+5a5ZvU4sJeesBD2hfcoyFg2TJCDJz7kj5320PaiHvTSmiQg=@vger.kernel.org X-Gm-Message-State: AFuF++mk5EMsrsOkP5SdG0DGCFSuTHyliSrzN7c4gFocw3Lf8hjku6Z5 J4E+o7OpPx9QTNlHqkengwnCy409QCDXAANcSJgaQuS8XDqN4SozfHhBM0P+k1lMpVFSadndALn DN6GEeRtxia45hpv3IU9l0Q== X-Received: from plw20.prod.google.com ([2002:a17:903:45d4:b0:2ca:f1f8:ea00]) (user=ericchancf job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3804:b0:2cf:9347:f445 with SMTP id d9443c01a7336-2db126d8a54mr668494555ad.10.1789051873909; Thu, 10 Sep 2026 07:51:13 -0700 (PDT) Date: Thu, 10 Sep 2026 14:51:07 +0000 In-Reply-To: <20260910145107.3640991-1-ericchancf@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260910145107.3640991-1-ericchancf@google.com> X-Mailer: git-send-email 2.55.0.1003.g10538fe699-goog Message-ID: <20260910145107.3640991-3-ericchancf@google.com> Subject: [PATCH 2/2] coresight: Switch to DEFINE_RUNTIME_DEV_PM_OPS() From: Eric Chan To: Suzuki K Poulose , Alexander Shishkin Cc: Mike Leach , James Clark , Leo Yan , Anshuman Khandual , Sudeep Holla , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Eric Chan Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" According to Documentation/power/runtime_pm.rst and include/linux/pm_runtime.h, modern drivers are encouraged to use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() to simplify runtime PM ops definitions and eliminate unnecessary #ifdef CONFIG_PM guards. Convert the CoreSight TMC, CATU, and ETM4x drivers to use DEFINE_RUNTIME_DEV_PM_OPS() and replace direct references to their dev_pm_ops structures with pm_ptr(). This removes the #ifdef CONFIG_PM blocks around the runtime suspend and resume callbacks, allowing the compiler to always validate them regardless of CONFIG_PM. Signed-off-by: Eric Chan --- drivers/hwtracing/coresight/coresight-catu.c | 12 +++++------- drivers/hwtracing/coresight/coresight-etm4x-core.c | 11 ++++------- drivers/hwtracing/coresight/coresight-tmc-core.c | 12 ++++-------- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtraci= ng/coresight/coresight-catu.c index d9a12d5e48fa..e3bbfb707f73 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -14,6 +14,7 @@ #include #include #include +#include #include =20 #include "coresight-catu.h" @@ -640,7 +641,6 @@ static void catu_platform_remove(struct platform_device= *pdev) pm_runtime_disable(&pdev->dev); } =20 -#ifdef CONFIG_PM static int catu_runtime_suspend(struct device *dev) { struct catu_drvdata *drvdata =3D dev_get_drvdata(dev); @@ -666,11 +666,9 @@ static int catu_runtime_resume(struct device *dev) =20 return ret; } -#endif =20 -static const struct dev_pm_ops catu_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(catu_runtime_suspend, catu_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(catu_dev_pm_ops, + catu_runtime_suspend, catu_runtime_resume, NULL); =20 #ifdef CONFIG_ACPI static const struct acpi_device_id catu_acpi_ids[] =3D { @@ -688,14 +686,14 @@ static struct platform_driver catu_platform_driver = =3D { .name =3D "coresight-catu-platform", .acpi_match_table =3D ACPI_PTR(catu_acpi_ids), .suppress_bind_attrs =3D true, - .pm =3D &catu_dev_pm_ops, + .pm =3D pm_ptr(&catu_dev_pm_ops), }, }; =20 static struct amba_driver catu_driver =3D { .drv =3D { .name =3D "coresight-catu", - .pm =3D &catu_dev_pm_ops, + .pm =3D pm_ptr(&catu_dev_pm_ops), .suppress_bind_attrs =3D true, }, .probe =3D catu_probe, diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/h= wtracing/coresight/coresight-etm4x-core.c index ace5e077a10c..ef664a84120f 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -2460,7 +2460,6 @@ static const struct amba_id etm4_ids[] =3D { =20 MODULE_DEVICE_TABLE(amba, etm4_ids); =20 -#ifdef CONFIG_PM static int etm4_runtime_suspend(struct device *dev) { struct etmv4_drvdata *drvdata =3D dev_get_drvdata(dev); @@ -2486,11 +2485,9 @@ static int etm4_runtime_resume(struct device *dev) =20 return ret; } -#endif =20 -static const struct dev_pm_ops etm4_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(etm4_runtime_suspend, etm4_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(etm4_dev_pm_ops, + etm4_runtime_suspend, etm4_runtime_resume, NULL); =20 static const struct of_device_id etm4_sysreg_match[] =3D { { .compatible =3D "arm,coresight-etm4x-sysreg" }, @@ -2514,14 +2511,14 @@ static struct platform_driver etm4_platform_driver = =3D { .of_match_table =3D etm4_sysreg_match, .acpi_match_table =3D ACPI_PTR(etm4x_acpi_ids), .suppress_bind_attrs =3D true, - .pm =3D &etm4_dev_pm_ops, + .pm =3D pm_ptr(&etm4_dev_pm_ops), }, }; =20 static struct amba_driver etm4x_amba_driver =3D { .drv =3D { .name =3D "coresight-etm4x", - .pm =3D &etm4_dev_pm_ops, + .pm =3D pm_ptr(&etm4_dev_pm_ops), .suppress_bind_attrs =3D true, }, .probe =3D etm4_probe_amba, diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwt= racing/coresight/coresight-tmc-core.c index ece2e8c9be26..77588d53e1b0 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-core.c +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c @@ -980,8 +980,6 @@ static void tmc_platform_remove(struct platform_device = *pdev) __tmc_remove(&pdev->dev); pm_runtime_disable(&pdev->dev); } - -#ifdef CONFIG_PM static int tmc_runtime_suspend(struct device *dev) { struct tmc_drvdata *drvdata =3D dev_get_drvdata(dev); @@ -1007,11 +1005,9 @@ static int tmc_runtime_resume(struct device *dev) =20 return ret; } -#endif =20 -static const struct dev_pm_ops tmc_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(tmc_runtime_suspend, tmc_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(tmc_dev_pm_ops, + tmc_runtime_suspend, tmc_runtime_resume, NULL); =20 #ifdef CONFIG_ACPI static const struct acpi_device_id tmc_acpi_ids[] =3D { @@ -1029,14 +1025,14 @@ static struct platform_driver tmc_platform_driver = =3D { .name =3D "coresight-tmc-platform", .acpi_match_table =3D ACPI_PTR(tmc_acpi_ids), .suppress_bind_attrs =3D true, - .pm =3D &tmc_dev_pm_ops, + .pm =3D pm_ptr(&tmc_dev_pm_ops), }, }; =20 static struct amba_driver tmc_driver =3D { .drv =3D { .name =3D "coresight-tmc", - .pm =3D &tmc_dev_pm_ops, + .pm =3D pm_ptr(&tmc_dev_pm_ops), .suppress_bind_attrs =3D true, }, .probe =3D tmc_probe, --=20 2.55.0.1003.g10538fe699-goog