From patchwork Wed Jun 26 23:06:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13713512 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 3EA1CC27C4F for ; Wed, 26 Jun 2024 23:07:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B8A4E10E085; Wed, 26 Jun 2024 23:07:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gytzyE9H"; dkim-atps=neutral Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id F09B310E085 for ; Wed, 26 Jun 2024 23:07:15 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2c87a7df96eso663288a91.1 for ; Wed, 26 Jun 2024 16:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719443235; x=1720048035; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UcR50/eTiGUBsrLQ/8tPHrm4EP0Z5a7+eaFu6fbpe10=; b=gytzyE9HRzfi+JwfRuSao4XEATBgx143ipPyM+rW8P13YgEYge/hvNuOr9ojyJxCNs 8Ssjwl3Skjk+070arh8ZVBD4wx8/4IlWgj8haPHzs8ZSRpIkndhE9yqgTJbdNs0Zh0BM 9WmI/U/W/2SY0GruhTmgDRHOqbGsvditO98Qad//hWUOv8fscCnJOInt4McWMBRDBM7V uGYWo6Bz6kt8qnonIrkbGGunGAOAJuw8Sn9mGl+7KL4OKcR5fMlsCa8RlFQjqqMzgsHk YHUU1eRvWAwYGpgGPBonaIjjlPt3nQQNhiVD+zvqcjZ4UKDIjdm19UJ1SxX60JWnoY+9 hl0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719443235; x=1720048035; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UcR50/eTiGUBsrLQ/8tPHrm4EP0Z5a7+eaFu6fbpe10=; b=Z8OMQh9vkddKF0+BldFoBoT0SUCArVkcB0TrJNqJEyFAQFXihq3RWClAgCqmDlmCe9 yWbN+hVUWkFc4vWRb9DlkSPtYVnDwNB6Jd2svFkCQ6/jVqhdmqmpUJQQCABwCKK/BQdu jgHy3ci4MqbcNBQ5SEw+usL1qhTu6oQVnqQEldfUkFBLc9ICOEG76xom98cRN3lYZGwY J7MIx/VMRxJ+C1gzwXo+GBbeBGHMWVp0qh90mTsIQv36w/e5RzLOwFeaIT39e0sQxHDX IBZcmvQofFvtbUz4RePaRd82MAIBod5Ix19tLLwp+pa8Q5VUx71CmONfO2/XsppcjXoD Kpsg== X-Forwarded-Encrypted: i=1; AJvYcCX2JYWBhGPT2DMXYh4YCqmC/L0Bc6oGenYbJdnnphqJWXoifkKRfQ0jI96oBiE5o6nzLEGOlPA3zsPQCNJnpNiu7UuvFsJ6Wvt7i7kwygUF X-Gm-Message-State: AOJu0YwUjKMKnPdlGFQUoEDv8PvbG3B6aUYpx8y4yxxU3qGpyecSm1Yp xmA6hu8CymzhrdIfEs5TVVyLwZGIGTsmibEVFgf5hzMZTUCMT3B+ X-Google-Smtp-Source: AGHT+IFXIZfnMoIDrnrFXhLSKC2s3BSHGsyPbwPPbJ5jM14uEfxAOcJ5BuzreSMcyW2AeTyOCpeSxQ== X-Received: by 2002:a17:90b:4b52:b0:2c4:d7f3:fb00 with SMTP id 98e67ed59e1d1-2c845e5e637mr12178595a91.3.1719443235070; Wed, 26 Jun 2024 16:07:15 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:a460:36ee:dca1:f711]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c8fead3100sm61908a91.49.2024.06.26.16.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 16:07:14 -0700 (PDT) From: Fabio Estevam To: rfoss@kernel.org Cc: neil.armstrong@linaro.org, victor.liu@nxp.com, dri-devel@lists.freedesktop.org, Fabio Estevam Subject: [PATCH 1/6] drm/bridge: imx8mp-hdmi-tx: Switch to SYSTEM_SLEEP_PM_OPS() Date: Wed, 26 Jun 2024 20:06:59 -0300 Message-Id: <20240626230704.708234-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c index 13bc570c5473..4a3a8a3ce250 100644 --- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c @@ -111,12 +111,12 @@ static void imx8mp_dw_hdmi_remove(struct platform_device *pdev) dw_hdmi_remove(hdmi->dw_hdmi); } -static int __maybe_unused imx8mp_dw_hdmi_pm_suspend(struct device *dev) +static int imx8mp_dw_hdmi_pm_suspend(struct device *dev) { return 0; } -static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev) +static int imx8mp_dw_hdmi_pm_resume(struct device *dev) { struct imx8mp_hdmi *hdmi = dev_get_drvdata(dev); @@ -126,8 +126,7 @@ static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev) } static const struct dev_pm_ops imx8mp_dw_hdmi_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend, - imx8mp_dw_hdmi_pm_resume) + SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend, imx8mp_dw_hdmi_pm_resume) }; static const struct of_device_id imx8mp_dw_hdmi_of_table[] = { @@ -142,7 +141,7 @@ static struct platform_driver imx8mp_dw_hdmi_platform_driver = { .driver = { .name = "imx8mp-dw-hdmi-tx", .of_match_table = imx8mp_dw_hdmi_of_table, - .pm = &imx8mp_dw_hdmi_pm_ops, + .pm = pm_ptr(&imx8mp_dw_hdmi_pm_ops), }, }; From patchwork Wed Jun 26 23:07:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13713513 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 17217C30653 for ; Wed, 26 Jun 2024 23:07:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C0C310E9DC; Wed, 26 Jun 2024 23:07:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="B2zNTtnM"; dkim-atps=neutral Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2085A10E9DC for ; Wed, 26 Jun 2024 23:07:18 +0000 (UTC) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-72703dd2b86so30887a12.1 for ; Wed, 26 Jun 2024 16:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719443237; x=1720048037; darn=lists.freedesktop.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=y7P7+EFgd4EWXaRmpN9LiPnTBQYfRx62u/dAEbs/950=; b=B2zNTtnMeL9yOhLoPr7XDmS1MAVFN7OEbsoxvMX7FBWGaSI7FQwtk25MBeX50Q06DF PL4Exy0Iqiq7niMN9uelzmBhRxX9S+ISZGMHJf6Fg9roD3Lu6baUUAzM4fFduJbhenmD 4hOyb+7db90/WrH4+GuKE+ww3kG71XL3gvPrBqZHJM3xICXDdqbxkHw6PkJoNOKyD7Vt 4Ia+GjKQfiDD3y56IyxkUkwPDa6d16zEy+7o5ZZS/kr6Q21dCkhuBfXavbQMHd5tNeQZ lIpNyrmdyT5bcbBxIBRcN3HNPsgofQNCnzY+yYUNdT45ABG9xmtCCWTufqUrRQ1HPxAc RWHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719443237; x=1720048037; 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=y7P7+EFgd4EWXaRmpN9LiPnTBQYfRx62u/dAEbs/950=; b=up3elfaRfekNwEhCswtc62LBVoGnBAh6db/38IHKnqCT5KLbw7Wwv+l7foCZ2rKEDE 5Oqd0Wx7cIcxo32GQ2AQl+9ypZySSFov6nErh8mcPI0ghiorv0hmsNGN/J1O/BZabG74 T7LxmJ/V8D1KOjG3+yQOJCy9m5cJk917d4p5cgnnSDfc3kbUD1FhnhbjZaZ5L+3z+6fc +aH0WrG35oKd85juw8vco0989f6ArcwlgMNIypzIW3CTlT4+vLhu3tFVG2KDmpn3dY4U q4BKFeAFGhHOcE9OyYl6a93xoz3jrJ/3PA4L7eYvizGyt0/2res6uJHMxizipEj5vVLm 6hKg== X-Forwarded-Encrypted: i=1; AJvYcCVHSNpZhMtfPxZ+ORD9Mi8MhugnWu0ItLBwhsLZwO13ODilyKDWFuzKGiH5H3d05vIES/ptiE46S1q5xRVDYR080Bh/M6iBseulwlrrByyf X-Gm-Message-State: AOJu0YxcJ7yjtRoDoEUZ2f8KUDZGPKlSXMNFfJEvcB91am/6FsDrpIfs RIdfT5gy2bOsJVTHNElkri3mhXuqonhCzqQCTmZBfFZqau2y82xy X-Google-Smtp-Source: AGHT+IFhksd6Pn4tjmIwl2TeTYd7Tjik6ivRGsi6IzPIMfA8rXPD5QKe5WJeJPieqF4kI6O5F3dASw== X-Received: by 2002:a17:90a:fb94:b0:2c8:4623:66cd with SMTP id 98e67ed59e1d1-2c846236d22mr12314663a91.1.1719443237419; Wed, 26 Jun 2024 16:07:17 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:a460:36ee:dca1:f711]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c8fead3100sm61908a91.49.2024.06.26.16.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 16:07:17 -0700 (PDT) From: Fabio Estevam To: rfoss@kernel.org Cc: neil.armstrong@linaro.org, victor.liu@nxp.com, dri-devel@lists.freedesktop.org, Fabio Estevam Subject: [PATCH 2/6] drm/bridge: imx8qm-ldb: Switch to RUNTIME_PM_OPS() Date: Wed, 26 Jun 2024 20:07:00 -0300 Message-Id: <20240626230704.708234-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240626230704.708234-1-festevam@gmail.com> References: <20240626230704.708234-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative. The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/imx/imx8qm-ldb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c index 21471a9a28b2..c879e37f5811 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qm-ldb.c @@ -542,12 +542,12 @@ static void imx8qm_ldb_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static int __maybe_unused imx8qm_ldb_runtime_suspend(struct device *dev) +static int imx8qm_ldb_runtime_suspend(struct device *dev) { return 0; } -static int __maybe_unused imx8qm_ldb_runtime_resume(struct device *dev) +static int imx8qm_ldb_runtime_resume(struct device *dev) { struct imx8qm_ldb *imx8qm_ldb = dev_get_drvdata(dev); struct ldb *ldb = &imx8qm_ldb->base; @@ -559,8 +559,7 @@ static int __maybe_unused imx8qm_ldb_runtime_resume(struct device *dev) } static const struct dev_pm_ops imx8qm_ldb_pm_ops = { - SET_RUNTIME_PM_OPS(imx8qm_ldb_runtime_suspend, - imx8qm_ldb_runtime_resume, NULL) + RUNTIME_PM_OPS(imx8qm_ldb_runtime_suspend, imx8qm_ldb_runtime_resume, NULL) }; static const struct of_device_id imx8qm_ldb_dt_ids[] = { @@ -573,7 +572,7 @@ static struct platform_driver imx8qm_ldb_driver = { .probe = imx8qm_ldb_probe, .remove_new = imx8qm_ldb_remove, .driver = { - .pm = &imx8qm_ldb_pm_ops, + .pm = pm_ptr(&imx8qm_ldb_pm_ops), .name = DRIVER_NAME, .of_match_table = imx8qm_ldb_dt_ids, }, From patchwork Wed Jun 26 23:07:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13713514 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 DFC3EC27C4F for ; Wed, 26 Jun 2024 23:07:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBC3410E9DE; Wed, 26 Jun 2024 23:07:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C3s4yfPZ"; dkim-atps=neutral Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4852110E9DC for ; Wed, 26 Jun 2024 23:07:20 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2c7cfba36f8so1267914a91.3 for ; Wed, 26 Jun 2024 16:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719443240; x=1720048040; darn=lists.freedesktop.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=Cub6IPz1p2WkK4nokug8jNwRfG4Pv2MvtgnRT8WYtyg=; b=C3s4yfPZHAXpADtCl4QzCV7SqG+p5f+kc1taFOKha2kjvTJXTf8zUnieBTjjKGr0q+ +odhW2DKKH5vRjKcrRTucuuXPm3zeGor4yeFWv4KL9gQzyFJJom0Cy+BCIS0UlSMYpUG 6gnueImEPgJsJ80jHyDDaXowPJ7hVfs7CMafyANzNTW8b+rcCnksk3XX4nX11534YqPt iVChd9SbDBN614uQd44Vp755SuPedpZIBVPnOyF8yTUmZn1/jNPrUDmFK8DI581YZgMI dalDroL/V4bBsqzgtrkt5gmKz86KNuew5ftpjT0Yf0C24bR6TdrXxrZmZ1vvhn9y7OT3 V6MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719443240; x=1720048040; 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=Cub6IPz1p2WkK4nokug8jNwRfG4Pv2MvtgnRT8WYtyg=; b=RtBzaVQq+urZWVYZ7B4d38d2LRmnmXe0k33MLfVlMpkLQx7pvg2tG0JN4FYVRlNKOk WvykXEtA6n5rtc54Wm+bKKd2FWCy0dBWZLoUDwU3U2BZkRyaYaUoYh08t0MY+4wbsZkW W9F2qtB/FxLxjpBYo9DevQ1jhC99o4NFM8Lmke8lkPy19ohrIyfsmKKuvFcgbVa68dAa ZdrUhcp4GuAJubQkKcI6vf4h1JIjFD9xiDnHENNxbhOHFBuk6TgLfC8fyhj9IgGt8OO9 SjwR7DaEeQ3jd7bMjvTwP4PI4V13AHjR1+2Ki0TUkFwceUjavlBaMPehpGqV3+FYQe0M jLZA== X-Forwarded-Encrypted: i=1; AJvYcCXe1KQgJpoq6/epXGfBNn6bcPID98SjDZxpn6+biCc6+abKluRFxZNHR+Ak5mZNE7gbMYdp1XH5wwr9FX2rIerlADjUljBlkH8xh6J4nCsk X-Gm-Message-State: AOJu0YzJW4BTpTQzcC5K6W3mg3bxhLbB/8b6m/PwpBKDStFv1lFRKite DsC37/u0bmpJx5UaeLRAaiWgvwgRJ8t9w1lz6dwHSbL4BY5joweM X-Google-Smtp-Source: AGHT+IHP3jBXnk9AU75xptJoINvWJwMZLCJcxYBk2ATSguTIe2dvIUIuHnXA+euWta3Db9hfiD0c8Q== X-Received: by 2002:a17:90a:6286:b0:2c8:af45:adb9 with SMTP id 98e67ed59e1d1-2c8af45af82mr6338902a91.0.1719443239791; Wed, 26 Jun 2024 16:07:19 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:a460:36ee:dca1:f711]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c8fead3100sm61908a91.49.2024.06.26.16.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 16:07:19 -0700 (PDT) From: Fabio Estevam To: rfoss@kernel.org Cc: neil.armstrong@linaro.org, victor.liu@nxp.com, dri-devel@lists.freedesktop.org, Fabio Estevam Subject: [PATCH 3/6] drm/bridge: imx8qxp-pixel-combiner: Switch to RUNTIME_PM_OPS() Date: Wed, 26 Jun 2024 20:07:01 -0300 Message-Id: <20240626230704.708234-3-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240626230704.708234-1-festevam@gmail.com> References: <20240626230704.708234-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative. The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c index e6dbbdc87ce2..ce43e4069e21 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -371,7 +371,7 @@ static void imx8qxp_pc_bridge_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static int __maybe_unused imx8qxp_pc_runtime_suspend(struct device *dev) +static int imx8qxp_pc_runtime_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx8qxp_pc *pc = platform_get_drvdata(pdev); @@ -393,7 +393,7 @@ static int __maybe_unused imx8qxp_pc_runtime_suspend(struct device *dev) return ret; } -static int __maybe_unused imx8qxp_pc_runtime_resume(struct device *dev) +static int imx8qxp_pc_runtime_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx8qxp_pc *pc = platform_get_drvdata(pdev); @@ -415,8 +415,7 @@ static int __maybe_unused imx8qxp_pc_runtime_resume(struct device *dev) } static const struct dev_pm_ops imx8qxp_pc_pm_ops = { - SET_RUNTIME_PM_OPS(imx8qxp_pc_runtime_suspend, - imx8qxp_pc_runtime_resume, NULL) + RUNTIME_PM_OPS(imx8qxp_pc_runtime_suspend, imx8qxp_pc_runtime_resume, NULL) }; static const struct of_device_id imx8qxp_pc_dt_ids[] = { @@ -430,7 +429,7 @@ static struct platform_driver imx8qxp_pc_bridge_driver = { .probe = imx8qxp_pc_bridge_probe, .remove_new = imx8qxp_pc_bridge_remove, .driver = { - .pm = &imx8qxp_pc_pm_ops, + .pm = pm_ptr(&imx8qxp_pc_pm_ops), .name = DRIVER_NAME, .of_match_table = imx8qxp_pc_dt_ids, }, From patchwork Wed Jun 26 23:07:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13713515 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 B2FB8C27C4F for ; Wed, 26 Jun 2024 23:07:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E39910E9E0; Wed, 26 Jun 2024 23:07:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f1hcvkAv"; dkim-atps=neutral Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB69010E9DE for ; Wed, 26 Jun 2024 23:07:22 +0000 (UTC) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-724bb90a5e4so198146a12.3 for ; Wed, 26 Jun 2024 16:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719443242; x=1720048042; darn=lists.freedesktop.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=sl5kCWNLD2J3z2sV7dIOG5KI4FQWkxG2rAMfPhdKgXw=; b=f1hcvkAvGe/z1uEQu/hW9VcDhSaXB2O6mFymPhIxr+ubin4nHqbPdXMKv/OTL18o5E nxoxNFQuarORQaUaRJsnW77BRw5p1oq2ln0vd1zaB7XEvQPlZo5UKT/tvVphDal5XWfU 01Dr+GziLOgnAZYeQeASPUSReFIbC8K5rr5kz6ql5/zEe+ETDZOb7X9M79m1DWw36Pfz DT5sraOg+rLUjMaapjvbcYXRuTWuB7CfE7xaTSEbBHWMHG03f/KHhYu5CXFXEwIv7LCY MHGDaVQT/fhH8TpZSGgbRz5xNRNAHdObf1nMfB+RIrclA0qNJL7L1A3ykF5DGuOxVuFY zBUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719443242; x=1720048042; 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=sl5kCWNLD2J3z2sV7dIOG5KI4FQWkxG2rAMfPhdKgXw=; b=PUGRfcXvYygs5O4YKTB6n224OCbFynkV1WPVoC8/nQ6QlvdwlC1wwiMgcfhkpFuVLp I+XAzdX/TKOnkopzdB1VMe3Wa5KptB07C7pKt9YQupZcQusg794IjbiGes4+W6SiPplf Fs8ZfZ5clsMy4q67UfJHSEJgb1aDd+VgCF72aDSyLIcYbKzbsztjz3RKntOSb9Y/Qqsf 51mbkhP7g3P/5US4R2WwA7FWOYT0k4IzB9CJtJNpEnjlCKmwzHmOJ58IPdW+GxuLb0iw 7Qo4aoj0MYpPlcBLpCaFMvTZpt8j6+/WhHGkqXNDRbQCC+nCy9QYsCAhjjbV/0HzgAxC mMTQ== X-Forwarded-Encrypted: i=1; AJvYcCXT2tJotBaG4eaXyMWKMI3N0+jYQ/fvSZUnOYaGLQMIFXcrjnEsMAUzETIb+FM1IXmugi51H4m3qM8E9g8t2Uz+YDen8mouvGEjOsqCF6Ji X-Gm-Message-State: AOJu0YxCqk4TBSGQDIZCRm/JWXePsKkQTEmpA9/debP1F164svQmJTye pfwgPn/LpRLixtS7Lh8ANfI2sNiiiAdTV1iMOlP+5y1DGKE7xT8TeSOhkA== X-Google-Smtp-Source: AGHT+IERVTfLfI6YIka4CraTPVwB35HluQbN8Ckuj2KzoIDZdNmDGM6f/7HSfTEFXh+iXtg5fiK4CQ== X-Received: by 2002:a17:90b:82:b0:2c8:412:8746 with SMTP id 98e67ed59e1d1-2c845e5a542mr12352312a91.4.1719443242154; Wed, 26 Jun 2024 16:07:22 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:a460:36ee:dca1:f711]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c8fead3100sm61908a91.49.2024.06.26.16.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 16:07:21 -0700 (PDT) From: Fabio Estevam To: rfoss@kernel.org Cc: neil.armstrong@linaro.org, victor.liu@nxp.com, dri-devel@lists.freedesktop.org, Fabio Estevam Subject: [PATCH 4/6] drm/bridge: samsung-dsim: Switch to RUNTIME_PM_OPS() Date: Wed, 26 Jun 2024 20:07:02 -0300 Message-Id: <20240626230704.708234-4-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240626230704.708234-1-festevam@gmail.com> References: <20240626230704.708234-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative. The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/samsung-dsim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c index e7e53a9e42af..73ccf21ae446 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -2043,7 +2043,7 @@ void samsung_dsim_remove(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(samsung_dsim_remove); -static int __maybe_unused samsung_dsim_suspend(struct device *dev) +static int samsung_dsim_suspend(struct device *dev) { struct samsung_dsim *dsi = dev_get_drvdata(dev); const struct samsung_dsim_driver_data *driver_data = dsi->driver_data; @@ -2073,7 +2073,7 @@ static int __maybe_unused samsung_dsim_suspend(struct device *dev) return 0; } -static int __maybe_unused samsung_dsim_resume(struct device *dev) +static int samsung_dsim_resume(struct device *dev) { struct samsung_dsim *dsi = dev_get_drvdata(dev); const struct samsung_dsim_driver_data *driver_data = dsi->driver_data; @@ -2108,7 +2108,7 @@ static int __maybe_unused samsung_dsim_resume(struct device *dev) } const struct dev_pm_ops samsung_dsim_pm_ops = { - SET_RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL) + RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL) SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; @@ -2142,7 +2142,7 @@ static struct platform_driver samsung_dsim_driver = { .remove_new = samsung_dsim_remove, .driver = { .name = "samsung-dsim", - .pm = &samsung_dsim_pm_ops, + .pm = pm_ptr(&samsung_dsim_pm_ops), .of_match_table = samsung_dsim_of_match, }, }; From patchwork Wed Jun 26 23:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13713516 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 3BBC8C30653 for ; Wed, 26 Jun 2024 23:07:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1AB2710E9E3; Wed, 26 Jun 2024 23:07:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AdAxBnkY"; dkim-atps=neutral Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 19D3210E9DE for ; Wed, 26 Jun 2024 23:07:25 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2c8b5a236daso393391a91.1 for ; Wed, 26 Jun 2024 16:07:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719443244; x=1720048044; darn=lists.freedesktop.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=fCmh9hAz3AWuYhqTaQEMph1iwcr0FSY/ErS9D4TCWpo=; b=AdAxBnkYedut1I8uuAkbcZSVXxGdXmQvYhcxa3gCWEYvOi2td1B3ocdzcTznuN6MQO CnkOyVbI7pk5JVImycJ3CSPvdtiWt1gn5amxKqNv1GgNS/xw1VJqs8+qXDuTtdRpMRZ/ UkfdeMwHUKiIGGOFm/pz7Ji6Z8f+k1b96UEFhbw7ATaXWH11CNSHA8JWv1yyLy4FdsV6 qeGQKzjSnxT2f72mzD0+6yUJOud/OlPC5L7TcLz09G0IMhi0OxGPCA92DEhbHD6UcqrI u5FkLLx+T2rcefXkOFL10HFdwP2z47N8HzwSMuGGUM7F3toNmbC6ESuhzkRV90o4sH6t G2Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719443244; x=1720048044; 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=fCmh9hAz3AWuYhqTaQEMph1iwcr0FSY/ErS9D4TCWpo=; b=rUhS7DzKMgdLczdRC6YMcLqBNsFmSjONAZV26aIfK4XBjXMASzEHC8mppZhgQX1960 p1cFQDy9qeidTwl5A8S4ahFoTyA8a3DqC55DEnKXhfVx9tPcEavaa7ZKJoZQjAbbQqDr gcFWsC3v03hgDi2fHKmbXSy101iAqTKE7u+qfAisKx9FXE8PJFoDNVLzhvwRTElVTzSZ GK9jffa9dke3Xfl5bx5CmQPe98GMWJLWGWhofDPgWw809FMs/MUAia/Awh1VMAEdViiP 4PfeVd9CjZ7Cho+g7m3CYK5zSD5dmkOPlDgzzw5BMLfoh65BlOaICVpOxcquyMVP3vSD gw3A== X-Forwarded-Encrypted: i=1; AJvYcCXloiLkJRyAtZHNos4jUWGSLN30AMN+RJ7MUtx3TMjzhdEFgh/yo0+a3unqQWDrUixfNiNQvV5tFYBgFaSlny19qg3lwUc1DLr09qelaWjS X-Gm-Message-State: AOJu0YyZg9PonPgkE5WilvtYm2Pptt5b96x38ggFN9UduBPHDMA2JOhZ V6JRj34otRFirsCzH0apViEjCXKNP4bGS69C4wJujuJ3y4cL8UOFADAa1A== X-Google-Smtp-Source: AGHT+IHb1vWs5mV5OJXelPcBZpetUl/5Gjbv1RPyeokMKxRYlDPFTDsnvepK9ntTDtAdJY6gUxNC7g== X-Received: by 2002:a17:90a:db94:b0:2c2:d11b:14dd with SMTP id 98e67ed59e1d1-2c8452e0fdbmr12343871a91.0.1719443244460; Wed, 26 Jun 2024 16:07:24 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:a460:36ee:dca1:f711]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c8fead3100sm61908a91.49.2024.06.26.16.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 16:07:24 -0700 (PDT) From: Fabio Estevam To: rfoss@kernel.org Cc: neil.armstrong@linaro.org, victor.liu@nxp.com, dri-devel@lists.freedesktop.org, Fabio Estevam Subject: [PATCH 5/6] drm/bridge: dw-hdmi-cec: Switch to SYSTEM_SLEEP_PM_OPS() Date: Wed, 26 Jun 2024 20:07:03 -0300 Message-Id: <20240626230704.708234-5-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240626230704.708234-1-festevam@gmail.com> References: <20240626230704.708234-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c index 673661160e54..d4614de1ae1e 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c @@ -312,7 +312,7 @@ static void dw_hdmi_cec_remove(struct platform_device *pdev) cec_unregister_adapter(cec->adap); } -static int __maybe_unused dw_hdmi_cec_resume(struct device *dev) +static int dw_hdmi_cec_resume(struct device *dev) { struct dw_hdmi_cec *cec = dev_get_drvdata(dev); @@ -328,7 +328,7 @@ static int __maybe_unused dw_hdmi_cec_resume(struct device *dev) return 0; } -static int __maybe_unused dw_hdmi_cec_suspend(struct device *dev) +static int dw_hdmi_cec_suspend(struct device *dev) { struct dw_hdmi_cec *cec = dev_get_drvdata(dev); @@ -341,7 +341,7 @@ static int __maybe_unused dw_hdmi_cec_suspend(struct device *dev) } static const struct dev_pm_ops dw_hdmi_cec_pm = { - SET_SYSTEM_SLEEP_PM_OPS(dw_hdmi_cec_suspend, dw_hdmi_cec_resume) + SYSTEM_SLEEP_PM_OPS(dw_hdmi_cec_suspend, dw_hdmi_cec_resume) }; static struct platform_driver dw_hdmi_cec_driver = { @@ -349,7 +349,7 @@ static struct platform_driver dw_hdmi_cec_driver = { .remove_new = dw_hdmi_cec_remove, .driver = { .name = "dw-hdmi-cec", - .pm = &dw_hdmi_cec_pm, + .pm = pm_ptr(&dw_hdmi_cec_pm), }, }; module_platform_driver(dw_hdmi_cec_driver); From patchwork Wed Jun 26 23:07:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13713517 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 48C98C30653 for ; Wed, 26 Jun 2024 23:07:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A5E8B10E9E1; Wed, 26 Jun 2024 23:07:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Yn4JAK8W"; dkim-atps=neutral Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C51C10E9DE for ; Wed, 26 Jun 2024 23:07:27 +0000 (UTC) Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2c87a7df96eso663309a91.1 for ; Wed, 26 Jun 2024 16:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719443247; x=1720048047; darn=lists.freedesktop.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=0ysPEDdjx+oXzAukwH6lm+msRgYkmqB/xy16SUQDFEQ=; b=Yn4JAK8WqUQ+fvae0MHPm4vj9gCeOK1oEEPa+/PVklYfFyL1srzw5l+dgvOoJfSlY0 9/cy0CSWOdmzSJp0iwY2CrSsiOT6Ly6xLY/z6h6a1pOUX5CQGIh7cyUFEX4cITTACNxw USzEgszcmLd4j9x4GnhPZVdr2njnDyC6JgHoYLva24F78nQjpRfkIn2kZbALmuXHnHMX ifGJlkia0MeHhHtvmgLjhbp63+5dGFT7aTWn7go8Bw7cEnXW74NTTlEUSh4ZWz+7hBI1 u3tPgoPcFtaw7QyUJucGTMyXV4OGshbQZFG5F2vId44iuUt7gKehD+EUDElzTqZ6ZtBx 7Seg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719443247; x=1720048047; 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=0ysPEDdjx+oXzAukwH6lm+msRgYkmqB/xy16SUQDFEQ=; b=WFPp0vjdnlyIjqcIjKLqLQPA1ZGR9QcQv+Q3DkCDVmOqKwwGytMaTUliHEia75v3fd d7kf4QO9cejzpYGQvEYQqT6MujiM1aQiaORF15LO1RSYBwdOOwvQn47N8wUA18CSgC2T /pAxmavJ/uGSkwdS+Y12xq8uarHswEjbqAiGAAtPpd778x9Du95cO4MdWCEmrr/2m3Xl DS5+KGg0In9d6ZlocrwIFiLNZLgcTSEpnSX9MhiTkv8FE2u3Ipi+c1wpYwuWTLnJjIqe a13quKBJwv1141Wtcm+4x+Uw4M17dA6mTihoFiLLaXFk5b54ta75rFQtjUahjVBjv1I7 EhRA== X-Forwarded-Encrypted: i=1; AJvYcCUigWbK1oC2FPCrThBP9r9oUXZ4TMOSC+31XWkC9JxgA7qosMZSBJ/fqbW+pZC6nVEJsVxK3SsSIluXTBNLh3QBgmWsNEYN/l/IvUkY4Mue X-Gm-Message-State: AOJu0YySySY0JAsv6Ddj8Q2MqCBxu6w7hBo032Mzs+/mhKhsMGMmJ86v EGzmWbS8rkdE7spDDip6zOZa7TcGsEd8HyLtk2vtSetmFV/hmUy8 X-Google-Smtp-Source: AGHT+IGgQSleDrOT//ReNzqK7pbrNgiuFaPxAInrhtSm8tZXQPLXH67r42IikpGzGgOZjoLmoautog== X-Received: by 2002:a17:90a:bf16:b0:2c4:cd15:3e4b with SMTP id 98e67ed59e1d1-2c845f72020mr12168717a91.4.1719443246809; Wed, 26 Jun 2024 16:07:26 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:a460:36ee:dca1:f711]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c8fead3100sm61908a91.49.2024.06.26.16.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 16:07:26 -0700 (PDT) From: Fabio Estevam To: rfoss@kernel.org Cc: neil.armstrong@linaro.org, victor.liu@nxp.com, dri-devel@lists.freedesktop.org, Fabio Estevam Subject: [PATCH 6/6] drm/bridge: imx8qxp-ldb: Switch to RUNTIME_PM_OPS() Date: Wed, 26 Jun 2024 20:07:04 -0300 Message-Id: <20240626230704.708234-6-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240626230704.708234-1-festevam@gmail.com> References: <20240626230704.708234-1-festevam@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Fabio Estevam Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative. The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c index 7984da9c0a35..b33011f397f0 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c @@ -678,12 +678,12 @@ static void imx8qxp_ldb_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static int __maybe_unused imx8qxp_ldb_runtime_suspend(struct device *dev) +static int imx8qxp_ldb_runtime_suspend(struct device *dev) { return 0; } -static int __maybe_unused imx8qxp_ldb_runtime_resume(struct device *dev) +static int imx8qxp_ldb_runtime_resume(struct device *dev) { struct imx8qxp_ldb *imx8qxp_ldb = dev_get_drvdata(dev); struct ldb *ldb = &imx8qxp_ldb->base; @@ -695,8 +695,7 @@ static int __maybe_unused imx8qxp_ldb_runtime_resume(struct device *dev) } static const struct dev_pm_ops imx8qxp_ldb_pm_ops = { - SET_RUNTIME_PM_OPS(imx8qxp_ldb_runtime_suspend, - imx8qxp_ldb_runtime_resume, NULL) + RUNTIME_PM_OPS(imx8qxp_ldb_runtime_suspend, imx8qxp_ldb_runtime_resume, NULL) }; static const struct of_device_id imx8qxp_ldb_dt_ids[] = { @@ -709,7 +708,7 @@ static struct platform_driver imx8qxp_ldb_driver = { .probe = imx8qxp_ldb_probe, .remove_new = imx8qxp_ldb_remove, .driver = { - .pm = &imx8qxp_ldb_pm_ops, + .pm = pm_ptr(&imx8qxp_ldb_pm_ops), .name = DRIVER_NAME, .of_match_table = imx8qxp_ldb_dt_ids, },