From nobody Thu Dec 18 08:09:15 2025 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 97A6B2753FA for ; Fri, 14 Feb 2025 00:19: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=1739492393; cv=none; b=VlEP9JsW+J0pIHlOluyBy88cjiJsHnRfTEhYEnEXkACZWIQoH9oZsQNhYDwHtjRjcXzGVQdL1DmIp4laKRtK+jR2ed8WU6VesweD5DNCZL0jEDb2r2NUD42rEijQ2lNo/nkC5KxYVVhDW+g4cVcuiaYzhWNPY7NwStudC735fRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492393; c=relaxed/simple; bh=EiZLkZhOyAW9xsLWltUT3PNY16MrDfjY5hC7dVEFLOM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IwLAEbTTp40zDSFExjhtiRLEnF+439hP3pNIzjX6eKXs5yWx8qNABaxoskquZ5PTzJaKz1doAOElSsN3bLWI7rjV1hQm+6pUJimST7G+48SLMQLnBTq9Cg7Avr1pcNU3FpQT6yS7a2+snv5jwwQwSVqtOhYZEnLXFBYg5/LKXh8= 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=VYdpPoTg; 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="VYdpPoTg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492390; 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=VYdpPoTgZtp2RX0c4jbgr36FOrS9wocRnV60+SXBfOe+AcfmY4zF2Uf4NziTwTTzrSSrsp 9Uy+zUtFTnnenZ1XPKFUzXqSG5bhe9ck0SgJqlQlDFBJZZdcD6eRluqFwpcZJyQwDO+S5U iqSiqsi5amaoJU5qhCITomuCIAAJBg4= Received: from mx-prod-mc-01.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-25-qyFZAa5UMMal7J8JWdPi0Q-1; Thu, 13 Feb 2025 19:19:48 -0500 X-MC-Unique: qyFZAa5UMMal7J8JWdPi0Q-1 X-Mimecast-MFC-AGG-ID: qyFZAa5UMMal7J8JWdPi0Q_1739492383 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 730FD1975AFC; Fri, 14 Feb 2025 00:19:42 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BE8E6191D7C9; Fri, 14 Feb 2025 00:19:30 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:14 -0500 Subject: [PATCH 01/12] drm/aspeed: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-1-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=1480; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=EiZLkZhOyAW9xsLWltUT3PNY16MrDfjY5hC7dVEFLOM=; b=IZhFM41JiOZfIy9a/1KZpKk1Br3XnDxb5m/NX2S1O6K2UXCQ+/uQJ0C22bHSxvWhNzlnX/FP1 wm9WGalQDOsAXERwNbai1KRsziDODOZ0OJOzdnU3hgZxX3mEGZvDUFs X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D 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/aspe= ed/aspeed_gfx_drv.c index 397e677a691c2c6d199063f44358196a4569b389..46094cca297479d1cf19f6db995= 38c5e7a0fec92 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 =3D to_aspeed_gfx(drm); struct device_node *np =3D pdev->dev.of_node; const struct aspeed_gfx_config *config; - struct resource *res; int ret; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base =3D devm_ioremap_resource(drm->dev, res); + priv->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) return PTR_ERR(priv->base); =20 --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 E698115D1 for ; Fri, 14 Feb 2025 00:20:02 +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=1739492404; cv=none; b=uD/gKtJx33vNRj+V17U1KIG/2+PmVcuBI3kTtTZ2e3v0EsDCyb/37Rn6x+0gnQ0/TkVWvqYdOz1KvWXsN/QuRqzbwPGUvPxeb4rnOPjB8hcvhDbm+lwoNK+r7ji/Lh9IylzEPPAY6l/55RexqSpYcvCq+xCivBDzAwHk2ug6pzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492404; c=relaxed/simple; bh=8Mr23W/+G1uZ617GLarMPiY6eX2ezkHI6A58kZ43cp4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XdD/MtZs3rSsJHk+D0/YUh+WBJVJcmHt9sZ1qvas6ibNnXEMtsivV+LNJfSroUPWzu4zWUmwMWdO6VHi8ZXixCoWowy81x21JOe+5Zzv+TJK1nBAIe8Lx2p3+mSHWuHbs8R2AnZKG33YC87uluLIXpLJqH6G+FyqIBpKbzH/CFg= 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=EDoLko4N; 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="EDoLko4N" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492402; 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=EDoLko4NCMMY9GxiJMakMXUOaW3btdzNxHelSl1gzqts9e1HewrX7dQZbEw6HMln46yuxO gHYOYBOU99Anz815E7ogkS2nYT5YHwPS//gYFbcZI3wNd3GTZ12B3DPCO8wA+a95agBMGI 4paeXSLT0M12sMREULNlKEHFu2XaDoc= 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-93-_ZGgu7BcNVOmNPp1z6MqOA-1; Thu, 13 Feb 2025 19:20:00 -0500 X-MC-Unique: _ZGgu7BcNVOmNPp1z6MqOA-1 X-Mimecast-MFC-AGG-ID: _ZGgu7BcNVOmNPp1z6MqOA_1739492395 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 DCF971800373; Fri, 14 Feb 2025 00:19:52 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C0CE119373C4; Fri, 14 Feb 2025 00:19:42 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:15 -0500 Subject: [PATCH 02/12] drm/fsl-dcu: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-2-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=1621; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=8Mr23W/+G1uZ617GLarMPiY6eX2ezkHI6A58kZ43cp4=; b=n2tNXdlh5rQHn34kimaBoWcVbHfFakTA8EXZqZAZhLnnn5o28ZQNlIJVeAszxG7oq2QBVHOzI cKIyaYzxeTMCIHXWgXlkHwumd9YBsNaQmbk5wnP4D2uSBSOGUG55dCT X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D 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/fs= l-dcu/fsl_dcu_drm_drv.c index 03b076db9381a5db0bff6576cda2772495a61fed..3bbfc1b56a6557e2f54d2b7ed09= 9531053871341 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 *pd= ev) struct fsl_dcu_drm_device *fsl_dev; struct drm_device *drm; struct device *dev =3D &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 *pd= ev) return -ENODEV; fsl_dev->soc =3D id->data; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - base =3D devm_ioremap_resource(dev, res); + base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base)) { ret =3D PTR_ERR(base); return ret; --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 6D6469443 for ; Fri, 14 Feb 2025 00:20:13 +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=1739492415; cv=none; b=J5Xn4bWIytVBHeXZKcM+W1Du35Bim7YcfQINbWd+q7MU1pIfMzpR4xSVnkO9mR3r4BgW66VsqjWuoXZvzepZ4N64Xh8C0fw6wJWqeSKXHTecb+hpEWLo0YBIKFxNWieNTke7HZBoE3QBlm5EhvMfhcN1ndGMmM+nIrnrb49bfrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492415; c=relaxed/simple; bh=DSpX8fD4B4V0ccw0v0OQXmxnb/T74xXl9np96mYbmE0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MP2sROh8U3ltfaidgoJBVYHT5j4Je0zrfqJ1Q2M0k6rgU7fev/VyLRgFqd6oMthFhX2qYbqINFKSMZHuNKYLygWEQbzBM8onYveZoQsAs8d5LrbiKI8pe60YS9R31ECJByFLYT2+Dm58Q1U2HyPhkjqBVaVOzUSxc4epmoC3hUQ= 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=BECu3Y3y; 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="BECu3Y3y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492412; 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=BECu3Y3yEZ+lTAQDbYH8DS61dcU5fqR37wZJRnd0Rrz9z1wheekQT335te63KISM3ml47A fSPy88sJpZAoDns/8ee7uU5HeTOjriDHDFYoBy+WhD06AtXzZLgAhuP+FfqtxeBM5WMdFV WAbrnufWIltsA7KPNM0xONdqvIZbfzk= Received: from mx-prod-mc-01.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-42-adRffBjJPJOwTG679Vz7Hw-1; Thu, 13 Feb 2025 19:20:10 -0500 X-MC-Unique: adRffBjJPJOwTG679Vz7Hw-1 X-Mimecast-MFC-AGG-ID: adRffBjJPJOwTG679Vz7Hw_1739492405 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DF6CA19783B8; Fri, 14 Feb 2025 00:20:03 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 34562191D7CE; Fri, 14 Feb 2025 00:19:53 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:16 -0500 Subject: [PATCH 03/12] drm/hisilicon: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-3-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=2968; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=DSpX8fD4B4V0ccw0v0OQXmxnb/T74xXl9np96mYbmE0=; b=XeEsNqyfA9ph8vujG/SYSA/ugXnVAXluHm5R0cxMTvcCG2JQ02EZm1ZlF0o/2mnNws7N3MeCY ceSS+MCY0a+AHpsz+gD1NylpHz6VWTCwcuN3cqy3DFJOhDJX7M3pjY8 X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D 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..e80debdc41763357cb2cf321205= c0dfac80a911e 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 =3D { static int dsi_parse_dt(struct platform_device *pdev, struct dw_dsi *dsi) { struct dsi_hw_ctx *ctx =3D dsi->ctx; - struct resource *res; =20 ctx->pclk =3D devm_clk_get(&pdev->dev, "pclk"); if (IS_ERR(ctx->pclk)) { @@ -833,8 +832,7 @@ static int dsi_parse_dt(struct platform_device *pdev, s= truct dw_dsi *dsi) return PTR_ERR(ctx->pclk); } =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - ctx->base =3D devm_ioremap_resource(&pdev->dev, res); + ctx->base =3D 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..45c4eb008ad5d639340f769ad02= 2d186ec454722 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 =3D { static void *ade_hw_ctx_alloc(struct platform_device *pdev, struct drm_crtc *crtc) { - struct resource *res; struct device *dev =3D &pdev->dev; struct device_node *np =3D pdev->dev.of_node; struct ade_hw_ctx *ctx =3D NULL; @@ -856,8 +855,7 @@ static void *ade_hw_ctx_alloc(struct platform_device *p= dev, return ERR_PTR(-ENOMEM); } =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - ctx->base =3D devm_ioremap_resource(dev, res); + ctx->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ctx->base)) { DRM_ERROR("failed to remap ade io base\n"); return ERR_PTR(-EIO); --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 DE6E115D1 for ; Fri, 14 Feb 2025 00:20:18 +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=1739492420; cv=none; b=lt5mH/ST99JIsVioK5KSYKPFgV/T73XSTIyXX/68HcXxWvhv+QwO3gBabWpckvHc0WGdIUl7erB20i33f9tOguWujNnp/NXJQlTRRdZxJJNUlFKYBI+86BmX022ZCD5gKPS4SKOI3GWUVBcghyZ3ewmkNtXo2FZv/X2yGKdlm9M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492420; c=relaxed/simple; bh=uIXcHmCDzw/Ei7jNzyEofRMwehXYGBmCK1xBP21HeuI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gwCX0h0z0KE94dxaWKtCdl9GfUgToIcVSbQK3BFSf0pHJ06nQcKRu34PqHWVBY9aAGyLGtIa+pCqmo1I+6nxXI06RIPX84t++IbxodvDEaE5ffR33i5SsJ4zpeqVUnU/U4i8PlEhE3P9kwvKW8wCG9iyLd5oYiNiKcslWBnc5lw= 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=Zci41J1V; 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="Zci41J1V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492418; 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=IrH9X/arE/6sOUtmaO+Jg5cKd9dcGxIYeKDtr1nTdl8=; b=Zci41J1VrOIj0VCpIN8zV7PEpZrzMPPC5zW31Muc2FxjbPJuOd5aSTldqlulMZWndic2BW eyQ6E9zaI3trzAmjJKhxkaqY6YJetuWfLyqDvV6pcRnQ63uqV5YpL/6zxSzq/MxdstCaKP aSbecF6PdrKDa+3ILpgUTqlFy7nGaGc= Received: from mx-prod-mc-04.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-115-KX9pinwmPLWsTYplK-0SLw-1; Thu, 13 Feb 2025 19:20:14 -0500 X-MC-Unique: KX9pinwmPLWsTYplK-0SLw-1 X-Mimecast-MFC-AGG-ID: KX9pinwmPLWsTYplK-0SLw_1739492414 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DC5D819039C8; Fri, 14 Feb 2025 00:20:13 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 35F9D19373C4; Fri, 14 Feb 2025 00:20:04 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:17 -0500 Subject: [PATCH 04/12] drm/mediatek: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-4-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa , CK Hu X-Developer-Signature: v=1; a=ed25519-sha256; t=1739492356; l=8775; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=uIXcHmCDzw/Ei7jNzyEofRMwehXYGBmCK1xBP21HeuI=; b=8QC1slobRzH+eG8+Tc/zIkmBfWL9kuhfEuiATareVypRbQhFrZhLfEU8EjDj0xrEQnjEBrnVQ xGVacoOX6u4CRK/AZIqa8HBLhS1RMlQpzmaIHQeX0lP21nciMoGwQec X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D devm_platform_ioremap_resource(pdev,0); Cc: Chun-Kuang Hu Cc: Philipp Zabel Reviewed-by: Maxime Ripard Reviewed-by: CK Hu Signed-off-by: Anusha Srivatsa --- 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/me= diatek/mtk_disp_color.c index dd8433a38282a9ba1bcc3a4ddd01dd89738ccb60..39c7de4cdcc16b56a5a1d046aaa= baf5580227ed2 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 *p= dev) { struct device *dev =3D &pdev->dev; struct mtk_disp_color *priv; - struct resource *res; int ret; =20 priv =3D 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"); =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs =3D devm_ioremap_resource(dev, res); + priv->regs =3D 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/me= diatek/mtk_disp_gamma.c index b17b11d93846f2019d8c4afb294375333e22dc42..8afd15006df2a21f3f52fe00eca= 3c5501f4fb76a 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 =3D &pdev->dev; struct mtk_disp_gamma *priv; - struct resource *res; int ret; =20 priv =3D 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"); =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs =3D devm_ioremap_resource(dev, res); + priv->regs =3D 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/me= diatek/mtk_disp_merge.c index 563b1b248fbbb38ef03bb3e3ceecdd265961df60..b174dda091d3fbd16796e8e128b= 030fccf5b902c 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_compon= ent_ops =3D { static int mtk_disp_merge_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; - struct resource *res; struct mtk_disp_merge *priv; int ret; =20 @@ -314,8 +313,7 @@ static int mtk_disp_merge_probe(struct platform_device = *pdev) if (!priv) return -ENOMEM; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs =3D devm_ioremap_resource(dev, res); + priv->regs =3D 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/medi= atek/mtk_disp_ovl.c index df82cea4bb79c472acbb66e0df27fbad3e70bd20..d0581c4e3c999cf865fdd0aaf4c= 2f38dd404926e 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 *p= dev) { struct device *dev =3D &pdev->dev; struct mtk_disp_ovl *priv; - struct resource *res; int irq; int ret; =20 @@ -621,8 +620,7 @@ static int mtk_disp_ovl_probe(struct platform_device *p= dev) return dev_err_probe(dev, PTR_ERR(priv->clk), "failed to get ovl clk\n"); =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs =3D devm_ioremap_resource(dev, res); + priv->regs =3D 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/med= iatek/mtk_disp_rdma.c index bf47790e4d6be5d60070c63c15c75fa201cc4b27..c9d41d75e7f2a3af5820921b7e5= 63da377ce8d0d 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 =3D &pdev->dev; struct mtk_disp_rdma *priv; - struct resource *res; int irq; int ret; =20 @@ -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"); =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs =3D devm_ioremap_resource(dev, res); + priv->regs =3D 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..f298293471de49473dd05973383= dc22f7d3b6c23 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 =3D &pdev->dev; - struct resource *regs; int irq_num; int ret; =20 @@ -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"); =20 - regs =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - dsi->regs =3D devm_ioremap_resource(dev, regs); + dsi->regs =3D 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"); =20 diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek= /mtk_hdmi.c index ca82bc829cb96446d4d34eeef45848df03bd716b..d729c13590cb5ec176f15b680c2= 62a26b677e6aa 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 *h= dmi, struct device_node *cec_np, *remote, *i2c_np; struct platform_device *cec_pdev; struct regmap *regmap; - struct resource *mem; int ret; =20 ret =3D mtk_hdmi_get_all_clk(hdmi, np); @@ -1471,8 +1470,7 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *h= dmi, } hdmi->sys_regmap =3D regmap; =20 - mem =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - hdmi->regs =3D devm_ioremap_resource(dev, mem); + hdmi->regs =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) { ret =3D PTR_ERR(hdmi->regs); goto put_device; diff --git a/drivers/gpu/drm/mediatek/mtk_mdp_rdma.c b/drivers/gpu/drm/medi= atek/mtk_mdp_rdma.c index fc69ee38ce7d6a245a7460cfde8de426e83b2e80..7982788ae9df51f1a378d8d5387= 37f38af7299f2 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_componen= t_ops =3D { static int mtk_mdp_rdma_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; - struct resource *res; struct mtk_mdp_rdma *priv; int ret =3D 0; =20 @@ -299,8 +298,7 @@ static int mtk_mdp_rdma_probe(struct platform_device *p= dev) if (!priv) return -ENOMEM; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->regs =3D devm_ioremap_resource(dev, res); + priv->regs =3D 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"); --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 AA3222753FB for ; Fri, 14 Feb 2025 00:20:33 +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=1739492435; cv=none; b=PfXNN6qGML6Qz8dDyd4Y5TLAmROZUd43DLDoVL+eub0wKjlTHjM/uwkNxKfurL8UquJncV8lA2093hR6CQ2EYmvtPTJpr71UiyE8k7WjJE3IUzFmNfpsFym088oGeSj1xb2as+2ILTSEjdFVBE4If+sp6j+KIeypwG9pHuu7xWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492435; c=relaxed/simple; bh=utPybh0lyb/JNub60ma7JiaZencmSPaI/Rr5vAWohcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lONHCsLeJMUsK9x2HffcfhStKzyQeoYcbnTmElCIOwMFR2mjdWIN1z6V2Hxw8hBPAPOUzUEJ03dyWKXKE6QKb1wwTyC2i72sKcY1CHI5GmWuvC157tCJF2Rq0FCI2tkdcjnBdILIKD+Qrmt/W0ZoAo20jftLxl8c4O8a9OjK0Q0= 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=cmreDocb; 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="cmreDocb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492432; 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=cmreDocbga340uA32h8pV7DLi7BRMUhlJY7jG7SivBTGuSFDtBQkUk3OPArKKf0tQfYiMf Q5VrKqU7gKzVUpSlYgpdOtXN0vqgopRy8sVO0urdmqW5aYbQkU53iuvopfzy6d8ngEDzzc HdQfRQXIMJdkeLTq77Ds1lUmCxDB1Jc= Received: from mx-prod-mc-01.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-668-NEL2Q043O3G9iY3Hn0XdVA-1; Thu, 13 Feb 2025 19:20:31 -0500 X-MC-Unique: NEL2Q043O3G9iY3Hn0XdVA-1 X-Mimecast-MFC-AGG-ID: NEL2Q043O3G9iY3Hn0XdVA Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2C6CD19373DC; Fri, 14 Feb 2025 00:20:25 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3449F191D7C9; Fri, 14 Feb 2025 00:20:14 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:18 -0500 Subject: [PATCH 05/12] drm/mxsfb: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-5-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=2524; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=utPybh0lyb/JNub60ma7JiaZencmSPaI/Rr5vAWohcI=; b=Jbl1eKUhhexpIYGss5JYUqMcA+OOM4iOsKjEtNevp0JI6DKdFt7qg7YhJ2ScpPGgECJ9A03a4 yKOknxmtZRyCdQ0T1QpYU3T3NtLwUrm1lXWUZVocFcl8M4GIiHzSb7g X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D 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/lcdi= f_drv.c index 8ee00f59ca821cea8e823e7100fb4d7534283994..fcb2a7517377e9a5bbd2997c578= c579b1b079f92 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 =3D to_platform_device(drm->dev); struct lcdif_drm_private *lcdif; - struct resource *res; int ret; =20 lcdif =3D devm_kzalloc(&pdev->dev, sizeof(*lcdif), GFP_KERNEL); @@ -144,8 +143,7 @@ static int lcdif_load(struct drm_device *drm) lcdif->drm =3D drm; drm->dev_private =3D lcdif; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - lcdif->base =3D devm_ioremap_resource(drm->dev, res); + lcdif->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(lcdif->base)) return PTR_ERR(lcdif->base); =20 diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsf= b_drv.c index 59020862cf65e5cc488903f1263ed16dfbce06f9..377d4c4c9979ad9538cfec54648= 27a82936f811b 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 =3D to_platform_device(drm->dev); struct mxsfb_drm_private *mxsfb; - struct resource *res; int ret; =20 mxsfb =3D devm_kzalloc(&pdev->dev, sizeof(*mxsfb), GFP_KERNEL); @@ -226,8 +225,7 @@ static int mxsfb_load(struct drm_device *drm, drm->dev_private =3D mxsfb; mxsfb->devdata =3D devdata; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - mxsfb->base =3D devm_ioremap_resource(drm->dev, res); + mxsfb->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mxsfb->base)) return PTR_ERR(mxsfb->base); =20 --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 A5769DDDC for ; Fri, 14 Feb 2025 00:20: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=1739492441; cv=none; b=tWKtbTBXh9Vs2UscKRJ31dyUGR0s18TKv/zJcsTWRvXFMRvNyEIB9NFP/L4/Ob6Iwqwt2sCs2g1YNGFr/MzKZ+PjBL+nEErendoafHqHDcTgNVVRMmOT4JMOxAgx7jhrXa+uYMGSB2DRF4tS3s0LmAEbkPg/EVlh5QrG2RDeedA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492441; c=relaxed/simple; bh=TUTmaiy8ktvyaVot7XAdlGbdVhdJXc6wa5HLnlHeW8o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MLlmevqC50HigWwI3dE64Q9OAcBjpKDVqfmBgfA9e8X0uGJXADEv7/nVbBpLzaJRv6QNvBRSDyLHl1moWuRLGCBdkd4vO8BrDE7P6FHGj/wJPUepede8z7OH3t1jj7x9wA8iuxtDlWp6KDNKvQymE0YPeEn9Rs6lI0jW9O095m8= 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=VOdLzH3x; 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="VOdLzH3x" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492438; 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=u5DUTgeKSzBlhfw6rOV4iz9Co6cl3sdssftt47WsrV0=; b=VOdLzH3xPmY7dRp7zhe40jJJFEWDpx8xFpBoj7kAn+Ftkj+xqg7aZofXfY9CVP6CClu9nu 7nfm0R7tEhx+Bpowzd+z9vzF2RhpKHAFU2zoWYtoL4sqT3uskzSy8lgEiGQQ5Oam/vnS7d pTrtHmCPNt4rBvGlQnqk8vWR5TFbRi4= 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-561-Ys5Z9M-gPqaEu6A86UMg6w-1; Thu, 13 Feb 2025 19:20:35 -0500 X-MC-Unique: Ys5Z9M-gPqaEu6A86UMg6w-1 X-Mimecast-MFC-AGG-ID: Ys5Z9M-gPqaEu6A86UMg6w Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 CAAD21800875; Fri, 14 Feb 2025 00:20:34 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 76BC319373C4; Fri, 14 Feb 2025 00:20:25 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:19 -0500 Subject: [PATCH 06/12] drm/sprd: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-6-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=2443; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=TUTmaiy8ktvyaVot7XAdlGbdVhdJXc6wa5HLnlHeW8o=; b=axlcFZToqyPDTa57KeclbJgjYIwMsyapnKIbq7G2GSRXbwVjCU51RG/UGVM6g1j4qeKJz5pla tb99zgNlyKsDQwOda15aHnv3kWaboZQzlQGPMnd4u8j0SsF6LU0UVK4 X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); <... -if (!res) { -... -} ...> -ioremap =3D devm_ioremap(...); +ioremap =3D devm_platform_ioremap_resource(pdev,0); Cc: Chunyan Zhang Cc: Dmitry Baryshkov Reviewed-by: Maxime Ripard Signed-off-by: Anusha Srivatsa Reviewed-by: Chunyan Zhang --- 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_dp= u.c index cb2816985305fd19eac27413c214681a5a1e9ffa..65cd5aa1634eee5a6735ccffa4e= e3979844d92ce 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 =3D to_platform_device(dev); struct dpu_context *ctx =3D &dpu->ctx; - struct resource *res; int ret; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(dev, "failed to get I/O resource\n"); - return -EINVAL; - } - - ctx->base =3D devm_ioremap(dev, res->start, resource_size(res)); + ctx->base =3D 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_ds= i.c index 8fc26479bb6bce0aa94914f49d0986a7e19326c1..1668bb4166ab0ad3812c5654244= 544a9caf249a6 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 =3D to_platform_device(dev); struct dsi_context *ctx =3D &dsi->ctx; - struct resource *res; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(dev, "failed to get I/O resource\n"); - return -EINVAL; - } - - ctx->base =3D devm_ioremap(dev, res->start, resource_size(res)); + ctx->base =3D devm_platform_ioremap_resource(pdev, 0); if (!ctx->base) { drm_err(dsi->drm, "failed to map dsi host registers\n"); return -ENXIO; --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 690CEC8C7 for ; Fri, 14 Feb 2025 00:20:54 +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=1739492456; cv=none; b=WS80l5LHToiLTHvMYE1IOBHVJhjhpGzVD9/fibP9/S07+qfgJBaPhfLmsMgUNdNYrP62v3KY55GCDL8ZpgROSnirPnpz0ulCEvG5FK4H62EG8G8VLo2DFYBFj3loa+3Gn4T8pPOigF4UsY1Wlp4/2DhqZ9r/u2VzLKcJdz24o1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492456; c=relaxed/simple; bh=uVtYXzPEFiDF4K0A7qqpqkoig1yNms2Ij9v80VQ98xQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EcQutYXr7quzmf7lZQH8DiD82TyDg7Um6ctTEPXi3ZBCvOd1nb9vXMdpcqXwxPdNx/vrD7SYuIAICLUqagfFiFit9+LQU/LTPv6PM3nlDIT4ejjUUdOysKu72gvGuqugAqVIaQjX60lbT2WUiqWxi9vLg3UdPD/itH9cWTetXc8= 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=B/wCUjZj; 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="B/wCUjZj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492453; 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=1SyGjgKbryTWmJVGn6FomMxHDBk+KgTQY7/iUl03kyE=; b=B/wCUjZjsJTFKTM5sMuhrUIRLA/LEdufUdkRC1fmTywgAW92pFGZhWbv4yzM83DGraV5CU bEFAORHt4Vd8aQ4BEyVbVAR2+VHQ741hRWe06N+ghBhqf1RRYclSgDvlM0effaBSSjhhBz JRnHz3czoz0ESumPKtZbIXpfUhByCHc= Received: from mx-prod-mc-04.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-470-NZ_l7rMjMgiBJJ3A2lr8EQ-1; Thu, 13 Feb 2025 19:20:50 -0500 X-MC-Unique: NZ_l7rMjMgiBJJ3A2lr8EQ-1 X-Mimecast-MFC-AGG-ID: NZ_l7rMjMgiBJJ3A2lr8EQ Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 19E851903089; Fri, 14 Feb 2025 00:20:45 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2200219373C4; Fri, 14 Feb 2025 00:20:34 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:20 -0500 Subject: [PATCH 07/12] drm/sti: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-7-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=8242; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=uVtYXzPEFiDF4K0A7qqpqkoig1yNms2Ij9v80VQ98xQ=; b=VKUk1zcg2mPnfm/PNHPPHhCC3Yd5O6ZOCp9zsb1NrYlNRwcKR/unOXyqCrAga6kEyJT3WNZ+6 iOTlf2+1wSxBZg2OUrhHOsCr2s7XkwnTopImc0AnJPXJgAcJzea3XWS X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource_byname(pdev,mem,name); <... -if (!res) { -... -} ...> -ioremap =3D devm_ioremap(...); +ioremap =3D devm_platform_ioremap_resource_byname(pdev,name); and @rule_2@ identifier res; expression ioremap; identifier pdev; @@ -struct resource *res; ... -res =3D platform_get_resource(pdev,...); <... -if (!res) { -... -} ...> -ioremap =3D devm_ioremap(...); +ioremap =3D devm_platform_ioremap_resource(pdev,0); v2: Fix compilation error. Cc: Raphael Gallais-Pou Cc: Alain Volmat Reviewed-by: Maxime Ripard Acked-by: Raphael Gallais-Pou Signed-off-by: Anusha Srivatsa --- 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..7aefce6706ba2cd7d97a33228c9= b9812edecf06f 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 =3D dev->of_node; struct device_node *vtg_np; struct sti_compositor *compo; - struct resource *res; unsigned int i; =20 compo =3D devm_kzalloc(dev, sizeof(*compo), GFP_KERNEL); @@ -194,14 +193,7 @@ static int sti_compositor_probe(struct platform_device= *pdev) =20 memcpy(&compo->data, of_match_node(compositor_of_match, np)->data, sizeof(struct sti_compositor_data)); - - /* Get Memory ressources */ - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res =3D=3D NULL) { - DRM_ERROR("Get memory resource failed\n"); - return -ENXIO; - } - compo->regs =3D devm_ioremap(dev, res->start, resource_size(res)); + compo->regs =3D devm_platform_ioremap_resource(pdev, 0); if (compo->regs =3D=3D 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..660588f01f90950a9b2c180ab23= 0188c19901f26 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 =3D &pdev->dev; struct sti_dvo *dvo; - struct resource *res; struct device_node *np =3D dev->of_node; =20 DRM_INFO("%s\n", __func__); @@ -523,14 +522,7 @@ static int sti_dvo_probe(struct platform_device *pdev) } =20 dvo->dev =3D pdev->dev; - - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "dvo-reg"); - if (!res) { - DRM_ERROR("Invalid dvo resource\n"); - return -ENOMEM; - } - dvo->regs =3D devm_ioremap(dev, res->start, - resource_size(res)); + dvo->regs =3D devm_platform_ioremap_resource_byname(pdev, "dvo-reg"); if (!dvo->regs) return -ENOMEM; =20 diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index b12863bea95559c4f874eb94cea8938609d435d4..0b5dbaf4d5305989846e25a1cab= 6f82d191aa9a5 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; =20 hda->dev =3D pdev->dev; - - /* Get resources */ - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "hda-reg"); - if (!res) { - DRM_ERROR("Invalid hda resource\n"); - return -ENOMEM; - } - hda->regs =3D devm_ioremap(dev, res->start, resource_size(res)); + hda->regs =3D devm_platform_ioremap_resource_byname(pdev, "hda-reg"); if (!hda->regs) return -ENOMEM; =20 diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index ca2fe17de4a5d1e0199e59a97e6c7601e139ed9e..666143c48b0d0f2c20cd26323dd= bc8e69d966622 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 *pde= v) struct device *dev =3D &pdev->dev; struct sti_hdmi *hdmi; struct device_node *np =3D dev->of_node; - struct resource *res; struct device_node *ddc; int ret; =20 @@ -1399,15 +1398,7 @@ static int sti_hdmi_probe(struct platform_device *pd= ev) } =20 hdmi->dev =3D pdev->dev; - - /* Get resources */ - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi-reg"); - if (!res) { - DRM_ERROR("Invalid hdmi resource\n"); - ret =3D -ENOMEM; - goto release_adapter; - } - hdmi->regs =3D devm_ioremap(dev, res->start, resource_size(res)); + hdmi->regs =3D devm_platform_ioremap_resource_byname(pdev, "hdmi-reg"); if (!hdmi->regs) { ret =3D -ENOMEM; goto release_adapter; diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvd= p.c index 0f658709c9d0d398c4eed65202443db9d0b41f8c..420395598d119a403d531211022= e6005d6a2bd59 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 *pd= ev) struct device *dev =3D &pdev->dev; struct device_node *vtg_np; struct sti_hqvdp *hqvdp; - struct resource *res; =20 DRM_DEBUG_DRIVER("\n"); =20 @@ -1367,14 +1366,7 @@ static int sti_hqvdp_probe(struct platform_device *p= dev) } =20 hqvdp->dev =3D dev; - - /* Get Memory resources */ - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - DRM_ERROR("Get memory resource failed\n"); - return -ENXIO; - } - hqvdp->regs =3D devm_ioremap(dev, res->start, resource_size(res)); + hqvdp->regs =3D 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_tvou= t.c index af6c06f448c4819def8cc0d0836e30f991529690..0bebe815f5e7567f84388af9372= 3a6fa7d2cc7a2 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 =3D &pdev->dev; struct device_node *node =3D dev->of_node; struct sti_tvout *tvout; - struct resource *res; =20 DRM_INFO("%s\n", __func__); =20 @@ -850,14 +849,7 @@ static int sti_tvout_probe(struct platform_device *pde= v) return -ENOMEM; =20 tvout->dev =3D dev; - - /* get memory resources */ - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "tvout-reg"); - if (!res) { - DRM_ERROR("Invalid glue resource\n"); - return -ENOMEM; - } - tvout->regs =3D devm_ioremap(dev, res->start, resource_size(res)); + tvout->regs =3D devm_platform_ioremap_resource_byname(pdev, "tvout-reg"); if (!tvout->regs) return -ENOMEM; =20 diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c index 5ba469b711b5318e9e9e6d8df127fb8933d1fac1..b5353fe774d72fd629ecd3ef75a= 5d2817ca8617f 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 =3D &pdev->dev; struct sti_vtg *vtg; - struct resource *res; int ret; =20 vtg =3D devm_kzalloc(dev, sizeof(*vtg), GFP_KERNEL); if (!vtg) return -ENOMEM; - - /* Get Memory ressources */ - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - DRM_ERROR("Get memory resource failed\n"); - return -ENOMEM; - } - vtg->regs =3D devm_ioremap(dev, res->start, resource_size(res)); + vtg->regs =3D devm_platform_ioremap_resource(pdev, 0); if (!vtg->regs) { DRM_ERROR("failed to remap I/O memory\n"); return -ENOMEM; --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 EA8FA17D2 for ; Fri, 14 Feb 2025 00:21:08 +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=1739492470; cv=none; b=FsT/h/kxvNlFyOXciwVWTM4IgqfqDASP1gMsXbtzZYE3QWlwLIK/SOHQ7F4QKE6SzaEBlTbSSrhm4kBuy2PUdlraXBF2G4ywsnDmWjiP7Wa54X6o7cguz5J7hy9I2HRkOWv3O3lVF5/PiejrsQqL1x7oJrgwVZmRf2kY539iIAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492470; c=relaxed/simple; bh=i8LWrfxom0nQSC05REsfBXvlA+tOy6QpDxqqftn+kA0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CxKG28ENxi4nt9j4pRPBvc773despCaP3LwPeeVBiXZnUlM0GvofNAvy6FM8LDtpu7Bn/mtm+wJNZpPiLCiTDctE0nyoGRbfhC0he5COnQW9BJGRHAiKrLQLPvr7ELZb5/frywMaYFcmr68EjFl22xMwsHGUEzUMLwOrNJISyrI= 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=dmXJitr0; 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="dmXJitr0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492467; 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=vpuRtzEq0QQBKTFe7oiNde6xdrTLT6xb1c3fW35+XOM=; b=dmXJitr02vMJq+1YbY5cIrdQCvUzrjmKt3MCrzzrmIjY+biCVRad29Htwimy5e2XoGaDRQ UYWCDi85XosBh6qxKymtAwu7gokopMMVQY+Tq8Wrij2Od+6PYWoecXJbhuEX09wgOmI8Ti 3kpvtQTQ6fe8gZj/xA576DMNEiUJzoo= 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-586-LxgCWGsVN_6f4FwaIITdEQ-1; Thu, 13 Feb 2025 19:21:03 -0500 X-MC-Unique: LxgCWGsVN_6f4FwaIITdEQ-1 X-Mimecast-MFC-AGG-ID: LxgCWGsVN_6f4FwaIITdEQ Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 A699618EB2C6; Fri, 14 Feb 2025 00:20:54 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 65EF8191D7C8; Fri, 14 Feb 2025 00:20:45 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:21 -0500 Subject: [PATCH 08/12] drm/stm: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-8-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=1617; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=i8LWrfxom0nQSC05REsfBXvlA+tOy6QpDxqqftn+kA0=; b=ODnHfrPCdxaG+cvlimJF1bdgqI5DCS6OaKBsHAK5YPWr4Mpni0r1miA8pb0l5FvqKULISA+19 cfaUlB7iF9zDhK/+tlgHhQD7bnbWSZd0UKCrc2LMMV6SZmEUSfLoFcf X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D devm_platform_ioremap_resource(pdev,0); Cc: Yannick Fertre Cc: Raphael Gallais-Pou Cc: Philippe Cornu Acked-by: Raphael 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..ba315c66a04d72758b9d3cfcd84= 2432877f66d3a 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 =3D -ENODEV; =20 @@ -1966,8 +1965,7 @@ int ltdc_load(struct drm_device *ddev) reset_control_deassert(rstc); } =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - ldev->regs =3D devm_ioremap_resource(dev, res); + ldev->regs =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ldev->regs)) { DRM_ERROR("Unable to get ltdc registers\n"); ret =3D PTR_ERR(ldev->regs); --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 1E7272753FB for ; Fri, 14 Feb 2025 00:21:15 +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=1739492477; cv=none; b=jUQzMEasszHnojGeOTwn2PQpjsb38W33gJ5hE67LI5lGIHAOoVah8P/ddZA5Q+J+b4I+nRuafyTeNyiFepAlbOTjNv+zHpAhdAjQoqoNFCHPKXMHsI9r/PNqYLBRt/bJkIbceYPA1J685MCdZuSDgE6XobVwjgjlHFQsEv0bJuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492477; c=relaxed/simple; bh=66gfH4HaVcJzuzQX0NHIOkeT0eso2EOo8AHIoNrPiQ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I4olEdx68Y8yDvZ4XSScibSjRQOr66wyvFKQJdcwhY8Y4jA+ZLMW5zNi250P6pyxzh5wcosFeWS0UN4J8YJbqsIcMGF2FAggC5oIncIOlzVU+MhsY3AnejyUglx7/ozrIssANjmokUvsZktCFjBKcHNq7+wW86RnocPcX79KwhA= 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=LuCR42MW; 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="LuCR42MW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492474; 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=LuCR42MWd9fxGwQ/YJIVQ4wcpWSEq5jNT2WyFHWc4nuvwAe0WOOv30I1KR3OYDkIAY96dM cwyJ6NvC007tAXGr9d5L8V1mlZh7fc5MyHLsvLoQWdLACAT6vqXFFQiqIkHTkM1TN55gVZ /85S0TCR/jcRuCD2WYa1XdaLFvjLtAU= 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-644-VWyHsseaPNaZQ615f1HAfw-1; Thu, 13 Feb 2025 19:21:10 -0500 X-MC-Unique: VWyHsseaPNaZQ615f1HAfw-1 X-Mimecast-MFC-AGG-ID: VWyHsseaPNaZQ615f1HAfw Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 AD23F19560B9; Fri, 14 Feb 2025 00:21:04 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F337119373C4; Fri, 14 Feb 2025 00:20:54 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:22 -0500 Subject: [PATCH 09/12] drm/tegra: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-9-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=1560; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=66gfH4HaVcJzuzQX0NHIOkeT0eso2EOo8AHIoNrPiQ8=; b=lERldx+LESWFe45bunCkBz/hTi0YUBRXtlg7nEd9i+5NiEJuicyc5TDHv4kGFLqu6nL+Q4mjK OFl9sPsgdQeB02s6YY5/9O/HjCjt3dM44IBUwlkbzFjZuraMmQBWPEO X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D 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..51f1ed897f8e473f45f89ff3e2d= 99f66d2c80f21 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 *d= si) static int tegra_dsi_probe(struct platform_device *pdev) { struct tegra_dsi *dsi; - struct resource *regs; int err; =20 dsi =3D devm_kzalloc(&pdev->dev, sizeof(*dsi), GFP_KERNEL); @@ -1636,8 +1635,7 @@ static int tegra_dsi_probe(struct platform_device *pd= ev) goto remove; } =20 - regs =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - dsi->regs =3D devm_ioremap_resource(&pdev->dev, regs); + dsi->regs =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(dsi->regs)) { err =3D PTR_ERR(dsi->regs); goto remove; --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 E212CB67F for ; Fri, 14 Feb 2025 00:21:23 +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=1739492485; cv=none; b=ZxwstVIlqbE+grLONFit5qDoFFPyx7rJz9ue0hzdP/YY0p/FTZwGIwW1uJoqDFBfifkpQH50aTvFup8p5OAmP9Ql1ly88MS2xVY+ogkN6RStve7CRpJ/S+AjeV68xvV3KoGCiLiIKnBqV79+0CFaTbtwDOKo2yV+bc0n5IqtCHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492485; c=relaxed/simple; bh=7+Q2lsuHInmFMU6F4dj3qB4yNCyOo0pZ9W9kufCkjVw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NNFNOZKPiR6GGGPkpDNwGANXa7kYWBxbi9qhSdHiYDI5Ib8+Hw48wUze23qfexFDFfQsasWx1/SUcgIT94OySKl9MBqniE6psOx5LxgYyZpyH/D6/rvHS2hGQgxsoIz/sSShhJarYb7/SWSSRTEcgQWmtIikVVj6EnfKSvg3YzQ= 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=P8RAJjIe; 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="P8RAJjIe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492483; 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=P8RAJjIeeaXY1TfQEkIEkZSZ/ECgkYBoDRGu5nDKIQvz2Q6YhkRvnSTeq8GMQ+Xh+R1FlN NRx0vOhoseH9VhjaMOKhSzENMFoOLDUuG05ZUr53B61oAiwPadEUFXI98Ew9WuTJ+qAGFu KCj2pMHZFhZFOFspAVZC57Rbv0cTygQ= Received: from mx-prod-mc-01.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-404-bhh0wgY8Ng6etL7QahRLUg-1; Thu, 13 Feb 2025 19:21:19 -0500 X-MC-Unique: bhh0wgY8Ng6etL7QahRLUg-1 X-Mimecast-MFC-AGG-ID: bhh0wgY8Ng6etL7QahRLUg Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0056019783B4; Fri, 14 Feb 2025 00:21:14 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 05546191D7C8; Fri, 14 Feb 2025 00:21:04 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:23 -0500 Subject: [PATCH 10/12] drm/tiny: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-10-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=1744; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=7+Q2lsuHInmFMU6F4dj3qB4yNCyOo0pZ9W9kufCkjVw=; b=/uy5gFp72Bm9DXq0ek56M5REk9Tqeof8AqrV7AHnmCuPGrTbYbBKbTciKzI0dnDOUiP796sa3 Qkfz4go/jeMByY3tnH11r0DsnQB2YwdzUdKbQEKtj+Tny1CBimO/vAy X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource(pdev,...); -ioremap_res =3D devm_ioremap_resource(...); +ioremap_res =3D 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..7cf0f0ea1bfe4fa82234a120b52= 837e26a8ee5b0 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 *arcpg= u) struct device_node *encoder_node =3D NULL, *endpoint_node =3D NULL; struct drm_connector *connector =3D NULL; struct drm_device *drm =3D &arcpgu->drm; - struct resource *res; int ret; =20 arcpgu->clk =3D devm_clk_get(drm->dev, "pxlclk"); @@ -270,8 +269,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpg= u) drm->mode_config.max_height =3D 1080; drm->mode_config.funcs =3D &arcpgu_drm_modecfg_funcs; =20 - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - arcpgu->regs =3D devm_ioremap_resource(&pdev->dev, res); + arcpgu->regs =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(arcpgu->regs)) return PTR_ERR(arcpgu->regs); =20 --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 BC414B644 for ; Fri, 14 Feb 2025 00:21:34 +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=1739492497; cv=none; b=FSIzOHHos3LpKcL+KU2MLLBC0u2BVdHZCbOT5obmC5JeShZBgsadVBlICZc4LNYFFwqjyoKyqryUi+YevBSJ+MPEH/eTqD8lQMDQE5H+B0opzYQ74x+tggiaKhuJqw8qSd1g/QCUKFlAhPmsv8T9d8rgdNqP52Kbf3qqWxOu5Ow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492497; c=relaxed/simple; bh=qNRQxkfMur7BPqwRSoUD0Y1xSb+mBLR8VcBDJdlCxGw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=raffOZo8xkz6mR+Y67hOYfUPVIBNs0UMllZlAn7kknxEWNVWUkpq409+51kSGa0/wRi+ZP9i/SjCLNMkWTuP5vPJCNRevVNsd+swPTLgDMZs+pK5dOlX4VzAlLDx+leqDTXFnpIKzsEyVyKhVkRs/qhGAoMXVqpLx/izPQ9wQes= 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=N+YZFl3m; 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="N+YZFl3m" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492493; 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=zMrchSDjVXlMnzWa5wmPToNTzllJYTex21+BPUGzEBM=; b=N+YZFl3mHb+U1NuZntm+Bg4RjR36f2yrLkbgK4MbrlYlVLt3QhFMzp4LBh1UR+HvrBrYsX dsD2uXJROCxp7+bGAy0aWgU/5Jk7mJcUyuyaXixWERiMmqMZBgKhatFdIxCZHL0DiDFZaF TVjg4BfdM/FvWmUZNjVizeisnAawvKY= 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-116-bCj-zEa8MpmrH9j3CmeMMA-1; Thu, 13 Feb 2025 19:21:29 -0500 X-MC-Unique: bCj-zEa8MpmrH9j3CmeMMA-1 X-Mimecast-MFC-AGG-ID: bCj-zEa8MpmrH9j3CmeMMA_1739492483 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 6A42618E6952; Fri, 14 Feb 2025 00:21:23 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4D02619373C4; Fri, 14 Feb 2025 00:21:14 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:24 -0500 Subject: [PATCH 11/12] drm/vc4: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-11-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=4256; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=qNRQxkfMur7BPqwRSoUD0Y1xSb+mBLR8VcBDJdlCxGw=; b=ijXOEGX0OJP9agRtmiVCHuzM1ADlEbiLLq8nwfqtGrIMhF6NnUgGf9xdYkRygezmigyj/NY28 dpk6p9JnRIbCdyD82YA5mRuUqWeRxMu9++9Uw5H3KYi2vCPipmO/YvS X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 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 =3D platform_get_resource_byname(pdev,mem,name); <... -if (!res) { -... -} ...> -ioremap =3D devm_ioremap(...); +ioremap =3D 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. v3: Do not convert "hd" resource to follow the rest of the refactor. (Maxime) Cc: Maxime Ripard Cc: Dave Stevenson Cc: Ma=C3=ADra Canal Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/vc4/vc4_hdmi.c | 54 ++++++++++++++------------------------= ---- 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 47d9ada98430634cfd8c1e21c2a4d00d501bab7e..aacc7a3aa007a66c22f68158377= f025adcbb4df1 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2951,18 +2951,18 @@ static int vc5_hdmi_init_resources(struct drm_devic= e *drm, { struct platform_device *pdev =3D vc4_hdmi->pdev; struct device *dev =3D &pdev->dev; - struct resource *res; int ret; =20 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi"); - if (!res) - return -ENODEV; - - vc4_hdmi->hdmicore_regs =3D devm_ioremap(dev, res->start, - resource_size(res)); + vc4_hdmi->hdmicore_regs =3D devm_platform_ioremap_resource_byname(pdev, + "hdmi"); if (!vc4_hdmi->hdmicore_regs) return -ENOMEM; =20 + /* This is shared between both HDMI controllers. Cannot + * claim for both instances. Lets not convert to using + * devm_platform_ioremap_resource_byname() like + * the rest + */ res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "hd"); if (!res) return -ENODEV; @@ -2971,51 +2971,33 @@ static int vc5_hdmi_init_resources(struct drm_devic= e *drm, if (!vc4_hdmi->hd_regs) return -ENOMEM; =20 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "cec"); - if (!res) - return -ENODEV; - - vc4_hdmi->cec_regs =3D devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->cec_regs =3D devm_platform_ioremap_resource_byname(pdev, + "cec"); if (!vc4_hdmi->cec_regs) return -ENOMEM; =20 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "csc"); - if (!res) - return -ENODEV; - - vc4_hdmi->csc_regs =3D devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->csc_regs =3D devm_platform_ioremap_resource_byname(pdev, + "csc"); if (!vc4_hdmi->csc_regs) return -ENOMEM; =20 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "dvp"); - if (!res) - return -ENODEV; - - vc4_hdmi->dvp_regs =3D devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->dvp_regs =3D devm_platform_ioremap_resource_byname(pdev, + "dvp"); if (!vc4_hdmi->dvp_regs) return -ENOMEM; =20 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy"); - if (!res) - return -ENODEV; + vc4_hdmi->phy_regs =3D devm_platform_ioremap_resource_byname(pdev, + "phy"); =20 - vc4_hdmi->phy_regs =3D devm_ioremap(dev, res->start, resource_size(res)); if (!vc4_hdmi->phy_regs) return -ENOMEM; =20 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "packet"); - if (!res) - return -ENODEV; - - vc4_hdmi->ram_regs =3D devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->ram_regs =3D devm_platform_ioremap_resource_byname(pdev, + "packet"); if (!vc4_hdmi->ram_regs) return -ENOMEM; =20 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "rm"); - if (!res) - return -ENODEV; - - vc4_hdmi->rm_regs =3D devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->rm_regs =3D devm_platform_ioremap_resource_byname(pdev, "rm"); if (!vc4_hdmi->rm_regs) return -ENOMEM; =20 --=20 2.47.0 From nobody Thu Dec 18 08:09:15 2025 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 2F8DA43ABC for ; Fri, 14 Feb 2025 00:21:41 +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=1739492502; cv=none; b=msKTPbLKcUPh48/TRi4ga7o85EvMYdnW3Q2bxQHBOcG3tjk0Q505rjTYLZwg7nVUbR+o01UpOTpMRbiw3ESHpQClRHe9vArpsWYKgSKiNsKcNYueZfpbfmGGi86GWLft7k5R6cxH8NO6S/AqUOUPFUA2QgozOyU3GU2twe9F3GQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739492502; c=relaxed/simple; bh=bYxgFN867I+WeRXfo+Hqrkj7dpTr9KOQQ6gXwIiRKW0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rIp17dXzwJvHDeADIFZKMAEWuqHbS09RK6GCnBEjSfpZ8NPy0VxUxVSIwoRk4C02obVrOrJNfglN6EKN4/23E5mMRHUlw9kyaMhmFGCxwa7h0P+MvYkAEGUfGzde41aeJUWwaXRgi6I46cA9Zc7U5P1QGA/b2u3uXvVar2HuPxo= 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=IgWGZ0i4; 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="IgWGZ0i4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739492500; 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=YekiFLZYEOC7oNklCnqy2v4cDXBgQn3tW82+Hlneiv0=; b=IgWGZ0i4ZRCo/+B0+FFQZQUiPeFQrFSyh+ZrY3SWVI2Fka7B8q0TLAKUL+QNMQAGLivb8h lH37XFo/RC6AevUSTM6qBVvw/KjevfP2EPYM1NsZzhVw85tDDJIyGRJT7iPQT5NUSKlfiA QQLuZH0V4K8PSpozWGZ4Uek8dKdki9M= 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-611-GREkPZofPRqAGTMWmiWrUg-1; Thu, 13 Feb 2025 19:21:37 -0500 X-MC-Unique: GREkPZofPRqAGTMWmiWrUg-1 X-Mimecast-MFC-AGG-ID: GREkPZofPRqAGTMWmiWrUg Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 AE9361800879; Fri, 14 Feb 2025 00:21:32 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.199]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B66FE19373C4; Fri, 14 Feb 2025 00:21:23 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 13 Feb 2025 19:19:25 -0500 Subject: [PATCH 12/12] Documentation: Update the todo Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250213-mem-cocci-v3-v1-12-93466d165349@redhat.com> References: <20250213-mem-cocci-v3-v1-0-93466d165349@redhat.com> In-Reply-To: <20250213-mem-cocci-v3-v1-0-93466d165349@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 , 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_Canal?= , 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-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=1739492356; l=1573; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=bYxgFN867I+WeRXfo+Hqrkj7dpTr9KOQQ6gXwIiRKW0=; b=cHX+5YoNVZJTRemhs4SucNAn3ucLSNF85bfH//R9r2aykA56GpMQQQSLXVA7X7foeQRwKWecs +OKDBIRplsKChc5XegZo+yGbuHDto2wbs/C+rOhVmPq3dgGic16khxR X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Update the Documentation to be more precise. v2: Update for clarity v3: Further details in Todo Cc: Thomas Zimmermann Signed-off-by: Anusha Srivatsa --- Documentation/gpu/todo.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 256d0d1cb2164bd94f9b610a751b907834d96a21..c57777a24e03d91b1ffe04365f7= 356f2d938befd 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -441,14 +441,15 @@ Contact: Thomas Zimmermann =20 Level: Intermediate =20 -Request memory regions in all drivers -------------------------------------- +Request memory regions in all fbdev drivers +-------------------------------------------- =20 -Go through all drivers and add code to request the memory regions that the -driver uses. This requires adding calls to request_mem_region(), +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. This requires adding calls to request_mem_region(), pci_request_region() or similar functions. Use helpers for managed cleanup -where possible. - +where possible. Problematic areas include hardware that has exclusive rang= es +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. =20 --=20 2.47.0