From nobody Mon Dec 15 21:41:52 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 3E5FA21170D for ; Wed, 5 Feb 2025 20:09:31 +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=1738786173; cv=none; b=SCW7BH7S6bsfjNWDIXjVa4AvGDHA9/SqfZSHcaGiX8Fi+pw04PhEycOOOXGuB+rb41mpB8RIP8xxny/FIZ3EsL0opBHQP/QhALQ3geHjgVo584dDXJDB62zo0LTCbBNVkcq3rfrRbAroYmcC7JjqM+RD1X5ufSIl/3cRgdAXd5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786173; c=relaxed/simple; bh=EiZLkZhOyAW9xsLWltUT3PNY16MrDfjY5hC7dVEFLOM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aIxpHMC7MupzEHTsTxrOhvgJhkcoIhKniFdAEflSU8tulVAIKTGtF/WQ+peQkiXdOt8CSYWem37rW4FXN+MZerqz5WMm9tyFHJGoCIo2U5SKP498GMoTinh7fo7kNDdp4fb7TDB5XjOE75JBl/v9qOd+qv39hzCKjlOQPw8uU8w= 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=RPwgzL6q; 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="RPwgzL6q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786171; 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=RPwgzL6qOTFD9Le6aArzpmdoVg9fWOgxnnKu4ON1GjZwPXHiHtmzQZ5xvtuOpdznDJFaN6 t/ZOnRLqHj7TIYCgvRueAIFbXhsT2IVcPwj6pGIc+gb63tHVugOEAJsjLC8+bJWQAMwy8/ 3oA8pdYY3GOYI2zqoKByWUnhJemzgw8= 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-634-2N0mikFYPXGUj58mq9VqUA-1; Wed, 05 Feb 2025 15:09:27 -0500 X-MC-Unique: 2N0mikFYPXGUj58mq9VqUA-1 X-Mimecast-MFC-AGG-ID: 2N0mikFYPXGUj58mq9VqUA Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9F9B119560B6; Wed, 5 Feb 2025 20:09:26 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6AED119560AB; Wed, 5 Feb 2025 20:09:13 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:07:57 -0500 Subject: [PATCH 01/12] drm/aspeed: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-1-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1480; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=EiZLkZhOyAW9xsLWltUT3PNY16MrDfjY5hC7dVEFLOM=; b=XsxAeoZCVozTJnK/kqDAMY/ckZluYOAy4E4MbTsDIaSx08ZZijKGTvdfXCM4/qCOdCyfsoNqm r258ZdLMkhbABTbRgisKxCgmikN0I/EpdAk+57cA0jPzqzp7njZRhyL X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Mon Dec 15 21:41:52 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 BD9AC212FBC for ; Wed, 5 Feb 2025 20:09:45 +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=1738786187; cv=none; b=um4WqpcQp0hT0vOzGe9gyY1wDHxNG99cqVAv7kucZ90nhZDK1KoutnGTnfgOKSAacfa+yFfKzrMLN6LN9ERSPuyR4KOqVsBRNT5M9/MR4taejneIfjdJ1g7de8HZEGAQNZlKf7kSHDS+OJtpe7YyOHIcMpmwjYKuyRJHR1ebYwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786187; c=relaxed/simple; bh=8Mr23W/+G1uZ617GLarMPiY6eX2ezkHI6A58kZ43cp4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Da5eoqeLyg/bnBCuTJzcv20clzRwHDpS1isxaqJsR7CCDoeMkn6u0LVpoidbfEoIvz2/H8chKxfuG+THMxm+Ds2Ap1kNotsi6ldmkTDzujC4tT6goL4OrMWCg5qyWQ2/XLS9KgMmMpSfwErDthTLTfIt+T4HbWj9BYGjfWT3AD0= 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=XdECJk0o; 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="XdECJk0o" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786184; 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=XdECJk0oQ+XvT7iDABPmJP/MaM+Ukx3WVbY64pb3aZoAMd8kY2cZ+KGi6EMOsPdZh9S50c BWvdq85ED4cIM8AuaCCyXXsvPAQ/SsMjzIZ6TgdIdIzaIy5N7Z7V4bpWZEsi2+El+pFWAG dOkTDSjoT3XzpQEZVl0lEpaZgqESJvg= 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-652-RVfS5KDiM0264POXb-woZw-1; Wed, 05 Feb 2025 15:09:41 -0500 X-MC-Unique: RVfS5KDiM0264POXb-woZw-1 X-Mimecast-MFC-AGG-ID: RVfS5KDiM0264POXb-woZw Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CD15E195608E; Wed, 5 Feb 2025 20:09:39 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F082319560AF; Wed, 5 Feb 2025 20:09:26 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:07:58 -0500 Subject: [PATCH 02/12] drm/fsl-dcu: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-2-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1621; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=8Mr23W/+G1uZ617GLarMPiY6eX2ezkHI6A58kZ43cp4=; b=w08+1to0zmPLfPwhWnJMT8LxzW4bcZA6anv7/SWrFNcdFBQ5F4zNDLZbsDRD/1JkaHM+xTeB7 v+CbIKQMYBkDh/lXileZfuakl3WJsLEI+Ds2v6laXWkMyZaAifjm2YR X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Mon Dec 15 21:41:52 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 43015215075 for ; Wed, 5 Feb 2025 20:09: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=1738786197; cv=none; b=eb28GryvvR1YrNyhyZAw8lnwNETlro66i5lvFtp/lbWQFFkAdbLSk6o9qkiPmnTPPtjtzwLJo0yhtQ8h8uS9aJdZt9iAXF5ciuCddfZUwtsqo0BjrlZ48z0fRATqF5uofwc+KeYwsq+qidElIR2M+mX/6uPKTG6tXnh9uwD5/ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786197; c=relaxed/simple; bh=DSpX8fD4B4V0ccw0v0OQXmxnb/T74xXl9np96mYbmE0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q1da5h3nRYb/aL3ErOPtg/OYrVpPwmwbO73zONN8T0s8lIeSR5ICdFtKpl0bgXufnKrRtnnNZmTa1ga+CJMxr7blVeMsYnryqPDlHFlNI9ZMZVKTXQgkzgptViJ2lA6UrwsVnL1OFV57Nd1I2w82Uv07+J8P5xotIT/ju33yYiQ= 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=NKrsVFVT; 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="NKrsVFVT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786194; 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=NKrsVFVTuOuoY3E5E7mq4yrGkEYgFvtdcLQfFt9F/hEAfONhWTtTC5MO7kr6fFoywXA0bg MmvdnRkKBMjwON4USpnrOjTDpNXyc8vI7/2sjqHA6GDJxrVBeHQhhmLWyU9Zv3RWVUptaj +wY9oaInqkLJe7M7AAH6sldaQ+jh4Jk= 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-256-aslIA35aOYyYhXuOGeSfNQ-1; Wed, 05 Feb 2025 15:09:52 -0500 X-MC-Unique: aslIA35aOYyYhXuOGeSfNQ-1 X-Mimecast-MFC-AGG-ID: aslIA35aOYyYhXuOGeSfNQ Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4EAEE195608E; Wed, 5 Feb 2025 20:09:51 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2866F19560A3; Wed, 5 Feb 2025 20:09:39 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:07:59 -0500 Subject: [PATCH 03/12] drm/hisilicon: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-3-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=2968; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=DSpX8fD4B4V0ccw0v0OQXmxnb/T74xXl9np96mYbmE0=; b=fSQOdJcSn2RKbZ+5QQXhv4fvSKOo32FtWRGGBP80/lHVkgtVh1f2TOQLA1+0BiBBSCNejmWuS YTHdNRmUxJHA7e/hOY8KpsMAN6VgCDKMM+JFb4kXGScOVSJatEHDA6u X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Mon Dec 15 21:41:52 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 872DD2135C5 for ; Wed, 5 Feb 2025 20:10:09 +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=1738786211; cv=none; b=P0J464PE/Y+LCr9VaZcwsgzc9iPlGCSq7Q46qnn1UGdk0ZmIf/UEOhP84uRG8SVllT2S2WnrTZcy2IcziIup9+nvyr3D+BJyT1bsGTKz5XrGMjBEQZvNIwOucvCo8jbY+0ERrXpp3GvesoOv8C8tcrGb5ojIq77dRiNHH7A8AFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786211; c=relaxed/simple; bh=gaN5bJDrpd5isCfkjzOID9ayJIdjOxeGWmWcCy/9kzE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=muDuZgUZmySgp3sZ3NSNSDiEU6ei6xiFnO8gytjt7nv/rHusqrBPtE+KvvD6j/tzscGhfxBTU2ycK3FCsDixXftDawNTFFWSvj/RGxH+oeNseI8UdWnGm3lD9/dDkDiqFtFxfYm2tkzDM5puYzJJUKHT8jTL9p6O80RpWpa3buE= 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=JQqM1z16; 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="JQqM1z16" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OOJO4gc/B+VHUdBaesnMxetPUuR8LvhMIAVa1+IoQu4=; b=JQqM1z160xdK5slw4uOFwWjHBjasoz75QMZVqWnpPZI8GIrEfYfF6fquXUP04I6YowpRzA cAMoeHNUuGYHIqUeAMtSaUn20B3gIhuaQePyXmUknrtNEAL2olwRYqsh3CH5itTG64lJyp Yo+8QRBxf3a9+YKpcfF5H9y5QqAWLEg= 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-470-kJDYE3MLPQufhZREXpa63A-1; Wed, 05 Feb 2025 15:10:04 -0500 X-MC-Unique: kJDYE3MLPQufhZREXpa63A-1 X-Mimecast-MFC-AGG-ID: kJDYE3MLPQufhZREXpa63A Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A286A180087B; Wed, 5 Feb 2025 20:10:02 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9FCFE19560AF; Wed, 5 Feb 2025 20:09:51 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:00 -0500 Subject: [PATCH 04/12] drm/mediatek: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-4-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=8685; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=gaN5bJDrpd5isCfkjzOID9ayJIdjOxeGWmWcCy/9kzE=; b=0gfVdfxGwiEcvFlm/cdX7S5NTjoS7jEAqhe2Db/J7t0CgEpbppqG3fmT8PKknuWA2klzTan1Z 8nrQnMJFkJCCeFCbyf5W66EznEfN9iVpQByBnQ5/CcFOKXl/Rc6mfqE X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Signed-off-by: Anusha Srivatsa Reviewed-by: CK Hu Reviewed-by: Maxime Ripard --- drivers/gpu/drm/mediatek/mtk_disp_color.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_gamma.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_merge.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 4 +--- drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 4 +--- drivers/gpu/drm/mediatek/mtk_dsi.c | 4 +--- drivers/gpu/drm/mediatek/mtk_hdmi.c | 4 +--- drivers/gpu/drm/mediatek/mtk_mdp_rdma.c | 4 +--- 8 files changed, 8 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_color.c b/drivers/gpu/drm/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 Mon Dec 15 21:41:52 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 6AC8120CCF4 for ; Wed, 5 Feb 2025 20:10:17 +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=1738786219; cv=none; b=Gb2RdV/SjZuxJoQkLJ4k2npB4jENN0t9AqGBibw9CZk3/ei2ENYnGABKA9creGbMN3O+69pL66sgwlpjhjbcATsOKpHYsbDFCDNolHlN57mRzOw0oA+sVQqq2Olx7uOGzayGo8wR4dmg3R4PsbfQHIsRnjgA6oE09cE579egrpI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786219; c=relaxed/simple; bh=utPybh0lyb/JNub60ma7JiaZencmSPaI/Rr5vAWohcI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MkiUJh3q1TTQBjBGV4c4gEs9RYGjoanzAZ0QKAZCTVzBfJSIrAnBZk3ZTpFcPmIPTqSC43aeGfOqbpsY6/DImYj0OYzsyWTx+hYvwZeCdhglUfLaRZHAvJjs/NngOIhnvoVWuDVzh4rueZmDIBDxKcBce7wO81XWDmbPrn9tTN4= 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=fZYm4rIj; 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="fZYm4rIj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786216; 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=fZYm4rIjICAK++ORm3QVMwglfAZnLMKNx7+XlUsUz+4wQZMYO+HjmlVj3ePxMWRc0A8KhF VCACmOuhCIZwiL9rOVGrpX/2iBGZsaHntuFcul++xp4xSjqs0ZJGyZo77X88s8JUpuorHU GqjNS0Fc8TsyoO8n+TYB85rxqRgpmOA= 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-272-HyCMuOevMJy7P0ONDk3tNg-1; Wed, 05 Feb 2025 15:10:15 -0500 X-MC-Unique: HyCMuOevMJy7P0ONDk3tNg-1 X-Mimecast-MFC-AGG-ID: HyCMuOevMJy7P0ONDk3tNg Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2B03319560A2; Wed, 5 Feb 2025 20:10:14 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D44A819560A3; Wed, 5 Feb 2025 20:10:02 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:01 -0500 Subject: [PATCH 05/12] drm/mxsfb: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-5-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=2524; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=utPybh0lyb/JNub60ma7JiaZencmSPaI/Rr5vAWohcI=; b=adA5FmB9OTklNk5cSHry88wdmTnD8d60S03DE6RXmV5gfmSnK5NzvFpsiPJhn+8vuSw0WjKKQ pUZ5RMLArUMAJoKPoPhv9QcWmqnay+kcYFppICKGgs+hGcuYEXsXBut X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Mon Dec 15 21:41:52 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 11A8120F068 for ; Wed, 5 Feb 2025 20:10:29 +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=1738786231; cv=none; b=iFE1iKbC0xJuF0qh4m2zAWqDsBLZ2Gofe0mb8XZb0xty6qcJQ3vljafXJsxnbaA8HOKAa5fZGFxkzV0c0HqK6YAzgdX10WfgGey+1Zb6IdH8cz0eSYM45RqJciYAX/I7sN+QXIouRW8XqpnHFKJmu0fSa4RsMbOCmlhYsHf+S7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786231; c=relaxed/simple; bh=xnOKo4d5zLC6SAtMuS91xcrNjPZ1X4hCGtOsaEUix3w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LSpqYncQFFh/4pfN0Yod6fDGsyyGkZZqY5+YMUD1ZYK8pbe7a0uE7HufW3sY/RYmC0zSvNlcBtB1argC76ApDtiSFvAfYA2ryOUyf/V7VLAGl7s17dS3iq0VkiqJcL7uMd2wIdWyblWZbhrHFUCJM6CP9aBHfbH/ub6MqGPEHgs= 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=JevCdPzq; 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="JevCdPzq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vTQQyop+FvNGZGa2HymGI+zd4XYA6ac0SZNdQLlY4mQ=; b=JevCdPzqfloNLl4BeAwuCUnJwGkEeHd9+oU+TIx3OnvhPzTEJSoHCZGo/FAhBQGNShuDJ6 NFQZNOt09mp0UR5EZyWyhsC4t+wHjxDAIDAZMFB78WvFc4ExiM8fUaNCCzux2PPIwQ6OYm vkhGhcbfi8w1zoLjuaYwN/sQVzKdHj0= 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-551-RgXTd39wMEW6LKDcIHWW_A-1; Wed, 05 Feb 2025 15:10:26 -0500 X-MC-Unique: RgXTd39wMEW6LKDcIHWW_A-1 X-Mimecast-MFC-AGG-ID: RgXTd39wMEW6LKDcIHWW_A Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F01081956046; Wed, 5 Feb 2025 20:10:24 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7939E19560AB; Wed, 5 Feb 2025 20:10:14 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:02 -0500 Subject: [PATCH 06/12] drm/sprd: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-6-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa , Dmitry Baryshkov X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=2394; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=xnOKo4d5zLC6SAtMuS91xcrNjPZ1X4hCGtOsaEUix3w=; b=9P96dzilm8OCSAOsV3nelE+NyCk6X33PzR8pna80qQpA32qqE1OqIck1bXLiEytFKxbzWi35X rpdS2muAEJCDsCOvfv1Ty24PUjjSatCiBHbA0S8cJP14odIDLpHcX+M X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Signed-off-by: Anusha Srivatsa Reviewed-by: Maxime Ripard --- drivers/gpu/drm/sprd/sprd_dpu.c | 9 +-------- drivers/gpu/drm/sprd/sprd_dsi.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/sprd/sprd_dpu.c b/drivers/gpu/drm/sprd/sprd_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 Mon Dec 15 21:41:52 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 0FB8D212D6A for ; Wed, 5 Feb 2025 20:10:40 +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=1738786242; cv=none; b=JKNfMfbGvQy82QOc2yjBOfdvA6+tEWitkxR11eQ5gyAcVwVyiwQ1pIH2jXAKN8Ps0hUgtIFLiwhWKiYH4vgf90uP8GbhPXcky1JYR0r280TViUYgAXTdqDaTf/LPa5jE3t/dh8FvE664NooAEDlYmSJfMucvxuOpHTInVeYQ1/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786242; c=relaxed/simple; bh=yFglEma1B1UrYHHlLaqVTTuVZsUxBAtaYu9Jp8rfq1E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Lf9McpUN0QSLSpEBmH2s70WHuVlsB52ctTm5zy4axOFRE+W0LsMb5sdK2pRKqdokm9k3alRotOLRg5eRh4FLm3hbwxr8FyotJYe3nH27ifRgZCuUWjtyj2rRWIorxfp6bs5jPgUzAYlyRnnQQ5X4g2YJaWRPN/Vko5eHCwbZ05E= 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=P+Re4ZOD; 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="P+Re4ZOD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5rXNc9RF+BTw1D+Lqt4cYonydXBV4cosBEfjWZVPn/Q=; b=P+Re4ZODHmhV933jIg3u3NSngKgWNT78Ww0o2RmmOO8zZVXWXvH6uEuoczB4yJFVaruYiW W48AQLjFZ/tZu9tuweqlKheD6XdaOQ/6jtiE+mdgguNd9l1vTKlrTCi7QTMSG6w27B0R7o mOs5o0bI8wqJP7Y9RIATo/rf5PAWt3Y= 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-17-vmZibAKROxyKgLz1ZatC1A-1; Wed, 05 Feb 2025 15:10:36 -0500 X-MC-Unique: vmZibAKROxyKgLz1ZatC1A-1 X-Mimecast-MFC-AGG-ID: vmZibAKROxyKgLz1ZatC1A Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9A843180087E; Wed, 5 Feb 2025 20:10:35 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4C0CB19560A3; Wed, 5 Feb 2025 20:10:25 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:03 -0500 Subject: [PATCH 07/12] drm/sti: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-7-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=8138; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=yFglEma1B1UrYHHlLaqVTTuVZsUxBAtaYu9Jp8rfq1E=; b=mAr/l77+MAM0Lk/wltquMSsQ+bAoBfxv2/A9dI4DccZHjP/taolYJP+a25CTaReWEHo2kZvFi CcKo9WqNUGJBrY3/6HPiO1DG3zjUFVNcaw9QNZGyybGqrtBiz9H9SEI X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Signed-off-by: Anusha Srivatsa Acked-by: Raphael Gallais-Pou Reviewed-by: Maxime Ripard --- 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 Mon Dec 15 21:41:52 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 C9B2C211472 for ; Wed, 5 Feb 2025 20:10: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=1738786254; cv=none; b=c/8yaBUVp9+yjE6eReIwF9/a3bmc/L6CGHMW3drvkSx7NpOSDDVdTj7DELh8+MYZGYCa1gKSFHLRNNcSkYjr98kgsN9tkbI9ba9PdE/2+ZaFEnDbsHtkvrse9O1xWL5oIIag1TUOABE0vLdCNhyGl3pIJHjFQosyeLQWliCj8Tw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786254; c=relaxed/simple; bh=Ic1nlkPD6Mj8TJZ8m8wZ6mlAKj2uSChvdOZ/TLjamAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eADuH7uZ9plNN+wk4ilrZ+t4a5JDYrao8ylPEvp29Z/igivTWrNTdlKZLMZE92uY5UCnWhw30jsLXH9SrgoyEeGRWM/Ik7XfTNqh83bZAWWbRMvtqNK5BJyR6Tzyh/CE8Od7JK1VEd9D0nwEmQwWt4T8AX4y9WYwD6J32bhmhhA= 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=gg15u71e; 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="gg15u71e" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t4JTcbNp+Wagg2SIneI8fYXiMNdF7Wii2BuVH7MOT/o=; b=gg15u71e+WM2iNCQqtOVZJm4tWewh21xCq/j8qgu5ohzGj4t1mNDnmS+4lwxdOhzpsRI2X dF1zwD69b2T44n/jxhciLAu0pqyQF4zw6T1XAZp7eKwBL4Qw3XeYLFlOiQlP4zFuw8MwYM z/Iea5Y7lLDXzb1lCBN2NkQfmSXIbcE= 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-215-Blc7tbg3PxGNqRWE7pvg3A-1; Wed, 05 Feb 2025 15:10:47 -0500 X-MC-Unique: Blc7tbg3PxGNqRWE7pvg3A-1 X-Mimecast-MFC-AGG-ID: Blc7tbg3PxGNqRWE7pvg3A Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5009A1956096; Wed, 5 Feb 2025 20:10:46 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EAE6519560A3; Wed, 5 Feb 2025 20:10:35 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:04 -0500 Subject: [PATCH 08/12] drm/stm: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-8-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1618; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=Ic1nlkPD6Mj8TJZ8m8wZ6mlAKj2uSChvdOZ/TLjamAU=; b=adLjfrtU6tC9pfV0EExepCHd/cHlwcDiR8sbt1XjWIwBum8LAHOiRxCD/EMVGcFQQXziRnb29 x8JlJrZjb8PAYAdaE1cgkvNZAkDkmELMURVlIvw+29XV+XY1nLcY9NG X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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: Rapha=C3=ABl 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 Mon Dec 15 21:41:52 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 B2932215062 for ; Wed, 5 Feb 2025 20:11:03 +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=1738786265; cv=none; b=uRtsiOf0sOaGKkkxPlBLaWpiSpUjjjDLDb6/wjovAUNzjHc0lftyb6JfdRGlWsAaKXByQyyQPKiEGgbDXhHr4SXCqmt54/czjUw/UaqPp2iBZvSX5jICiZAsKRGFKHtVKsoD0rET5edWBi/wu2I+zhWrievJNEepGo0xBgPXNVU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786265; c=relaxed/simple; bh=66gfH4HaVcJzuzQX0NHIOkeT0eso2EOo8AHIoNrPiQ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KNVVc7WM6a9ZQH23oESSv38HJUze3TtlTcel97ZUlkjnGNLTlur07BKhtFOXJgeVyWXLmpfObramHsSwf7nLMn0lRYT5yKJPgP6Am5xNm48yzvHLvCXcJ9rIHlIBcYbc+TrvHBrKKFCgANJsquN5sIC7NRc2C/PdNnJcz+esLPI= 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=jKicB4cE; 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="jKicB4cE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786262; 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=jKicB4cEtXwWiHo8KgvE0b3NyTlM0q6lpmvoqypVhhlv5cJ5sS3jbl/YgfhzV47/2rFzsG tNbsaAKrJrawl+BP5gy132ZA2nYIKDSLythq3D0ChT6J0Kw3nt/Y+EXjYsY7SDF/D0cKbO QueW984lXMdlLpJEkbAXS+pNCqLh6Xc= 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-492-CoVVi9HsMRyJys07a5LtpA-1; Wed, 05 Feb 2025 15:10:58 -0500 X-MC-Unique: CoVVi9HsMRyJys07a5LtpA-1 X-Mimecast-MFC-AGG-ID: CoVVi9HsMRyJys07a5LtpA Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2C003180087F; Wed, 5 Feb 2025 20:10:57 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A058B19560A3; Wed, 5 Feb 2025 20:10:46 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:05 -0500 Subject: [PATCH 09/12] drm/tegra: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-9-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1560; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=66gfH4HaVcJzuzQX0NHIOkeT0eso2EOo8AHIoNrPiQ8=; b=M6WZh0GtYS5B4deJ9B3qzO3qNws7WyKrJNpqYJygKF9Hd54wmE5lZ9VrSBMuunB4vSfrq/v+B aoMAifGb953DS/z3pxTMJycEfckOvMXSVVatw6+5DoXKTwZ0HpUpzbU X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Mon Dec 15 21:41:52 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 0261321D00E for ; Wed, 5 Feb 2025 20:11:14 +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=1738786276; cv=none; b=M0x5MyVfSd9RUIrVaEj18iiplx/S5Fggd/5SEpKUYtJ2VyEAWh4d5ohOFF3k/t6KcR4kV6utdDTWr7bK4nmESUBBXzHiGyz2XInkmqB84O6hrQEoQ49/Y9mMqyrOM9JkCOEjKqd1dgiPkp7SKHWMdY/2YqW4tJukU/6kFQ8eZ8Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786276; c=relaxed/simple; bh=7+Q2lsuHInmFMU6F4dj3qB4yNCyOo0pZ9W9kufCkjVw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uym2eHgDSe/pYkKHrHGcEtO5GPJYQcKRfBQj9dJtYJGE+dJbitMsSV0o7ZOyoqF7D/OOyDMOFgB2bkVR47NSKiDbRJ4OaNjlql+bxAtY3//vEAne2gisTB/DnIt1yvdVP5WXatws/hrhFAOSnTJmnFJviT902rxsxsirRCl2Yd8= 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=Cm44ddxb; 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="Cm44ddxb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786274; 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=Cm44ddxb2OKViHdwzseSVHNaWLLRGZpT50zaTasGgYwCJ+DRLOKzJTM8fUTU2VKhy6jRGA gRVJzKE2Qoqwdoz+KgBT/Q51qjqLHE/vg+XCrp1fLNe9JQVRcug/Czmy+tzeOS1p/RdkZP TNOSsM08bFAJ61ZcTDqGZJU1k+cpBuE= 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-357-3WWc_lScOwmw5O8Fu9VkmA-1; Wed, 05 Feb 2025 15:11:09 -0500 X-MC-Unique: 3WWc_lScOwmw5O8Fu9VkmA-1 X-Mimecast-MFC-AGG-ID: 3WWc_lScOwmw5O8Fu9VkmA Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B462D1800985; Wed, 5 Feb 2025 20:11:07 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7C50519560A3; Wed, 5 Feb 2025 20:10:57 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:06 -0500 Subject: [PATCH 10/12] drm/tiny: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-10-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1744; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=7+Q2lsuHInmFMU6F4dj3qB4yNCyOo0pZ9W9kufCkjVw=; b=760bfuqeQwB2H7jkE4dYuBDK73EXGEZNFWeKXn1Of96MzG/gKvOtfpspbFSJECAZcDlGGB/p8 CY4DM7EBirEA1qRG0o0TqcMkXSTVS6lZYO5NB4/ZPvsibEJrpSbIKQu X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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 Mon Dec 15 21:41:52 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 135EB213E7A for ; Wed, 5 Feb 2025 20:11:24 +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=1738786286; cv=none; b=EZoPpOmk8jebAYN9qTskiLoZvXLauq+X9lCh6A6T1rUGjlbKVlEZMUHRGrhRTXFe+Nhi4LtS9bZljyIy9uEst4xqfgdHngk/grDTG4+WwAlhjv3YqwELEFGUrAn4z0sXBT3hWNN2ngswCfH81xKZCizMm6Oz7PMY9O4NOcj9qPY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786286; c=relaxed/simple; bh=cGR+PxRoxuebICENqHulDwycMVIkKhLPFIEGSESALX8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rYo6gPjtXGCBiMmvsV7ltQ2Xv5gkvXz+4oO62kU0OLpVWYYXVeUmsmyCwd84IwuhOXTUuE78V+XKc1F4LVcuXHn9xm54u6LqxIMZZW1CHXogw1MbKZBBCDpFokwWFmhO7GEUmQw/Q/pPfB6Zj698M0bdRYIAbzxr4MxgeUgbrio= 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=PJpMMfkk; 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="PJpMMfkk" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8SyjCwbf1S+bcTHNMqbzrT6yhS3x+rdZOVYONTdbbck=; b=PJpMMfkkln68l8yinvmlRGbP5YBgyDwIR+kmIMYYdwzbecVe5nQ5ACUs2znu0n7PQelffy WxjLVFlq7QG7raIpJuPbUpRU6H3t5oD3hxMTyCxGNzj9jShtCpGyjFhVN5J1IVL1wtI/qq qQZz+Gua+VxxzVintMI7jNJwFNdANQQ= 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-80-AWQ7tzLjOAaXW9NmuB0QCg-1; Wed, 05 Feb 2025 15:11:20 -0500 X-MC-Unique: AWQ7tzLjOAaXW9NmuB0QCg-1 X-Mimecast-MFC-AGG-ID: AWQ7tzLjOAaXW9NmuB0QCg Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 25FB81955BED; Wed, 5 Feb 2025 20:11:18 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 101D519560A3; Wed, 5 Feb 2025 20:11:07 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:07 -0500 Subject: [PATCH 11/12] drm/vc4: move to devm_platform_ioremap_resource() usage Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-11-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=4051; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=cGR+PxRoxuebICENqHulDwycMVIkKhLPFIEGSESALX8=; b=xxdVwBWLuMEiypVjDD+SjdlJr+E3FmnnKe4+6mwyq3Jsp3b2JeAXfuUeFeYrD9tkleRyn4M2I gZ+0ny1k2KkDDtUMVDgoa4/Gelwzs4xPuw9i9ORgjvf4Shdft9gP0bC X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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. Cc: Maxime Ripard Cc: Dave Stevenson Cc: Ma=C3=ADra Canal Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/vc4/vc4_hdmi.c | 55 +++++++++++---------------------------= ---- 1 file changed, 14 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 47d9ada98430634cfd8c1e21c2a4d00d501bab7e..066f1246dab420ee889845b0c57= 3d80ce7c88595 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2951,71 +2951,44 @@ static int vc5_hdmi_init_resources(struct drm_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 - res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "hd"); - if (!res) - return -ENODEV; - - vc4_hdmi->hd_regs =3D devm_ioremap(dev, res->start, resource_size(res)); + vc4_hdmi->hd_regs =3D devm_platform_ioremap_resource_byname(pdev, "hd"); 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 Mon Dec 15 21:41:52 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 BA25F21519B for ; Wed, 5 Feb 2025 20:11:33 +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=1738786295; cv=none; b=ja0nOGVhBg58BSvDJahdf69ksIzVdbQJscOGtijcvmL+QSAFB6Da4zVKw++3LZagPvFUpG/Pnq3Bn9Q3UTmSOSkKfjsGrUnkYCmRYq6138oUXEfUcOQG9ZtAUPul7eGZmcxY2JXOfB7/4bAt9ByDk30guaXoeegmPc2afrJz+VE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738786295; c=relaxed/simple; bh=8E/zDOS2y2jXYtpxt4v/XPpri1L2d3Hp1icGGz6XyLc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iv8iREwsRrM8IG5pmAkL6xTi5sSdxdqAMWYfeZeMmxHD01vYH4hryztQxWL2042AZtOXVnJfEqQN9Dr3JqUYPJz564EGyaofSrKKmy7lz+EKZrXk7pOZb/MVJR4J2m1b1ARe3Pj/SWRJjmKvi3qKtYb+5oFYys4eZfwTCek6Ya8= 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=dmC2pNez; 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="dmC2pNez" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738786293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZN6lOxdYMjUO49jm3bB80agqHnejl+uLnWAidVCm81Y=; b=dmC2pNezxfC1HFLdmx2hLWZu3JYdgc84YzoNXhqRBkc1resSte24kOeIPvSZMu0ssiz+vh 8Vy0loIS+O6FjxPatdwSHM4A2xL3Yo57cERoE1zb9JijXjKd6iqPqeH+BwrCnnpn9U4r7+ lJFYFZ0bI4Mio5qK22Cqc0XQs+rg2Ps= 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-203-YMsvCcTaNh6CgTP5AJz4Lg-1; Wed, 05 Feb 2025 15:11:29 -0500 X-MC-Unique: YMsvCcTaNh6CgTP5AJz4Lg-1 X-Mimecast-MFC-AGG-ID: YMsvCcTaNh6CgTP5AJz4Lg Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B9EF61955DB8; Wed, 5 Feb 2025 20:11:28 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.17.21]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 760DD19560AB; Wed, 5 Feb 2025 20:11:18 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 05 Feb 2025 15:08:08 -0500 Subject: [PATCH 12/12] Documentation: Update the todo Precedence: bulk X-Mailing-List: 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: <20250205-mem-cocci-newapi-v1-12-aebf2b0e2300@redhat.com> References: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> In-Reply-To: <20250205-mem-cocci-newapi-v1-0-aebf2b0e2300@redhat.com> To: Joel Stanley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Andrew Jeffery , Stefan Agner , Alison Wang , Xinliang Liu , Tian Tao , Xinwei Kong , Sumit Semwal , Yongqin Liu , John Stultz , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Marek Vasut , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Orson Zhai , Baolin Wang , Chunyan Zhang , Alain Volmat , Raphael Gallais-Pou , Yannick Fertre , Raphael Gallais-Pou , Philippe Cornu , Maxime Coquelin , Alexandre Torgue , Thierry Reding , Mikko Perttunen , Jonathan Hunter , Alexey Brodkin , Dave Stevenson , =?utf-8?q?Ma=C3=ADra_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-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, linux-doc@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1738786137; l=1470; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=8E/zDOS2y2jXYtpxt4v/XPpri1L2d3Hp1icGGz6XyLc=; b=kvdtINpTCFoOpfqXf/fVrI+PlDBH109lqvGOt8aqdxgPNRLHbndphfZbHS68h26FBvlE/Lev1 rwTEVkvxYkZBkVPbSaO6vTBgPPPOtlnOVyP8CR4ue3yQ+gZM3xTUog2 X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Update the Documentation to be more precise. v2: Update for clarity Cc: Thomas Zimmermann Signed-off-by: Anusha Srivatsa --- Documentation/gpu/todo.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 256d0d1cb2164bd94f9b610a751b907834d96a21..03fcd086889acbd1294669b2602= 92ffc79e97e2f 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -441,13 +441,13 @@ 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(), -pci_request_region() or similar functions. Use helpers for managed cleanup -where possible. +Old/ancient fbdev drivers do not request their memory properly. +Go through these drivers and add code to request the memory regions that t= he +driver uses. Problematic areas include hardware that has exclusive ranges = like +VGA. VGA16fb does not request the range as it is expected. =20 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 2.47.0