From nobody Wed Jan 22 09:58:17 2025 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5D3B1F8673 for ; Tue, 21 Jan 2025 21:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494100; cv=none; b=CCf6muAcuAnsPGNl1RA7j++NUuDKN8et+WWtlSOq6P6uidXrhBf0vRebFw+3Mu51g1D//osMRqM1HAzLT7sism7bn31fyHmwXPAoSM7W6uCuG9aAHtD9+byp+x4yXJKEpN5QcpvRewIFKSRIhyB6QRt76BtedcGXmMsT9SD9vuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494100; c=relaxed/simple; bh=zrzukfd2RSwrlmdRmszMLWOu2Hr/r69/z88bNUjZyEc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dqAa319gWIyIk/mOwIydyeRG23fBGbfAQGUj0NSBSkadEPkWW1y2LykNdWeXgMKr4wa5HzbZ1UeyW1B7q5XcNadII2Y4FevGl51+M3M4rd8/V4FD6FQLWxeODvR2RGIWAtIrLS9nIwWLUrAwcEzokM6qkR6O0778O3+cAqXj7yA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=dcavbgJ/; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="dcavbgJ/" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6d896be3992so44492386d6.1 for ; Tue, 21 Jan 2025 13:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1737494098; x=1738098898; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1rVEk0Dr4duA7/mRQLTXbAYgAr33LOipnA2cEKQfgjg=; b=dcavbgJ/PlCBN+f2NFcb/sRWK/nA90h2sFl2NXgxHquL54tapS9LM6zbb7MPtbITjG SYRLne3FFGDhORp4OiGpNxfis3Xg4CSGHHnVbnsQc8254BJw0OOu6mo7x7NEVrMVagpv AIfkLmo8oSdiez2aFk7QgZ6oS2rxhG7/qdcyE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737494098; x=1738098898; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1rVEk0Dr4duA7/mRQLTXbAYgAr33LOipnA2cEKQfgjg=; b=hyfaXGdiGo7SvVLJlZii2bhb1b9VCoEr/Vk/Iws8Nmk7MJEGVsROKVYn0xUBMjnAaS mg4K7gNx1MKYBgwwzLWOSS8MTETpvLmELXR1vkkyALMWkgbKW6u5fV+76qtVM+z6UMtU jxrI2k7m1+/6txsryfOw32cfOZz2we420K4lZUsMt9VB6qFkntuREok0L5oZ4ErY+xMR SerVP1bmTgNB0YndUzQ1xKl7T9VbKLCuG/7G2xBnWzLX29YW22mc5jv3DWyvFfL0uh7q uTU1CMfOkIjbbjUrFeWQ40J9rZTswI97R2HTs9ocUJ0Qm7CWSmZoAAFfNZpOPJ/Xgy+6 HHLw== X-Forwarded-Encrypted: i=1; AJvYcCXpLCyRzmOQjMv0SpPosh9HybLEoLg96bwPRVuVsLg3FPY1Oxy3EN6pfUs2c2hsvOTXxjBBDEBImdRFr6U=@vger.kernel.org X-Gm-Message-State: AOJu0YxecjpugESjKO9K4T+9HqdPGvlCkalt6EYRYMe/XrST55Kbgcfa X6CAvldjD4zJN5Tc7UKqwv6QEbLFw4wUuZ1kvc7wdIsAo8ZCmutD8onmpPIXOg== X-Gm-Gg: ASbGncv9hTAAI3XsSB/hzEgYBIbnt5stkb/wy8+Qgo1DIenxdJu8XCtPunmRzuFJpl2 CJ2K26TR9rfAhw6pv8MYSDAPQc1NX8NpxMoDXlvg0hpZLWdrP/MBcGgJgmrKaixC2FNYRnpnJb7 rn92lSA9RxOePDVWyTaTtuzqgBtN8YrrsVmbcxf8Op5z1ZmUVqI3oJyJcgIXkVK21Go0arwW/mm I9SBaWQ/OvFsydquxRZtYskm8RR+EHQrZlM+v/IJZXjfqL7UoqC2pOAzhhUTlOyyc96Se7sERBT k/ht1kC1S96KuHFAe1ecEtHOShTM5pZnz931Bky3S3KhnzqdUA== X-Google-Smtp-Source: AGHT+IH+AfjXa1HWP93h0DvJI7kSSGAfNsF6+75hu7mgbzlxXWv7+fIY3EtnqV1a4Imfwy4GAdj7Jg== X-Received: by 2002:a05:6214:762:b0:6d8:7ed4:3364 with SMTP id 6a1803df08f44-6e1b2168b97mr263725776d6.3.1737494097728; Tue, 21 Jan 2025 13:14:57 -0800 (PST) Received: from denia.c.googlers.com (172.174.245.35.bc.googleusercontent.com. [35.245.174.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e1afc28f84sm54790186d6.63.2025.01.21.13.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 13:14:56 -0800 (PST) From: Ricardo Ribalda Date: Tue, 21 Jan 2025 21:14:50 +0000 Subject: [PATCH 1/4] media: nuvoton: Fix reference handling of ece_pdev 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: <20250121-nuvoton-v1-1-1ea4f0cdbda2@chromium.org> References: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> In-Reply-To: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> To: Joseph Liu , Marvin Lin , Mauro Carvalho Chehab , Hans Verkuil , Philipp Zabel Cc: Marvin Lin , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Ribalda , stable@vger.kernel.org X-Mailer: b4 0.13.0 When we obtain a reference to of a platform_device, we need to release it via put_device. Found by cocci: ./platform/nuvoton/npcm-video.c:1677:3-9: ERROR: missing put_device; call o= f_find_device_by_node on line 1667, but without a corresponding object rele= ase within this function. ./platform/nuvoton/npcm-video.c:1684:3-9: ERROR: missing put_device; call o= f_find_device_by_node on line 1667, but without a corresponding object rele= ase within this function. ./platform/nuvoton/npcm-video.c:1690:3-9: ERROR: missing put_device; call o= f_find_device_by_node on line 1667, but without a corresponding object rele= ase within this function. ./platform/nuvoton/npcm-video.c:1694:1-7: ERROR: missing put_device; call o= f_find_device_by_node on line 1667, but without a corresponding object rele= ase within this function. Cc: stable@vger.kernel.org Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and= encoding engine") Signed-off-by: Ricardo Ribalda --- drivers/media/platform/nuvoton/npcm-video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/pl= atform/nuvoton/npcm-video.c index 024cd8ee1709..7b4c23dbe709 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -1673,6 +1673,7 @@ static int npcm_video_ece_init(struct npcm_video *vid= eo) =20 regs =3D devm_platform_ioremap_resource(ece_pdev, 0); if (IS_ERR(regs)) { + put_device(&ece_pdev->dev); dev_err(dev, "Failed to parse ECE reg in DTS\n"); return PTR_ERR(regs); } @@ -1680,11 +1681,13 @@ static int npcm_video_ece_init(struct npcm_video *v= ideo) video->ece.regmap =3D devm_regmap_init_mmio(dev, regs, &npcm_video_ece_regmap_cfg); if (IS_ERR(video->ece.regmap)) { + put_device(&ece_pdev->dev); dev_err(dev, "Failed to initialize ECE regmap\n"); return PTR_ERR(video->ece.regmap); } =20 video->ece.reset =3D devm_reset_control_get(&ece_pdev->dev, NULL); + put_device(&ece_pdev->dev); if (IS_ERR(video->ece.reset)) { dev_err(dev, "Failed to get ECE reset control in DTS\n"); return PTR_ERR(video->ece.reset); --=20 2.48.0.rc2.279.g1de40edade-goog From nobody Wed Jan 22 09:58:17 2025 Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C1801F8913 for ; Tue, 21 Jan 2025 21:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494102; cv=none; b=kUurIc4LBopNwUO60uvTcQhUoggsS4ltVP5YCHiv/bzTJmaHz3MS3cQdlsgfDD9ZV6BeGlhVB9VB2qWsShXGnCUn0TYBFH+C2Gk742G2/1vNn9QKwK2j/4NAk0jOinQTUmLDJeJyLJR32D2mRW+wS7Anl+7ej4AjnJ5jEyjaMvM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494102; c=relaxed/simple; bh=LyRuB8tAdiqBEUlnUkNNhNkm4Ba24Qlh5k9HJRNz30o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oRPnKBCBdK1O3S7vLG0HJxXIsasd9ULTRyQSy37kRYMTz56ADY8FNOsedOGsR9jU7CgNSgR9xXf7akWSv7FdNHC5FbCB1aVNJWJGdOYlH0PnfnrI9YAVlMlK7vSwgPHemtTMOdznpe9/4oNI7Bi8COe67iCrDa6nBVWb9tj7C+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Ub7PetYP; arc=none smtp.client-ip=209.85.219.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Ub7PetYP" Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6dccccd429eso56200096d6.3 for ; Tue, 21 Jan 2025 13:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1737494099; x=1738098899; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YKIWMYbFrbAqwI1LUECt3RJuovYReI3o7uvAyeGPPzQ=; b=Ub7PetYPHpvycfl+SO+DvKyHOl0tdhn9hxO1Gxu7M6iyxsFZ/bkUlnX6hzCmsWk+XR JJZ71a+wCQf2kXyHsuukXsvUiCPZ6U6zkXwhgmNpKIx0BqVx3Oazl9GQfrJ26LieXxTY QxjrBS5hl0XWsSvlN1mTt2T+F9hBq/fgN8M6w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737494099; x=1738098899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YKIWMYbFrbAqwI1LUECt3RJuovYReI3o7uvAyeGPPzQ=; b=bsjTgPsKTBDVJhHtE1SzV/OyKs2LgG12QdB/SYEVUMfhlLgQDcY3rjBPz5GRgpJYF/ 9K/t2PHO0jIyOPW/BWHW7JIhKUE/vDSAC5QzIXr5wpXiWgkEu+AdTf7+2wPq+sfRsVwA WYp/K96K2rdCCAA7zmk4IFww22h2ZmOu/pOlU3UhNyKKFFfbxz2PBs616nZ3IZHLkOrL bi/GKz30RgKPvs5fhmrOKeUaeBvM0fK5CzOhz7n+WkVxsg/1zj4dK8TOsaMLfDus2VPI bEMLz9uZ79AZbBF5UuvUerp+Et22v2OF1igc+LoClwxV/hsEDrq5nVYbHJtmz5iJr8kA LvBg== X-Forwarded-Encrypted: i=1; AJvYcCVoBr+zIDRtEmlmBtsaPF9tJyS0nQD9fzrvdgUYAQrkkfYhsAIo+rteS++fvL86o7aUUYmHpyQiAxiNiZM=@vger.kernel.org X-Gm-Message-State: AOJu0YyjPtBOuj7E4qsFxvlyIXRH4Wm30UwXU1HXXLC8inXIauR1eF32 pijIK1lBwo8+G1ho/tFTJkYopjDFD2XxEJmsPq+L7EmckN4qKMSJRj8zPH/u5g== X-Gm-Gg: ASbGncsQWxsxCZap4TB1/r+aWJW2oQqus9EDCXtZIxLTmsEw+N//SyuBKIQAgJcFTB6 dgGtTFIXeJxi+nv59/6+xdb3VgERqkTOtC7/xdwXx37SkIZWB+AsZB/UKlmPbGl4rg+qMoSnLxw nlaWzLeJ+NoQHlixAgv1rHfRLWBOsRHLKji9ShPuiMXtXUAHaMY0rCSWfdjmGR0EnYf297MYr3m YofNQIi6REUiDpUqhLunGGEK+8FbGL3nL5pk+axELp2Rlipwl1B0w31QH9izwoTPLueDq8GnEcw kxqovxX8gI4MzMo2gGwTJBeSVec4Vs05eUaY24Oa+GXvkPJ+Jg== X-Google-Smtp-Source: AGHT+IGahO5uMTq52/oBAxLhuuA75vO0AMXdFYbDv0vle1LutgvuSuhG7TKF9rnDFYbC8l6q7rTkxQ== X-Received: by 2002:a05:6214:486:b0:6d8:95c9:af2b with SMTP id 6a1803df08f44-6e1b224ca45mr298377446d6.35.1737494099195; Tue, 21 Jan 2025 13:14:59 -0800 (PST) Received: from denia.c.googlers.com (172.174.245.35.bc.googleusercontent.com. [35.245.174.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e1afc28f84sm54790186d6.63.2025.01.21.13.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 13:14:58 -0800 (PST) From: Ricardo Ribalda Date: Tue, 21 Jan 2025 21:14:51 +0000 Subject: [PATCH 2/4] media: nuvoton: Fix reference handling of ece_node 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: <20250121-nuvoton-v1-2-1ea4f0cdbda2@chromium.org> References: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> In-Reply-To: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> To: Joseph Liu , Marvin Lin , Mauro Carvalho Chehab , Hans Verkuil , Philipp Zabel Cc: Marvin Lin , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Ribalda , stable@vger.kernel.org X-Mailer: b4 0.13.0 Make sure all the code paths call of_node_put(). Cc: stable@vger.kernel.org Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and= encoding engine") Signed-off-by: Ricardo Ribalda --- drivers/media/platform/nuvoton/npcm-video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/pl= atform/nuvoton/npcm-video.c index 7b4c23dbe709..f6cba17a7924 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -1665,11 +1665,11 @@ static int npcm_video_ece_init(struct npcm_video *v= ideo) dev_info(dev, "Support HEXTILE pixel format\n"); =20 ece_pdev =3D of_find_device_by_node(ece_node); + of_node_put(ece_node); if (!ece_pdev) { dev_err(dev, "Failed to find ECE device\n"); return -ENODEV; } - of_node_put(ece_node); =20 regs =3D devm_platform_ioremap_resource(ece_pdev, 0); if (IS_ERR(regs)) { @@ -1692,6 +1692,8 @@ static int npcm_video_ece_init(struct npcm_video *vid= eo) dev_err(dev, "Failed to get ECE reset control in DTS\n"); return PTR_ERR(video->ece.reset); } + } else { + of_node_put(ece_node); } =20 return 0; --=20 2.48.0.rc2.279.g1de40edade-goog From nobody Wed Jan 22 09:58:17 2025 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 094C71F7546 for ; Tue, 21 Jan 2025 21:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494102; cv=none; b=ubzuFu5rd8Hj83pL12GDLVuI/sRh0AZW+Tw93nvIX3q5diz0ggSHZOyGRPcLhQw+DldkypObDjw7ADVRnA6W5NZs4QQFWSRaYdGapKh0Qmxfr4E2uM9PLhof0Wb7kkXBxhKYxbD03Fs63THgm/NYysljfr6G60UA0LbNb7K7FFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494102; c=relaxed/simple; bh=tTQ8/1UIysiIGtRN5N7AVFPeTUIFvnP7hdQDtHKur8k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DCKc3ZSqfRRwDx98r6iqBX/AZtwTo5oS6hjgshV3R4BUPvQ72Cjc15NaZaB2Ydt6DF4HjWZNjEGv188fmXEYcsYh5ffkAmTE3lXzzjFqFw2PKJs+DEUhWxksIx8XeBnCD4crX35gPUYSP7qfgQl/NBnOOLkcGiNhF+/21XJbYrM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=AV9z6Ioo; arc=none smtp.client-ip=209.85.219.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="AV9z6Ioo" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6d8f75b31bfso56276356d6.3 for ; Tue, 21 Jan 2025 13:15:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1737494100; x=1738098900; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EDypBRxJvQaUqQoINiNHn6E1UtSb53KvENj6pqF6igs=; b=AV9z6IooxOHEPYoslE/9nMiJz3HRP3EGcoVDBq5TMRSuYhu3pHbzSkHLKYoN3wiJBr OU1fXlSWSmvmuxknEjz8MFZFHMi7jrlbxFeV0yu++h41eWj/3WYvgpUXy1yzDLhDIXas ym7VYm+DLeHpCMsWxN+nHq9+FAsO05kaSuEUI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737494100; x=1738098900; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EDypBRxJvQaUqQoINiNHn6E1UtSb53KvENj6pqF6igs=; b=PNko9GiMarFYC3trOQBWUxzW2JCiEyBCEyZwDuvEoNkM/tdhSpkF2uh4fBrDpl4YY5 Ao5d6CqxsP7iYtiRhXNSofum04k0XUQotjVbgHmrJTXQnXJIJ2oFd7y8V2XujjJVVyxj ZYgU6c1x0smuRlPs5nLzTbRuOGr4IoilXjcQuKez5pO91bwkfBdYhYc/6eyytjhvdA4t dFKEBOEenhyIjnwr9mhXeO3keahAik1ZjWdMRaUVx9ovU5GKEGmfmPkmUVddYtyIn7bO S/YIBVEOM+ZWpWR5sQFOxuLWD2X8WYNBKAquatYidJjdsZxpL1G96SjxBkDsuALUc7pe cVDQ== X-Forwarded-Encrypted: i=1; AJvYcCUE3aqw6qB8XiwSzPOvwXF23oVQBRNYq7vfWBCAOnTwA4D4tX+9mPB3NNWiRRSwLByULcgh9DzbkkVqE6k=@vger.kernel.org X-Gm-Message-State: AOJu0YwzfsmjOrosOBpvPz/vLdIzwfb8miwaaIXqPqepoXQWrh2Vub2I kXbtJz6no/w0fTFD+B6WbJtQEEP2ey7PVl6KHrje2GsZ0OdjE4460l5HN2OZiQ== X-Gm-Gg: ASbGncsJvmKdWeA6UbSxhG1uDQvfP77rZdwUdEjKWoWMnkwxsO8xcwp7nEKe8hOq5Wc VlqmxWwoxprUqAoC2LF7LBkVEX1R8qtAYPxNIST1vTpxjEQYGK9BDpl5OTOepKaJFLZlJYk26AO gzaHWayePGPZvlIqlftNzEg+6iV8p85oyGErVlXKsBn+TN7JqHw7LJjAmhkWqWmJfYZwN9PoEP4 H4R8XZnLO4K1DpGsBTuGPqH6I50xHvdYTt1HzNYz5FMTtz+FNrAKOKn1kNBrQqouInEwQRy/jUa Q/4f8Ha3s7KL/FKd7sZy5azZ6BLCQ+DpuXCKLsjtRL/2JKiRAA== X-Google-Smtp-Source: AGHT+IH2nW3HKiyhk/ib7bj/aH6TJVLtiNxwx87MHvq1Ur/SwGzlc6RDNTd7PprtRI9dniJmJVuT3A== X-Received: by 2002:ad4:5d6a:0:b0:6d4:215d:91c3 with SMTP id 6a1803df08f44-6e1b220e572mr291236936d6.28.1737494100024; Tue, 21 Jan 2025 13:15:00 -0800 (PST) Received: from denia.c.googlers.com (172.174.245.35.bc.googleusercontent.com. [35.245.174.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e1afc28f84sm54790186d6.63.2025.01.21.13.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 13:14:59 -0800 (PST) From: Ricardo Ribalda Date: Tue, 21 Jan 2025 21:14:52 +0000 Subject: [PATCH 3/4] media: nuvoton: Use cleanup.h macros for device_node 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: <20250121-nuvoton-v1-3-1ea4f0cdbda2@chromium.org> References: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> In-Reply-To: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> To: Joseph Liu , Marvin Lin , Mauro Carvalho Chehab , Hans Verkuil , Philipp Zabel Cc: Marvin Lin , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 Instead of manually calling of_node_put, use the __free macros/helpers. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/nuvoton/npcm-video.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/pl= atform/nuvoton/npcm-video.c index f6cba17a7924..8e69fa14433a 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -1648,8 +1648,8 @@ static int npcm_video_setup_video(struct npcm_video *= video) =20 static int npcm_video_ece_init(struct npcm_video *video) { + struct device_node *ece_node __free(device_node) =3D NULL; struct device *dev =3D video->dev; - struct device_node *ece_node; struct platform_device *ece_pdev; void __iomem *regs; =20 @@ -1665,7 +1665,6 @@ static int npcm_video_ece_init(struct npcm_video *vid= eo) dev_info(dev, "Support HEXTILE pixel format\n"); =20 ece_pdev =3D of_find_device_by_node(ece_node); - of_node_put(ece_node); if (!ece_pdev) { dev_err(dev, "Failed to find ECE device\n"); return -ENODEV; @@ -1692,8 +1691,6 @@ static int npcm_video_ece_init(struct npcm_video *vid= eo) dev_err(dev, "Failed to get ECE reset control in DTS\n"); return PTR_ERR(video->ece.reset); } - } else { - of_node_put(ece_node); } =20 return 0; --=20 2.48.0.rc2.279.g1de40edade-goog From nobody Wed Jan 22 09:58:17 2025 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F29F1F91E8 for ; Tue, 21 Jan 2025 21:15:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494103; cv=none; b=WpUp/xjHgNZO22a7ogQxJOWue8vU6xpyfrNmAv11e+Uk+7EGKDz24/Oj4OtTJ9x9UStGRTy1mmOeTOH33ANkCq2WdixKeLebZaIKqOTgPh2RflrjGfBJMjfNWZTxHfUjmkWHiEtMXcS3sF+YeWmwKOg45WMQFQBv0vPPGtW/2zE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737494103; c=relaxed/simple; bh=2nI2AcTo5FGfPAE799IDNWIsZ/sUcy0VR17PhcaK6HY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=flQZfeeGZ15uZcNyDt48Au5oWyhm4vwZCx5W2IDm26OO0BgUA/3qS7Y9BfJtchxNemgkbsnFHy/4+BUSewFDVdLPxLtD02JAy/syEaQjx8sDrWtzxm6ryzJYk7ejrKHOACNDxCSKZVvhuV+udmNB0/QQZp5Cm+f36MVvNTYmPcA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=jyDkYt8s; arc=none smtp.client-ip=209.85.219.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jyDkYt8s" Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-6d896be3992so44492856d6.1 for ; Tue, 21 Jan 2025 13:15:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1737494101; x=1738098901; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AWWHKFVC6UKJydJIK/G7foijQRC+Q1BFZCM05TTLGSQ=; b=jyDkYt8sFBqwzZjKNUEFVsPSqHABtwDdrpfuUGrw5B3NImQgF6NC6BiefXGf0f8GBn oHhtLGZkoQKR8AaKU9clXHqA4XqKv9hPuxw70Lyd7lv5H+GZb3zkfS2QJgsw+EfOV3hX 580FFpjdLwnGsS1qy39RcPKk2cE0HojpHSdks= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737494101; x=1738098901; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AWWHKFVC6UKJydJIK/G7foijQRC+Q1BFZCM05TTLGSQ=; b=ehkBTQOubBVxLLK8q7UP+CkaYaa68kLBa3PHT+Ce/k2+s4s3rP3tbrCVJobZYx1yJE WIE1qdvRMn9lBt1DP5sNnZ6EKi/9m0ktQH5GI2OWCfC+ve0XDKgOZuaUhOhtEDmtUqSe F67og4ezlraFYIS5FzXiY8Cr3As/3TvqkJ2Bk+0N8ArXNfyCJNL9Gkdsg/Z8sXAwyrhR Uv+Cx+HYiaep/eZ26IjHw3QHi4//22lBaM3jVMRsmTaDP+t0dkx9dFNRQln9mM22JjLm KW4r2NyFWuk6C/9I6hRHT5839jWfJD8ppfVbqOCFkLr5ydOdHVvqsZsmDAfja+jH5THA L6/Q== X-Forwarded-Encrypted: i=1; AJvYcCXpCIObv1b2KFbf8gVNu9U3T2VNgNEt34CJw3gLnArKZAeT0d73Fn7tDUQboAbL5rFPsboseO+JFsg4JIc=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5N16a1tUkVxhrzBVjsdO6VFLDhDobouymDZiPFK/aDAFltGYj 797GSei28C3qgSzuKrJa/7ogB77ZsIEI0a7y+rQ3vpcph+r97+1Jgfkm9bDqRMdphW/e4P6LUFI = X-Gm-Gg: ASbGncuP96OBeNtFxoZs8ntkaQp54vfCyMZzn0oZ7e5YvijpYsamMHosVsnGYtxiZDi +JtzWtayoE/lgcxb6JtQiOqwStqTLzGd42Lcdje3r4cPVcrN+dnNb5Ic0VhwUq4dtrlpIeF53zI DC4hZTteODhcxYHXmy40euIo+ZI5zqIddL+B2XcnB1pHpYoOouPSgidWqA2LBNflGZbhU5t9YzH GnSwD74VXLrOze6NqK7IcR/9AqR7F82w8uT+hKOLtgXfKm+9lj5RABoUYbXYJZo5oPVgJOdwjQG hyRsmKCSByu1FyJKOwkk36cbETdsUD8r7cghnnYIULT9sYQ2nw== X-Google-Smtp-Source: AGHT+IG3DsvcJCCgpRI2aTM0TBQe/diTS5TbE7HiFHeA/ESOV/zRmEEEPnnObFwVwY4g2OGPUbxevg== X-Received: by 2002:a05:6214:3006:b0:6d8:8aa6:ef27 with SMTP id 6a1803df08f44-6e1b2230914mr317755556d6.38.1737494100811; Tue, 21 Jan 2025 13:15:00 -0800 (PST) Received: from denia.c.googlers.com (172.174.245.35.bc.googleusercontent.com. [35.245.174.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e1afc28f84sm54790186d6.63.2025.01.21.13.15.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 13:15:00 -0800 (PST) From: Ricardo Ribalda Date: Tue, 21 Jan 2025 21:14:53 +0000 Subject: [PATCH 4/4] media: nuvoton: Use cleanup.h macros for put_device 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: <20250121-nuvoton-v1-4-1ea4f0cdbda2@chromium.org> References: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> In-Reply-To: <20250121-nuvoton-v1-0-1ea4f0cdbda2@chromium.org> To: Joseph Liu , Marvin Lin , Mauro Carvalho Chehab , Hans Verkuil , Philipp Zabel Cc: Marvin Lin , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 Instead of manually calling put_device, use the __free macros. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/nuvoton/npcm-video.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/pl= atform/nuvoton/npcm-video.c index 8e69fa14433a..7a9d8928ae40 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -1669,10 +1669,10 @@ static int npcm_video_ece_init(struct npcm_video *v= ideo) dev_err(dev, "Failed to find ECE device\n"); return -ENODEV; } + struct device *ece_dev __free(put_device) =3D &ece_pdev->dev; =20 regs =3D devm_platform_ioremap_resource(ece_pdev, 0); if (IS_ERR(regs)) { - put_device(&ece_pdev->dev); dev_err(dev, "Failed to parse ECE reg in DTS\n"); return PTR_ERR(regs); } @@ -1680,13 +1680,11 @@ static int npcm_video_ece_init(struct npcm_video *v= ideo) video->ece.regmap =3D devm_regmap_init_mmio(dev, regs, &npcm_video_ece_regmap_cfg); if (IS_ERR(video->ece.regmap)) { - put_device(&ece_pdev->dev); dev_err(dev, "Failed to initialize ECE regmap\n"); return PTR_ERR(video->ece.regmap); } =20 - video->ece.reset =3D devm_reset_control_get(&ece_pdev->dev, NULL); - put_device(&ece_pdev->dev); + video->ece.reset =3D devm_reset_control_get(ece_dev, NULL); if (IS_ERR(video->ece.reset)) { dev_err(dev, "Failed to get ECE reset control in DTS\n"); return PTR_ERR(video->ece.reset); --=20 2.48.0.rc2.279.g1de40edade-goog