From patchwork Wed Feb 5 20:07:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961888 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86763212D86 for ; Wed, 5 Feb 2025 20:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786181; cv=none; b=RHBeWb1EMeStg+db6zjtNFSIl7pcLJDtp0Y95FSdCxb98Tfuax9+oBv3bLchjkvnT4NZeoAsT6T6d69o0jsI0F7FsKlVUMudvoy3MUpbCfrYHi0O8OsxLRvg0KIQmQZ0QTUUguhnAIr2zMuBnh+l2DHbsrXr5KrLMAnCrRVNMwA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786181; c=relaxed/simple; bh=EiZLkZhOyAW9xsLWltUT3PNY16MrDfjY5hC7dVEFLOM=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=LUrL2pJnbNMOYHL45aZWMV5D7Mf/2ra85TAezrfgd8o1OsH4fvyIQukVRbLdRgDd8Hqi4DRXwfncK+Z5e4H0UsEaekU6AJwY5vKd8R7JzctNTqwLPeoRGYRCZShH1ARro0iImF4zvia4fdnIFhjCq5IxPy9jGWMkYvG/l+dHPbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=f14T7SDX; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="f14T7SDX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xMGlgFMnw8m0fqnHlMzqGgmx7iSobyGCc1e2rGwWxUo=; b=f14T7SDXAkQjwEG0K1HXQp5Z3mNkdtCJVNWZmegtl+Eg+adhHm3ea1MEG8kn1AoJyAxZnD zh4Pt9AqvTJi4GggaYlnSlnqoSVdf+dirLRa6gc5MHCKthuc8dyWAyLtxznTP7/Mkrnrfi Wx2VL5xo3cytq++y29GzXMkL+z2lMPU= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-iY7-9AexO_-TAQ-WEUaP4w-1; Wed, 05 Feb 2025 15:09:35 -0500 X-MC-Unique: iY7-9AexO_-TAQ-WEUaP4w-1 X-Mimecast-MFC-AGG-ID: iY7-9AexO_-TAQ-WEUaP4w Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A076E1956046; Wed, 5 Feb 2025 20:09:26 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6AED119560AB; Wed, 5 Feb 2025 20:09:13 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:07:57 -0500 Subject: [PATCH 01/12] drm/aspeed: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-1-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1480; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=EiZLkZhOyAW9xsLWltUT3PNY16MrDfjY5hC7dVEFLOM=; b=XsxAeoZCVozTJnK/kqDAMY/ckZluYOAy4E4MbTsDIaSx08ZZijKGTvdfXCM4/qCOdCyfsoNqm r258ZdLMkhbABTbRgisKxCgmikN0I/EpdAk+57cA0jPzqzp7njZRhyL X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: TShWxd-DBCSVbnJfhO-3uVFXLPXDWXHNhHbs0cvWCTc_1738786169 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Joel Stanley Acked-by: Andrew Jeffery Reviewed-by: Maxime Ripard Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index 397e677a691c2c6d199063f44358196a4569b389..46094cca297479d1cf19f6db99538c5e7a0fec92 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -144,11 +144,9 @@ static int aspeed_gfx_load(struct drm_device *drm) struct aspeed_gfx *priv = to_aspeed_gfx(drm); struct device_node *np = pdev->dev.of_node; const struct aspeed_gfx_config *config; - struct resource *res; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(drm->dev, res); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); From patchwork Wed Feb 5 20:07:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961889 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 228C4215049 for ; Wed, 5 Feb 2025 20:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786193; cv=none; b=Mbef44rUewejIjxDhUf9ZDlBdjh9GGTqwJfgCSoP67jtNsv4RlzSfWVRicNGm75Ozoztf4b5iPjauAFDMcgak88ERy3xbtWj1MUsDQbp1o99rSitNvjB9A8ttmE1CPU7Ec5YkoKU6faF5/6dJYPtoBzpurL80EUS6s3Lq5TXI9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786193; c=relaxed/simple; bh=8Mr23W/+G1uZ617GLarMPiY6eX2ezkHI6A58kZ43cp4=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=bH8oHN/+B3CgqtjWrg7RsmnYbXHTWyqUS2ljksVjgDNvShy9sgVYxWsNx+8grhLBjTmNfF5rxKuiufWV0UO/KW1L3xPZNWu8o7glUbTjkYFZI8cENrIyPsSZaWzZCgm2EGteM2SMk+B21sXj7ouhMuOrUDRi9BtUlimwb7nXAsQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=TSefmSfW; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TSefmSfW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qItC1tMYOWKCL7xMXToSIOhC8XUwskbCivBq7IFZWAE=; b=TSefmSfW3DvLlyiXR8tNTPDw4BPrgpEXRWakQ63MtW7HzuBE4jkMSU/7QE3t/dBfmAZEMq w6lauG1kfQnWyKrPMksJbRYmcfcOCoIQ2icHM6Hr6tp+YaZ/BwFC1UZryXtvtzKoAgbmbC UGE+6I1gplaSNBOWZFYp/+5tmpSb40E= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-321-hrErVV9hOtKQYRcqM4KqKA-1; Wed, 05 Feb 2025 15:09:46 -0500 X-MC-Unique: hrErVV9hOtKQYRcqM4KqKA-1 X-Mimecast-MFC-AGG-ID: hrErVV9hOtKQYRcqM4KqKA Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CD4E91800268; Wed, 5 Feb 2025 20:09:39 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F082319560AF; Wed, 5 Feb 2025 20:09:26 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:07:58 -0500 Subject: [PATCH 02/12] drm/fsl-dcu: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-2-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1621; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=8Mr23W/+G1uZ617GLarMPiY6eX2ezkHI6A58kZ43cp4=; b=w08+1to0zmPLfPwhWnJMT8LxzW4bcZA6anv7/SWrFNcdFBQ5F4zNDLZbsDRD/1JkaHM+xTeB7 v+CbIKQMYBkDh/lXileZfuakl3WJsLEI+Ds2v6laXWkMyZaAifjm2YR X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: WBp9B0f2RRLhAgUXqdrFZXWf_eX0zLHVIX-jQEf3PWI_1738786181 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Stefan Agner Cc: Alison Wang Reviewed-by: Maxime Ripard Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c index 03b076db9381a5db0bff6576cda2772495a61fed..3bbfc1b56a6557e2f54d2b7ed099531053871341 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c @@ -260,7 +260,6 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev) struct fsl_dcu_drm_device *fsl_dev; struct drm_device *drm; struct device *dev = &pdev->dev; - struct resource *res; void __iomem *base; struct clk *pix_clk_in; char pix_clk_name[32]; @@ -278,8 +277,7 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev) return -ENODEV; fsl_dev->soc = id->data; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(dev, res); + base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) { ret = PTR_ERR(base); return ret; From patchwork Wed Feb 5 20:07:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961890 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1B4D2135C5 for ; Wed, 5 Feb 2025 20:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786203; cv=none; b=XIjy01+WUcZ1340DPtxyaQNU2eSZRBJbFNfpbfWH4nDuX30RSpju5n27R2Gm0YxkaDmbyUA29ZpNhqp71CcPkguOBnYTQcZW4PawFuJxwz4ENYE8ZTUTvaHJfaj17isk6vbDSX5zFccU7OoPpNabQEuBYHeLbf7m/9nuDJrucg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786203; c=relaxed/simple; bh=DSpX8fD4B4V0ccw0v0OQXmxnb/T74xXl9np96mYbmE0=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=bXEKkbQyIg68pkTpGKtbuIZC6ovk4xfxz1px1N147BVK6MQMmvJOUGzyQEVoe7wNQuNmCYTz5sz+Rj2D6c8vveOWgsa5Z2LCVHhgi6Kgo9kP4pshjqUnuMzM8FjBy3SLIy4xsjqxzOgbc1d+TlaG1Wu3OQZ9u30PuKuZIhgkub4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=jEnKCJdS; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="jEnKCJdS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HY3d/YBxMJY4CA4cB8Zgueq4cZjGXa+WIDOvgIQwRlg=; b=jEnKCJdSLYFOsxFaIX31jS4VjyWMQJQLXnIuAE27FHfHSVVhXYeeaPBg839HJKj/ww02tS VWqIthsqjn1nlsDFwIlcm3lFVqp3xR25gzXIy3cw/0e3q7L3v+G7lWtPZBgLsHDhSVJyPM M9TxVqmH/5Yrhbt+1z1cljkEwl3Az5w= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-261-OD93fDdhNzOzq3rUG2uwJg-1; Wed, 05 Feb 2025 15:09:58 -0500 X-MC-Unique: OD93fDdhNzOzq3rUG2uwJg-1 X-Mimecast-MFC-AGG-ID: OD93fDdhNzOzq3rUG2uwJg Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4E9ED1800874; Wed, 5 Feb 2025 20:09:51 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2866F19560A3; Wed, 5 Feb 2025 20:09:39 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:07:59 -0500 Subject: [PATCH 03/12] drm/hisilicon: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-3-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=2968; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=DSpX8fD4B4V0ccw0v0OQXmxnb/T74xXl9np96mYbmE0=; b=fSQOdJcSn2RKbZ+5QQXhv4fvSKOo32FtWRGGBP80/lHVkgtVh1f2TOQLA1+0BiBBSCNejmWuS YTHdNRmUxJHA7e/hOY8KpsMAN6VgCDKMM+JFb4kXGScOVSJatEHDA6u X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 1n6UD3EnNEQZYGKnctqmfsao0J2b32EVewJDFr1hN8I_1738786192 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Xinliang Liu Cc: Tian Tao Cc: Xinwei Kong Cc: Sumit Semwal Cc: Yongqin Liu Cc: John Stultz Reviewed-by: Maxime Ripard Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 4 +--- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c index 2eea9fb0e76bf3ead8f5914e6ebb65b5b3603b9a..e80debdc41763357cb2cf321205c0dfac80a911e 100644 --- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c @@ -825,7 +825,6 @@ static const struct component_ops dsi_ops = { static int dsi_parse_dt(struct platform_device *pdev, struct dw_dsi *dsi) { struct dsi_hw_ctx *ctx = dsi->ctx; - struct resource *res; ctx->pclk = devm_clk_get(&pdev->dev, "pclk"); if (IS_ERR(ctx->pclk)) { @@ -833,8 +832,7 @@ static int dsi_parse_dt(struct platform_device *pdev, struct dw_dsi *dsi) return PTR_ERR(ctx->pclk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ctx->base = devm_ioremap_resource(&pdev->dev, res); + ctx->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ctx->base)) { DRM_ERROR("failed to remap dsi io region\n"); return PTR_ERR(ctx->base); diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 2eb49177ac42bc6dba692328cca5c99d5925041c..45c4eb008ad5d639340f769ad022d186ec454722 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -844,7 +844,6 @@ static struct drm_plane_funcs ade_plane_funcs = { static void *ade_hw_ctx_alloc(struct platform_device *pdev, struct drm_crtc *crtc) { - struct resource *res; struct device *dev = &pdev->dev; struct device_node *np = pdev->dev.of_node; struct ade_hw_ctx *ctx = NULL; @@ -856,8 +855,7 @@ static void *ade_hw_ctx_alloc(struct platform_device *pdev, return ERR_PTR(-ENOMEM); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ctx->base = devm_ioremap_resource(dev, res); + ctx->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ctx->base)) { DRM_ERROR("failed to remap ade io base\n"); return ERR_PTR(-EIO); From patchwork Wed Feb 5 20:08:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961891 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EE12214210 for ; Wed, 5 Feb 2025 20:10:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786214; cv=none; b=KM2ppBxXeEuJljbsufdN/4dStWkMdL4noQGNwZilJETeLiQ0MboP85OJX/4p5duk4kNm+0BwEmSPkwPpLblZRMP56H1NUlx3YHLEl2QU8VN7WfCmNz1O7OFdueKz4Mg4t53Y2RgjhwrzdVG3FW0aijnRuxQpuf2C5OJYguKSKRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786214; c=relaxed/simple; bh=gaN5bJDrpd5isCfkjzOID9ayJIdjOxeGWmWcCy/9kzE=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=kefd0iti4/5UVKBYlDV13vhZJ2GwjPglERn0mxhBtWgX9ijxOxP3E51HJYgIkuflDL5CW17ht8Aums2TOLemHFo4GVKhf6RC7G/3TgJXqp8TlZK7ZaH3Q4cf4NRQXdDcDRy2odcPRr0G/8JNFnAOERXSFGRI6P3duE1PhrfAMb8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=WZlTMLIY; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WZlTMLIY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OOJO4gc/B+VHUdBaesnMxetPUuR8LvhMIAVa1+IoQu4=; b=WZlTMLIYdNdkbIrA2YymN/UP4msF6/VtVe/nAgO+qxdzuz6hNdXRqnCxoPYoGMJWhW3Zvb vqpXaLAn4BXnrYcbtpunyfFBEn8MXTJjtgbIWJPYpr0zk1TW47zkx//MTbYXXMVfCwuQEc dXbKlyBx0eKyZOxEpJNOIEaQbyFZRY8= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-10-VYKDWJafPH-VyoV7Qf35Uw-1; Wed, 05 Feb 2025 15:10:10 -0500 X-MC-Unique: VYKDWJafPH-VyoV7Qf35Uw-1 X-Mimecast-MFC-AGG-ID: VYKDWJafPH-VyoV7Qf35Uw Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8543719560A6; Wed, 5 Feb 2025 20:10:02 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9FCFE19560AF; Wed, 5 Feb 2025 20:09:51 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:00 -0500 Subject: [PATCH 04/12] drm/mediatek: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-4-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=8685; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=gaN5bJDrpd5isCfkjzOID9ayJIdjOxeGWmWcCy/9kzE=; b=0gfVdfxGwiEcvFlm/cdX7S5NTjoS7jEAqhe2Db/J7t0CgEpbppqG3fmT8PKknuWA2klzTan1Z 8nrQnMJFkJCCeFCbyf5W66EznEfN9iVpQByBnQ5/CcFOKXl/Rc6mfqE X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: cbNnyaw7wLbuqGXB4rVTEjoZOGeQnqud6-F9L5p0YWA_1738786203 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Chun-Kuang Hu Cc: Philipp Zabel Signed-off-by: Anusha Srivatsa Reviewed-by: Maxime Ripard --- drivers/gpu/drm/mediatek/mtk_disp_color.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_merge.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 4 +--- drivers/gpu/drm/mediatek/mtk_dsi.c | 4 +--- drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 +--- drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 4 +--- 8 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/mediatek/mtk_disp_color.c index dd8433a38282a9ba1bcc3a4ddd01dd89738ccb60..39c7de4cdcc16b56a5a1d046aaabaf5580227ed2 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_color.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_color.c @@ -96,7 +96,6 @@ static int mtk_disp_color_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_color *priv; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -108,8 +107,7 @@ static int mtk_disp_color_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to get color clk\n"); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) return dev_err_probe(dev, PTR_ERR(priv->regs), "failed to ioremap color\n"); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c index b17b11d93846f2019d8c4afb294375333e22dc42..8afd15006df2a21f3f52fe00eca3c5501f4fb76a 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_gamma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_gamma.c @@ -256,7 +256,6 @@ static int mtk_disp_gamma_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_gamma *priv; - struct resource *res; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -268,8 +267,7 @@ static int mtk_disp_gamma_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to get gamma clk\n"); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) return dev_err_probe(dev, PTR_ERR(priv->regs), "failed to ioremap gamma\n"); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_merge.c b/drivers/gpu/drm/mediatek/mtk_disp_merge.c index 563b1b248fbbb38ef03bb3e3ceecdd265961df60..b174dda091d3fbd16796e8e128b030fccf5b902c 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_merge.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_merge.c @@ -306,7 +306,6 @@ static const struct component_ops mtk_disp_merge_component_ops = { static int mtk_disp_merge_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct resource *res; struct mtk_disp_merge *priv; int ret; @@ -314,8 +313,7 @@ static int mtk_disp_merge_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) return dev_err_probe(dev, PTR_ERR(priv->regs), "failed to ioremap merge\n"); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index df82cea4bb79c472acbb66e0df27fbad3e70bd20..d0581c4e3c999cf865fdd0aaf4c2f38dd404926e 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -604,7 +604,6 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_ovl *priv; - struct resource *res; int irq; int ret; @@ -621,8 +620,7 @@ static int mtk_disp_ovl_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to get ovl clk\n"); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) return dev_err_probe(dev, PTR_ERR(priv->regs), "failed to ioremap ovl\n"); diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c index bf47790e4d6be5d60070c63c15c75fa201cc4b27..c9d41d75e7f2a3af5820921b7e563da377ce8d0d 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c @@ -313,7 +313,6 @@ static int mtk_disp_rdma_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_disp_rdma *priv; - struct resource *res; int irq; int ret; @@ -330,8 +329,7 @@ static int mtk_disp_rdma_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to get rdma clk\n"); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) return dev_err_probe(dev, PTR_ERR(priv->regs), "failed to ioremap rdma\n"); diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c index 40752f2320548fbf6c7de96b18e8a636ac9c31be..f298293471de49473dd05973383dc22f7d3b6c23 100644 --- a/drivers/gpu/drm/mediatek/mtk_dsi.c +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c @@ -1192,7 +1192,6 @@ static int mtk_dsi_probe(struct platform_device *pdev) { struct mtk_dsi *dsi; struct device *dev = &pdev->dev; - struct resource *regs; int irq_num; int ret; @@ -1217,8 +1216,7 @@ static int mtk_dsi_probe(struct platform_device *pdev) if (IS_ERR(dsi->hs_clk)) return dev_err_probe(dev, PTR_ERR(dsi->hs_clk), "Failed to get hs clock\n"); - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dsi->regs = devm_ioremap_resource(dev, regs); + dsi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dsi->regs)) return dev_err_probe(dev, PTR_ERR(dsi->regs), "Failed to ioremap memory\n"); diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index ca82bc829cb96446d4d34eeef45848df03bd716b..d729c13590cb5ec176f15b680c262a26b677e6aa 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1425,7 +1425,6 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, struct device_node *cec_np, *remote, *i2c_np; struct platform_device *cec_pdev; struct regmap *regmap; - struct resource *mem; int ret; ret = mtk_hdmi_get_all_clk(hdmi, np); @@ -1471,8 +1470,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, } hdmi->sys_regmap = regmap; - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hdmi->regs = devm_ioremap_resource(dev, mem); + hdmi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) { ret = PTR_ERR(hdmi->regs); goto put_device; diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c index fc69ee38ce7d6a245a7460cfde8de426e83b2e80..7982788ae9df51f1a378d8d538737f38af7299f2 100644 --- a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c +++ b/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c @@ -291,7 +291,6 @@ static const struct component_ops mtk_mdp_rdma_component_ops = { static int mtk_mdp_rdma_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct resource *res; struct mtk_mdp_rdma *priv; int ret = 0; @@ -299,8 +298,7 @@ static int mtk_mdp_rdma_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs = devm_ioremap_resource(dev, res); + priv->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->regs)) return dev_err_probe(dev, PTR_ERR(priv->regs), "failed to ioremap rdma\n"); From patchwork Wed Feb 5 20:08:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961892 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3DBF20CCF4 for ; Wed, 5 Feb 2025 20:10:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786225; cv=none; b=je9LzIezMKUwrOjk/TiniZBZpICKzFhIxO+LCE+Ajl/5KKCOWJPnOj/CWbxXCwf/4O4s4OuQS8bzmMi/sXEmdkAHeV9NGVt2BvYIcmlVWzU4ZTJx/uV5opxktzQ3BR4XnDnYjkft//VdkAL9dwRK8CRsXIXkAQRUJdHNJ+v6ddM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786225; c=relaxed/simple; bh=utPybh0lyb/JNub60ma7JiaZencmSPaI/Rr5vAWohcI=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=BypEtv1ugs4j3szULwgMnKCP+19DBNDsx5IqK1hcAKj2xeAt8KURvuWGwQvvlAjsZIQwgzQsJRNdq4Z6PBOEK6xR/xwfKaT1GVUDHvsJ9r1uByKfUmtm8ToF0w4vkIqhe0Zxbrhg5AnrAUnE1RmEVVwnIyyOY47frR4+NqkgKXQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=DSRcyw3i; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="DSRcyw3i" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786223; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=augFT1SKfyLDD3QeIiU5g0n6Ov6tdKdIhndLDX7uWgM=; b=DSRcyw3i8XdrqhFJf1u9/Tmfxcq5a0BX8MAvkL9Y/rIL9xcZhs0yO9Nv3qnKG0xXPJGVLG KbyPuIiwJEFVrrWh75WwyFIzZuAP7IBhHWJKh6DMEihnyIIRNxzjWIc2s8kW0VnUjAFeUY Czce0iJtcKY3F/EO1fMvDer3hj9tPbg= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-D2LMSFsSPviBuVMQMdNA6g-1; Wed, 05 Feb 2025 15:10:19 -0500 X-MC-Unique: D2LMSFsSPviBuVMQMdNA6g-1 X-Mimecast-MFC-AGG-ID: D2LMSFsSPviBuVMQMdNA6g Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 29EC619560A0; Wed, 5 Feb 2025 20:10:14 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D44A819560A3; Wed, 5 Feb 2025 20:10:02 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:01 -0500 Subject: [PATCH 05/12] drm/mxsfb: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-5-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=2524; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=utPybh0lyb/JNub60ma7JiaZencmSPaI/Rr5vAWohcI=; b=adA5FmB9OTklNk5cSHry88wdmTnD8d60S03DE6RXmV5gfmSnK5NzvFpsiPJhn+8vuSw0WjKKQ pUZ5RMLArUMAJoKPoPhv9QcWmqnay+kcYFppICKGgs+hGcuYEXsXBut X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 7IoUNg2aUJAUKKWCmAOWaANfU_w158c0WCarnIfhku8_1738786214 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Marek Vasut Cc: Stefan Agner Reviewed-by: Maxime Ripard Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 4 +--- drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 8ee00f59ca821cea8e823e7100fb4d7534283994..fcb2a7517377e9a5bbd2997c578c579b1b079f92 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -134,7 +134,6 @@ static int lcdif_load(struct drm_device *drm) { struct platform_device *pdev = to_platform_device(drm->dev); struct lcdif_drm_private *lcdif; - struct resource *res; int ret; lcdif = devm_kzalloc(&pdev->dev, sizeof(*lcdif), GFP_KERNEL); @@ -144,8 +143,7 @@ static int lcdif_load(struct drm_device *drm) lcdif->drm = drm; drm->dev_private = lcdif; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - lcdif->base = devm_ioremap_resource(drm->dev, res); + lcdif->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(lcdif->base)) return PTR_ERR(lcdif->base); diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index 59020862cf65e5cc488903f1263ed16dfbce06f9..377d4c4c9979ad9538cfec5464827a82936f811b 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -215,7 +215,6 @@ static int mxsfb_load(struct drm_device *drm, { struct platform_device *pdev = to_platform_device(drm->dev); struct mxsfb_drm_private *mxsfb; - struct resource *res; int ret; mxsfb = devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL); @@ -226,8 +225,7 @@ static int mxsfb_load(struct drm_device *drm, drm->dev_private = mxsfb; mxsfb->devdata = devdata; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mxsfb->base = devm_ioremap_resource(drm->dev, res); + mxsfb->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mxsfb->base)) return PTR_ERR(mxsfb->base); From patchwork Wed Feb 5 20:08:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961893 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD206214A82 for ; Wed, 5 Feb 2025 20:10:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786238; cv=none; b=gsqB7vl9dAQL/7yKWG/+bhvMMRllX5R1lYD8WEkgaUsbAMWUeR6FQ3nK6SXq40j55S6JRfhFueCpwFDYGqp+Jx7tQjHg+BEQ98nu0Q9l87zdkopB/vvTBxQ5HNWNL8g+ayBfXljVqZHulmR+Qt5I8Yk/X8GNFO+eBj4aU7qSJhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786238; c=relaxed/simple; bh=xnOKo4d5zLC6SAtMuS91xcrNjPZ1X4hCGtOsaEUix3w=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=e4ReMpznOOBugh/dv8N9TumikDw6OaC8Fleh8bRZg5GBzUQxPukNQGWHRcpuFraDMRkeIPZAOGhnOsmNhxj7Hfrn0qpVNjiy8J82+m8ebmaaGcvC5KYk4xn1rnB+9uH5yNQ0Dw5enPmv/qhcNN7E/o22EFCNK/TRupOBd5Qsca0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dSyuB/4n; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dSyuB/4n" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vTQQyop+FvNGZGa2HymGI+zd4XYA6ac0SZNdQLlY4mQ=; b=dSyuB/4nW4HFjPxu8rcZq3Q+Dofay7EUQeWMeu/c5LhJpjut7FpYxzJto5PC8dP1kLfdfK piqr1QiIzpIscZ5x/Ne+psSX1MUWnDp8NN3F6j0Dq2/TJc9/MzsuXVaLtLqT+DVMBfsz/l HcA9U1/+RxecgGuFdtWlj9ri7wXq7O8= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-m7hdKrGiOj6HXRKp-6DoKQ-1; Wed, 05 Feb 2025 15:10:30 -0500 X-MC-Unique: m7hdKrGiOj6HXRKp-6DoKQ-1 X-Mimecast-MFC-AGG-ID: m7hdKrGiOj6HXRKp-6DoKQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F0A821955F17; Wed, 5 Feb 2025 20:10:24 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7939E19560AB; Wed, 5 Feb 2025 20:10:14 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:02 -0500 Subject: [PATCH 06/12] drm/sprd: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-6-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa , Dmitry Baryshkov X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=2394; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=xnOKo4d5zLC6SAtMuS91xcrNjPZ1X4hCGtOsaEUix3w=; b=9P96dzilm8OCSAOsV3nelE+NyCk6X33PzR8pna80qQpA32qqE1OqIck1bXLiEytFKxbzWi35X rpdS2muAEJCDsCOvfv1Ty24PUjjSatCiBHbA0S8cJP14odIDLpHcX+M X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _le5zDaModVu9QDbe6OihDCPX500s0cUjr4OpNpcpKY_1738786225 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_2@ identifier res; expression ioremap; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource(pdev,0); Cc: Chunyan Zhang Cc: Dmitry Baryshkov Signed-off-by: Anusha Srivatsa Reviewed-by: Maxime Ripard --- drivers/gpu/drm/sprd/sprd_dpu.c | 9 +-------- drivers/gpu/drm/sprd/sprd_dsi.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_dpu.c index cb2816985305fd19eac27413c214681a5a1e9ffa..65cd5aa1634eee5a6735ccffa4ee3979844d92ce 100644 --- a/drivers/gpu/drm/sprd/sprd_dpu.c +++ b/drivers/gpu/drm/sprd/sprd_dpu.c @@ -784,16 +784,9 @@ static int sprd_dpu_context_init(struct sprd_dpu *dpu, { struct platform_device *pdev = to_platform_device(dev); struct dpu_context *ctx = &dpu->ctx; - struct resource *res; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(dev, "failed to get I/O resource\n"); - return -EINVAL; - } - - ctx->base = devm_ioremap(dev, res->start, resource_size(res)); + ctx->base = devm_platform_ioremap_resource(pdev, 0); if (!ctx->base) { dev_err(dev, "failed to map dpu registers\n"); return -EFAULT; diff --git a/drivers/gpu/drm/sprd/sprd_dsi.c b/drivers/gpu/drm/sprd/sprd_dsi.c index 8fc26479bb6bce0aa94914f49d0986a7e19326c1..1668bb4166ab0ad3812c5654244544a9caf249a6 100644 --- a/drivers/gpu/drm/sprd/sprd_dsi.c +++ b/drivers/gpu/drm/sprd/sprd_dsi.c @@ -901,15 +901,8 @@ static int sprd_dsi_context_init(struct sprd_dsi *dsi, { struct platform_device *pdev = to_platform_device(dev); struct dsi_context *ctx = &dsi->ctx; - struct resource *res; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(dev, "failed to get I/O resource\n"); - return -EINVAL; - } - - ctx->base = devm_ioremap(dev, res->start, resource_size(res)); + ctx->base = devm_platform_ioremap_resource(pdev, 0); if (!ctx->base) { drm_err(dsi->drm, "failed to map dsi host registers\n"); return -ENXIO; From patchwork Wed Feb 5 20:08:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961894 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E80A211472 for ; Wed, 5 Feb 2025 20:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786251; cv=none; b=Cr/YJrBIbHnSU6hSXf4rR5l2D8XB0do32CJGQuQ3DA3QOXwdyVovzNsKdnmRs6du5a9uXZnFEmtkO45/5OuN4ieqWHsbPWAhnILOLhw+euJngI/N3sYyEyzDQ2Sj2n+BlWkUVSJXIb1kFul06ZTO4p1Vp7uXTtytnMuzt6Gp42I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786251; c=relaxed/simple; bh=yFglEma1B1UrYHHlLaqVTTuVZsUxBAtaYu9Jp8rfq1E=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=cOgJeKWVZ2TyTM90dpWb3s1uAMtYRTqz0dFrIahscPrIHKSYNeSFdV6XTO9vODtjmA8cxsNcVAnjnB9qwDX7ue8STIdNZ+XG6sCrJmizRq+YzUPH9sfC1Cl3C5ubsHCrdZjm6gBYNgR8LHToaqD4y7DjPSq+amtbX9s0rjLWOjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H63Fs83Y; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H63Fs83Y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5rXNc9RF+BTw1D+Lqt4cYonydXBV4cosBEfjWZVPn/Q=; b=H63Fs83YrLnMWKrevhBpyn/BeR7ItkXxYJkA1aTezbxrpIJegsjivKpbeXp9y2Vd0lMFXG NcnFCZ52Gsvmu2GHeoTLMVnoHb1qvOf9pyYFOeBHfAOZ+5Escc5oeeDdo6hzO5pn/79KV1 UT7+ErvqQE6tL5EwKgZXqWROll88d98= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-LT8Gig9aPou88yIRPZYutQ-1; Wed, 05 Feb 2025 15:10:42 -0500 X-MC-Unique: LT8Gig9aPou88yIRPZYutQ-1 X-Mimecast-MFC-AGG-ID: LT8Gig9aPou88yIRPZYutQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9C0821956046; Wed, 5 Feb 2025 20:10:35 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C0CB19560A3; Wed, 5 Feb 2025 20:10:25 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:03 -0500 Subject: [PATCH 07/12] drm/sti: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-7-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=8138; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=yFglEma1B1UrYHHlLaqVTTuVZsUxBAtaYu9Jp8rfq1E=; b=mAr/l77+MAM0Lk/wltquMSsQ+bAoBfxv2/A9dI4DccZHjP/taolYJP+a25CTaReWEHo2kZvFi CcKo9WqNUGJBrY3/6HPiO1DG3zjUFVNcaw9QNZGyybGqrtBiz9H9SEI X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8g1BDAVyskV2PhEJP9Uv_lUXNb4qMnIMQiQpDhfMBXk_1738786235 X-Mimecast-Originator: redhat.com Replace platform_get_resource/_byname + devm_ioremap with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule@ identifier res; expression ioremap; identifier pdev; constant mem; expression name; @@ -struct resource *res; ... -res = platform_get_resource_byname(pdev,mem,name); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource_byname(pdev,name); and @rule_2@ identifier res; expression ioremap; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource(pdev,0); v2: Fix compilation error. Cc: Raphael Gallais-Pou Cc: Alain Volmat Signed-off-by: Anusha Srivatsa Reviewed-by: Maxime Ripard Acked-by: Raphael Gallais-Pou --- drivers/gpu/drm/sti/sti_compositor.c | 10 +--------- drivers/gpu/drm/sti/sti_dvo.c | 10 +--------- drivers/gpu/drm/sti/sti_hda.c | 9 +-------- drivers/gpu/drm/sti/sti_hdmi.c | 11 +---------- drivers/gpu/drm/sti/sti_hqvdp.c | 10 +--------- drivers/gpu/drm/sti/sti_tvout.c | 10 +--------- drivers/gpu/drm/sti/sti_vtg.c | 10 +--------- 7 files changed, 7 insertions(+), 63 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c index 063f82d23d80c4ba83624a0066a18416a2b37351..7aefce6706ba2cd7d97a33228c9b9812edecf06f 100644 --- a/drivers/gpu/drm/sti/sti_compositor.c +++ b/drivers/gpu/drm/sti/sti_compositor.c @@ -177,7 +177,6 @@ static int sti_compositor_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct device_node *vtg_np; struct sti_compositor *compo; - struct resource *res; unsigned int i; compo = devm_kzalloc(dev, sizeof(*compo), GFP_KERNEL); @@ -194,14 +193,7 @@ static int sti_compositor_probe(struct platform_device *pdev) memcpy(&compo->data, of_match_node(compositor_of_match, np)->data, sizeof(struct sti_compositor_data)); - - /* Get Memory ressources */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res == NULL) { - DRM_ERROR("Get memory resource failed\n"); - return -ENXIO; - } - compo->regs = devm_ioremap(dev, res->start, resource_size(res)); + compo->regs = devm_platform_ioremap_resource(pdev, 0); if (compo->regs == NULL) { DRM_ERROR("Register mapping failed\n"); return -ENXIO; diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index c6c2abaa1891cd3ea025805b50d275ec314512c3..660588f01f90950a9b2c180ab230188c19901f26 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c @@ -511,7 +511,6 @@ static int sti_dvo_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct sti_dvo *dvo; - struct resource *res; struct device_node *np = dev->of_node; DRM_INFO("%s\n", __func__); @@ -523,14 +522,7 @@ static int sti_dvo_probe(struct platform_device *pdev) } dvo->dev = pdev->dev; - - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dvo-reg"); - if (!res) { - DRM_ERROR("Invalid dvo resource\n"); - return -ENOMEM; - } - dvo->regs = devm_ioremap(dev, res->start, - resource_size(res)); + dvo->regs = devm_platform_ioremap_resource_byname(pdev, "dvo-reg"); if (!dvo->regs) return -ENOMEM; diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index b12863bea95559c4f874eb94cea8938609d435d4..0b5dbaf4d5305989846e25a1cab6f82d191aa9a5 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -750,14 +750,7 @@ static int sti_hda_probe(struct platform_device *pdev) return -ENOMEM; hda->dev = pdev->dev; - - /* Get resources */ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hda-reg"); - if (!res) { - DRM_ERROR("Invalid hda resource\n"); - return -ENOMEM; - } - hda->regs = devm_ioremap(dev, res->start, resource_size(res)); + hda->regs = devm_platform_ioremap_resource_byname(pdev, "hda-reg"); if (!hda->regs) return -ENOMEM; diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index ca2fe17de4a5d1e0199e59a97e6c7601e139ed9e..666143c48b0d0f2c20cd26323ddbc8e69d966622 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1380,7 +1380,6 @@ static int sti_hdmi_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct sti_hdmi *hdmi; struct device_node *np = dev->of_node; - struct resource *res; struct device_node *ddc; int ret; @@ -1399,15 +1398,7 @@ static int sti_hdmi_probe(struct platform_device *pdev) } hdmi->dev = pdev->dev; - - /* Get resources */ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi-reg"); - if (!res) { - DRM_ERROR("Invalid hdmi resource\n"); - ret = -ENOMEM; - goto release_adapter; - } - hdmi->regs = devm_ioremap(dev, res->start, resource_size(res)); + hdmi->regs = devm_platform_ioremap_resource_byname(pdev, "hdmi-reg"); if (!hdmi->regs) { ret = -ENOMEM; goto release_adapter; diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 0f658709c9d0d398c4eed65202443db9d0b41f8c..420395598d119a403d531211022e6005d6a2bd59 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1356,7 +1356,6 @@ static int sti_hqvdp_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *vtg_np; struct sti_hqvdp *hqvdp; - struct resource *res; DRM_DEBUG_DRIVER("\n"); @@ -1367,14 +1366,7 @@ static int sti_hqvdp_probe(struct platform_device *pdev) } hqvdp->dev = dev; - - /* Get Memory resources */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - DRM_ERROR("Get memory resource failed\n"); - return -ENXIO; - } - hqvdp->regs = devm_ioremap(dev, res->start, resource_size(res)); + hqvdp->regs = devm_platform_ioremap_resource(pdev, 0); if (!hqvdp->regs) { DRM_ERROR("Register mapping failed\n"); return -ENXIO; diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index af6c06f448c4819def8cc0d0836e30f991529690..0bebe815f5e7567f84388af93723a6fa7d2cc7a2 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -838,7 +838,6 @@ static int sti_tvout_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; struct sti_tvout *tvout; - struct resource *res; DRM_INFO("%s\n", __func__); @@ -850,14 +849,7 @@ static int sti_tvout_probe(struct platform_device *pdev) return -ENOMEM; tvout->dev = dev; - - /* get memory resources */ - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tvout-reg"); - if (!res) { - DRM_ERROR("Invalid glue resource\n"); - return -ENOMEM; - } - tvout->regs = devm_ioremap(dev, res->start, resource_size(res)); + tvout->regs = devm_platform_ioremap_resource_byname(pdev, "tvout-reg"); if (!tvout->regs) return -ENOMEM; diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c index 5ba469b711b5318e9e9e6d8df127fb8933d1fac1..b5353fe774d72fd629ecd3ef75a5d2817ca8617f 100644 --- a/drivers/gpu/drm/sti/sti_vtg.c +++ b/drivers/gpu/drm/sti/sti_vtg.c @@ -380,20 +380,12 @@ static int vtg_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct sti_vtg *vtg; - struct resource *res; int ret; vtg = devm_kzalloc(dev, sizeof(*vtg), GFP_KERNEL); if (!vtg) return -ENOMEM; - - /* Get Memory ressources */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - DRM_ERROR("Get memory resource failed\n"); - return -ENOMEM; - } - vtg->regs = devm_ioremap(dev, res->start, resource_size(res)); + vtg->regs = devm_platform_ioremap_resource(pdev, 0); if (!vtg->regs) { DRM_ERROR("failed to remap I/O memory\n"); return -ENOMEM; From patchwork Wed Feb 5 20:08:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961895 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB82A21CA0F for ; Wed, 5 Feb 2025 20:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786258; cv=none; b=bdtH12WRRsmCLYiW4NWF5dZHubNFAa3GL2Ihcfo/XcP6tNoXuIQz8PKNcRF2+BRF9OU21Ck0ZqlHBGT7dDf1prPxWKEKaaK27JYQnwXOhBLmrT/RafrXISYHA1lH7prThnSnqgpFRF+u2EhfDMugD8wLnMirMX0QIzwdTTytc34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786258; c=relaxed/simple; bh=Ic1nlkPD6Mj8TJZ8m8wZ6mlAKj2uSChvdOZ/TLjamAU=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=S+jvTh1sKoYs9U7u1xSncBpjuMcv/JTcSoFG4yH4ZylbF4N/5cRscX9JDGFcWGQFXrVhdPSulbKJlBDsosdiNNG9yhVWtB0armzyKfhDZf8bCM84t4uyXBNIn5U04TevSaYYXhgRoOaDrjbUP0jXTWcYElawwv+NUvfsgVu6U9M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=UiDmmwUp; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UiDmmwUp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t4JTcbNp+Wagg2SIneI8fYXiMNdF7Wii2BuVH7MOT/o=; b=UiDmmwUp44fnH16csVExDfNKDVZGuktElvSf+B7rA3kw6POyDqbJi2a3q75vjLVTGFmMZ/ eIFM1PcjJlGyIKqkxblBN/MdAwe7t7uNH1Vy6DJ0qxf9HajNwa1hvhb9y0Dlu7jcBPZYXo iJYVs5cUv0S+8BpF09/IxkDMO1VD8ME= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-J9TRc9eAOW-bR9FCGXQN-w-1; Wed, 05 Feb 2025 15:10:51 -0500 X-MC-Unique: J9TRc9eAOW-bR9FCGXQN-w-1 X-Mimecast-MFC-AGG-ID: J9TRc9eAOW-bR9FCGXQN-w Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4FEF219560B9; Wed, 5 Feb 2025 20:10:46 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EAE6519560A3; Wed, 5 Feb 2025 20:10:35 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:04 -0500 Subject: [PATCH 08/12] drm/stm: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-8-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1618; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=Ic1nlkPD6Mj8TJZ8m8wZ6mlAKj2uSChvdOZ/TLjamAU=; b=adLjfrtU6tC9pfV0EExepCHd/cHlwcDiR8sbt1XjWIwBum8LAHOiRxCD/EMVGcFQQXziRnb29 x8JlJrZjb8PAYAdaE1cgkvNZAkDkmELMURVlIvw+29XV+XY1nLcY9NG X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: HP9KJWW3-TfkUFUVvvSF64nR0YkVSTJE4fYZoWwf_3U_1738786246 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Yannick Fertre Cc: Raphael Gallais-Pou Cc: Philippe Cornu Acked-by: Raphaël Gallais-Pou Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/stm/ltdc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index 54a73753eff98902012c6012914fa8c6482affbd..ba315c66a04d72758b9d3cfcd842432877f66d3a 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -1900,7 +1900,6 @@ int ltdc_load(struct drm_device *ddev) struct drm_panel *panel; struct drm_crtc *crtc; struct reset_control *rstc; - struct resource *res; int irq, i, nb_endpoints; int ret = -ENODEV; @@ -1966,8 +1965,7 @@ int ltdc_load(struct drm_device *ddev) reset_control_deassert(rstc); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ldev->regs = devm_ioremap_resource(dev, res); + ldev->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ldev->regs)) { DRM_ERROR("Unable to get ltdc registers\n"); ret = PTR_ERR(ldev->regs); From patchwork Wed Feb 5 20:08:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961896 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A17EF22068D for ; Wed, 5 Feb 2025 20:11:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786272; cv=none; b=agcSq+HbaIwkTCUz2FFwEX5NNRpfQ4AHWrA2lbhP/i9andGv0ObqqPzrFUBJo0xmQLzTMaxBosw+eD9D15aGQvapMtn94AMkqVJEvuBCXX84hKA40/UYDy4tjdx6+VOytzIEzgYGlxOmEdrYctUpHjvB4bSxk3mXGiHiMD8FQMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786272; c=relaxed/simple; bh=66gfH4HaVcJzuzQX0NHIOkeT0eso2EOo8AHIoNrPiQ8=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=Tka0dWTvQbgwjLQMnOtFCExaUixLsbGrjKRSWgi+qaOqXlOrcjGWb4Gs5phQ67lcpaBmg9qKYwHtAmRKMPB5lewuAsPeKHkj0NIremDVgqoCpQf+ZDgXBPoAQbfAA1v+WnokY5dss8faPdFKvcOyh+ATVju64hsJA1q7obIi1Lc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H+4pqROW; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H+4pqROW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WV3CUjfdiDqmiVITg/ki0rg01TIBSPaLDwHXu/1B6+E=; b=H+4pqROWvrYCh2BQwhY/hSJCxLlLTfJtuTr64pO1u6+RKAcgWcUu9bamzLt+nCu5cKArwA GGrz8y/NOW8XrteVo+Tv1U26oYEb47jmVinaaVoTT29z4Ud1vPS3MTPT1RI04JhvzZmEM2 8A7mUR5M0zsQQDaZ0znwh1qWCrBZ0tM= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-V8OTbI5dNI6szj-0skYMAQ-1; Wed, 05 Feb 2025 15:11:02 -0500 X-MC-Unique: V8OTbI5dNI6szj-0skYMAQ-1 X-Mimecast-MFC-AGG-ID: V8OTbI5dNI6szj-0skYMAQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2D14319560AF; Wed, 5 Feb 2025 20:10:57 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A058B19560A3; Wed, 5 Feb 2025 20:10:46 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:05 -0500 Subject: [PATCH 09/12] drm/tegra: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-9-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1560; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=66gfH4HaVcJzuzQX0NHIOkeT0eso2EOo8AHIoNrPiQ8=; b=M6WZh0GtYS5B4deJ9B3qzO3qNws7WyKrJNpqYJygKF9Hd54wmE5lZ9VrSBMuunB4vSfrq/v+B aoMAifGb953DS/z3pxTMJycEfckOvMXSVVatw6+5DoXKTwZ0HpUpzbU X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: BjcCzdj-ev0O-KJmao8XTBxUGqbsBSn658aCM0_nD-U_1738786257 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Thierry Reding Cc: Mikko Perttunen Reviewed-by: Maxime Ripard Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/tegra/dsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 4a8cd9ed0a9414b2f40b716fa8c02aff038a53e0..51f1ed897f8e473f45f89ff3e2d99f66d2c80f21 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -1564,7 +1564,6 @@ static int tegra_dsi_ganged_probe(struct tegra_dsi *dsi) static int tegra_dsi_probe(struct platform_device *pdev) { struct tegra_dsi *dsi; - struct resource *regs; int err; dsi = devm_kzalloc(&pdev->dev, sizeof(*dsi), GFP_KERNEL); @@ -1636,8 +1635,7 @@ static int tegra_dsi_probe(struct platform_device *pdev) goto remove; } - regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - dsi->regs = devm_ioremap_resource(&pdev->dev, regs); + dsi->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dsi->regs)) { err = PTR_ERR(dsi->regs); goto remove; From patchwork Wed Feb 5 20:08:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961897 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B386A2206B7 for ; Wed, 5 Feb 2025 20:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786282; cv=none; b=gz/KuBp9c8UzfnqwYZLThz4kcPtWk8f9Vkk0iMzyqPHDSak2jfuquBBUC/8tCBefDMVYavywU6UV1Ez57wJVwioZ9OOF0BdOZ+viCbGbHraF7BdW/oSYUWKE6kaGh33bP8fHEcoDnKm+jH+3ZkUYFq9mJn3jYPUQG07JDwg8arE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786282; c=relaxed/simple; bh=7+Q2lsuHInmFMU6F4dj3qB4yNCyOo0pZ9W9kufCkjVw=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=m3fP4Mk4fL7FAf1ogRsSF5oRH1gQxoX8llgKY9nfZCroz9oiMc+GOY2+sAyvrAfHwuPC8mPKevwdKr9l0Z+9fD1dw8XJrqhC3JYG0jhod9NWgVByS53GBxoqy202F3IVeScLrlzRe5Dk4eAtReVcLVGjkLjTcN0tYKGq5PNeGcg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=GVyBJVl+; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GVyBJVl+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SZeGtn73Y88CUfVnHvmhJXIyAiaLqqpqwADZqySX09U=; b=GVyBJVl+q86NnO950iuQTk9FFL/SZmpf1Wbu8wNU1yshwe7yNBWRVR1FYlsGaRzdBzQhhv 8NBPZoVkITdJVU1ahIjRKD30p7vLEssE+LnnMc1GL8AwS+PamkBEenQgyQlOnxAEUSBdaC SR7uSJNOBVOWYWZ78l55SR3x0GQ56bM= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-XrLRZbIRMpab2n-xkqm89A-1; Wed, 05 Feb 2025 15:11:15 -0500 X-MC-Unique: XrLRZbIRMpab2n-xkqm89A-1 X-Mimecast-MFC-AGG-ID: XrLRZbIRMpab2n-xkqm89A Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B45771800268; Wed, 5 Feb 2025 20:11:07 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7C50519560A3; Wed, 5 Feb 2025 20:10:57 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:06 -0500 Subject: [PATCH 10/12] drm/tiny: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-10-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1744; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=7+Q2lsuHInmFMU6F4dj3qB4yNCyOo0pZ9W9kufCkjVw=; b=760bfuqeQwB2H7jkE4dYuBDK73EXGEZNFWeKXn1Of96MzG/gKvOtfpspbFSJECAZcDlGGB/p8 CY4DM7EBirEA1qRG0o0TqcMkXSTVS6lZYO5NB4/ZPvsibEJrpSbIKQu X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: rzIgp5j1G4vGsdJSuh3badDMP-Px-t1w07A-S9oriks_1738786268 X-Mimecast-Originator: redhat.com Replace platform_get_resource + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: @rule_1@ identifier res; expression ioremap_res; identifier pdev; @@ -struct resource *res; ... -res = platform_get_resource(pdev,...); -ioremap_res = devm_ioremap_resource(...); +ioremap_res = devm_platform_ioremap_resource(pdev,0); Cc: Maarten Lankhorst Cc: Maxime Ripard Reviewed-by: Maxime Ripard Acked-by: Alexey Brodkin Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/tiny/arcpgu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 2748d1f21d8697275047886865a5518792a4dd7c..7cf0f0ea1bfe4fa82234a120b52837e26a8ee5b0 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -253,7 +253,6 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu) struct device_node *encoder_node = NULL, *endpoint_node = NULL; struct drm_connector *connector = NULL; struct drm_device *drm = &arcpgu->drm; - struct resource *res; int ret; arcpgu->clk = devm_clk_get(drm->dev, "pxlclk"); @@ -270,8 +269,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu) drm->mode_config.max_height = 1080; drm->mode_config.funcs = &arcpgu_drm_modecfg_funcs; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - arcpgu->regs = devm_ioremap_resource(&pdev->dev, res); + arcpgu->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(arcpgu->regs)) return PTR_ERR(arcpgu->regs); From patchwork Wed Feb 5 20:08:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961898 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 540C021519B for ; Wed, 5 Feb 2025 20:11:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786289; cv=none; b=qpxkTxb9tGowZtJhqBmxhH7yREZorQJSOeqzS/0Ic6OZX7j7y10LfvQLevX38fNC758J3kSplUGntdb8jTf94S27TAUnQ5VbdysRg6qLiGHOxPJCCmakrbMohwHFaFSw4YM6CIHsbPLqlWYcTWqsYsZguKOuPAK2Oc80Nin3Ico= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786289; c=relaxed/simple; bh=cGR+PxRoxuebICENqHulDwycMVIkKhLPFIEGSESALX8=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=YnCI2oP9NDEOyp5AfABPKNJU2LfRGIusa0pfN/EucTS95zQdiaP7tbqPJ+RevE3YKTqxcJxXmVlP1Kb/UZLZplLbp6TGcnAh+Zi9Lt2dq3NiBIy9bNNf8v7S+8N6QTaEKeOoshhqfquMFZZ3o4kQjm57F6DhiYaoXgYD8y/miTs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BiAA5b6t; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BiAA5b6t" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8SyjCwbf1S+bcTHNMqbzrT6yhS3x+rdZOVYONTdbbck=; b=BiAA5b6thsUTN+vyIt0jNkIJcNs6JnCU30GYbRkdSa0NNDQdkPCPKX0VWX7beRdNBFHWAe /9+ZOe+sV3PdFh8SdQdC8pjLLVIkEsmgF/GuJuSZ2SP6U7/bxbijFb64Fw0kglcKiTwbTx YYlyc7g2F9iH6nJhJyCfpLJdaRen6+A= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-d9E0y7o3NraGgHUbSgJsdA-1; Wed, 05 Feb 2025 15:11:24 -0500 X-MC-Unique: d9E0y7o3NraGgHUbSgJsdA-1 X-Mimecast-MFC-AGG-ID: d9E0y7o3NraGgHUbSgJsdA Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 698681955F3F; Wed, 5 Feb 2025 20:11:18 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 101D519560A3; Wed, 5 Feb 2025 20:11:07 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:07 -0500 Subject: [PATCH 11/12] drm/vc4: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-11-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=4051; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=cGR+PxRoxuebICENqHulDwycMVIkKhLPFIEGSESALX8=; b=xxdVwBWLuMEiypVjDD+SjdlJr+E3FmnnKe4+6mwyq3Jsp3b2JeAXfuUeFeYrD9tkleRyn4M2I gZ+0ny1k2KkDDtUMVDgoa4/Gelwzs4xPuw9i9ORgjvf4Shdft9gP0bC X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: yt0NnYNwyThgCrFvhX7FABCJ2IDNp6gVGT-eNvigGHA_1738786278 X-Mimecast-Originator: redhat.com Replace platform_get_resource_byname + devm_ioremap_resource with just devm_platform_ioremap_resource() Used Coccinelle to do this change. SmPl patch: //rule s/(devm_)platform_get_resource_byname + //(devm_)ioremap/devm_platform_ioremap_resource. @rule_3@ identifier res; expression ioremap; identifier pdev; constant mem; expression name; @@ -struct resource *res; <+... -res = platform_get_resource_byname(pdev,mem,name); <... -if (!res) { -... -} ...> -ioremap = devm_ioremap(...); +ioremap = devm_platform_ioremap_resource_byname(pdev,name); ...+> v2: Change the SmPl patch to work on multiple occurences of the pattern. This also fixes the compilation error. Cc: Maxime Ripard Cc: Dave Stevenson Cc: Maíra Canal Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/vc4/vc4_hdmi.c | 55 +++++++++++------------------------------- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 47d9ada98430634cfd8c1e21c2a4d00d501bab7e..066f1246dab420ee889845b0c573d80ce7c88595 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2951,71 +2951,44 @@ static int vc5_hdmi_init_resources(struct drm_device *drm, { struct platform_device *pdev = vc4_hdmi->pdev; struct device *dev = &pdev->dev; - struct resource *res; int ret; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi"); - if (!res) - return -ENODEV; - - vc4_hdmi->hdmicore_regs = devm_ioremap(dev, res->start, - resource_size(res)); + vc4_hdmi->hdmicore_regs = devm_platform_ioremap_resource_byname(pdev, + "hdmi"); if (!vc4_hdmi->hdmicore_regs) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hd"); - if (!res) - return -ENODEV; - - vc4_hdmi->hd_regs = devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->hd_regs = devm_platform_ioremap_resource_byname(pdev, "hd"); if (!vc4_hdmi->hd_regs) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cec"); - if (!res) - return -ENODEV; - - vc4_hdmi->cec_regs = devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->cec_regs = devm_platform_ioremap_resource_byname(pdev, + "cec"); if (!vc4_hdmi->cec_regs) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "csc"); - if (!res) - return -ENODEV; - - vc4_hdmi->csc_regs = devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->csc_regs = devm_platform_ioremap_resource_byname(pdev, + "csc"); if (!vc4_hdmi->csc_regs) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dvp"); - if (!res) - return -ENODEV; - - vc4_hdmi->dvp_regs = devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->dvp_regs = devm_platform_ioremap_resource_byname(pdev, + "dvp"); if (!vc4_hdmi->dvp_regs) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy"); - if (!res) - return -ENODEV; + vc4_hdmi->phy_regs = devm_platform_ioremap_resource_byname(pdev, + "phy"); - vc4_hdmi->phy_regs = devm_ioremap(dev, res->start, resource_size(res)); if (!vc4_hdmi->phy_regs) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "packet"); - if (!res) - return -ENODEV; - - vc4_hdmi->ram_regs = devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->ram_regs = devm_platform_ioremap_resource_byname(pdev, + "packet"); if (!vc4_hdmi->ram_regs) return -ENOMEM; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rm"); - if (!res) - return -ENODEV; - - vc4_hdmi->rm_regs = devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->rm_regs = devm_platform_ioremap_resource_byname(pdev, "rm"); if (!vc4_hdmi->rm_regs) return -ENOMEM; From patchwork Wed Feb 5 20:08:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 13961899 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC84F213E7A for ; Wed, 5 Feb 2025 20:11:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786300; cv=none; b=cebEPxTEcpqCwOqWF6fAL49FsGO2sjkkPN1gQrieYzHZ8uC2OQUDRrQYVrXtAOOJx6bb5ideW94b0Ebolbfg4LOk6wR+x71krfITizxLf+MqTo9ne8FgOeyDwRKN+WpJduQ4+6J/xni9zPRjam0/IawgyRb7Pk7rZee5O/xkLWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786300; c=relaxed/simple; bh=8E/zDOS2y2jXYtpxt4v/XPpri1L2d3Hp1icGGz6XyLc=; h=From:Date:Subject:MIME-Version:Message-Id:References:In-Reply-To: To:Cc:Content-Type; b=MzEe9LEj2OqGK2ls8Fb5Trt7F/f5JjTZLs+feOTUxaRy93RdDOirZ9q+UG+sy3mg/QMtxrfXHxL48ylLGttgwRqo3J8ZDsSLCT7Fj3KtlCpp0u0TQUYgRy4zMQhRgGZZqL4MNv13vdEiXpnGPLHheZtLl0QYaWUOa+clKfMGazk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=bvR+jL3T; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bvR+jL3T" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZN6lOxdYMjUO49jm3bB80agqHnejl+uLnWAidVCm81Y=; b=bvR+jL3TD96NzqJmDt7WDWuZum9wumQiW6+NvP9T9MlmHqventyBpYwCFwcxkORnLKpBKz a704TGzExiWWEp+dPQeDCTlNCK37lfynyG61z6Fg1gR/CjulqUsDOITYUlcRYykhYF4p+L /pdw6ZGW4cF/jwO1W6dK3yKcmHR6l7Y= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-564-VivRk6b0MMGXZMwAVSQiaA-1; Wed, 05 Feb 2025 15:11:35 -0500 X-MC-Unique: VivRk6b0MMGXZMwAVSQiaA-1 X-Mimecast-MFC-AGG-ID: VivRk6b0MMGXZMwAVSQiaA Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BA2681801A18; Wed, 5 Feb 2025 20:11:28 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 760DD19560AB; Wed, 5 Feb 2025 20:11:18 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:08 -0500 Subject: [PATCH 12/12] Documentation: Update the todo Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250205-mem-cocci-newapi-v1-12-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_Cana?= =?utf-8?q?l?= , Raspberry Pi Kernel Maintenance , Jonathan Corbet Cc: linux-aspeed@lists.ozlabs.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, imx@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1470; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=8E/zDOS2y2jXYtpxt4v/XPpri1L2d3Hp1icGGz6XyLc=; b=kvdtINpTCFoOpfqXf/fVrI+PlDBH109lqvGOt8aqdxgPNRLHbndphfZbHS68h26FBvlE/Lev1 rwTEVkvxYkZBkVPbSaO6vTBgPPPOtlnOVyP8CR4ue3yQ+gZM3xTUog2 X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 5lRKV-U8kBFqvswHfA1R5h-OzKDlK3oe1xJ1rBR8EV4_1738786288 X-Mimecast-Originator: redhat.com Update the Documentation to be more precise. v2: Update for clarity Cc: Thomas Zimmermann Signed-off-by: Anusha Srivatsa --- Documentation/gpu/todo.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 256d0d1cb2164bd94f9b610a751b907834d96a21..03fcd086889acbd1294669b260292ffc79e97e2f 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -441,13 +441,13 @@ Contact: Thomas Zimmermann Level: Intermediate -Request memory regions in all drivers -------------------------------------- +Request memory regions in all fbdev drivers +-------------------------------------------- -Go through all drivers and add code to request the memory regions that the -driver uses. This requires adding calls to request_mem_region(), -pci_request_region() or similar functions. Use helpers for managed cleanup -where possible. +Old/ancient fbdev drivers do not request their memory properly. +Go through these drivers and add code to request the memory regions that the +driver uses. Problematic areas include hardware that has exclusive ranges like +VGA. VGA16fb does not request the range as it is expected. Drivers are pretty bad at doing this and there used to be conflicts among DRM and fbdev drivers. Still, it's the correct thing to do.