From patchwork Fri Feb 23 12:59:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 775402 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 507657BAE3 for ; Fri, 23 Feb 2024 12:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693172; cv=none; b=qWr2zFcYvrOZOPrjs5kB/JaUy4Pn3rf3c9TVq3cPJ8FGsqcSFdb56Woq0r8D/i5bNbSWLrt+a6wAxRy7a5qqAu7FFqrF+UL+4/0YLOIkcXlDgKeJxjk6Yi0WEJfLu2810JX4KvP3TXJ8wPcDlfIpPa6wyMPvG48py5WBRHsRnjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693172; c=relaxed/simple; bh=6KDLoKf6mZzNDX/Q0mFCWqcKKweFt8H6FUi1gMldOeg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WeZVQhbGzLakCXExHD9F+ygpIVgs/WXJyPENLiA/3WzsVgh3jwWwxWbzipySwELCmrseGfq2cjUnGyhgTfTqWNKuF6NVos8y1u+qFK6MPEMw74fhiQOF+5aEAcCDX/2K8/VNukMyo/DlVAKpkVPw1dmYg+GPb5xwz9ZeRxAeXKM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdV9C-0005Vk-5q; Fri, 23 Feb 2024 13:59:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdV9B-002QaK-IA; Fri, 23 Feb 2024 13:59:25 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdV9B-00AKBf-1Y; Fri, 23 Feb 2024 13:59:25 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab Cc: Nas Chung , Jackson Lee , linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/5] media: chips-media: wave5: Convert to platform remove callback returning void Date: Fri, 23 Feb 2024 13:59:04 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1997; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=6KDLoKf6mZzNDX/Q0mFCWqcKKweFt8H6FUi1gMldOeg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl2JaduGL/BHYkF5ozhlNcW13lrMy6KqqvkstF2 InIW0iW04CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdiWnQAKCRCPgPtYfRL+ Tv/jB/9Y2cLIxlQSkrPm54LsOd/9mDZFXP4WZ9F7s/uf68m7Ci8pbNTj2LEi4rBTC+FPRsbOz96 m+j5abjiFRDWe5LF2T+9Qpss55qmg5mTe9Aka+7lhZtjrRzXtZEiJuJulSKQ40UtDBrS/edOND7 jxDYvUW0lPQyY9Aa88eM52paoKqAO97xVwg7HBDpTCkF2BZbUXD8cHnqlI1MlkGrBRCXQjzrVUF 6t9AMufGm7qMqGe3mFsCdoxsARg9pgOgy0F7RFAw1OmZPgvtlXnAOUDA0nx/Zl4QjG6eDbVEFp4 G5rZug0UGFlO0n/6SNuYiH0vZ+lMKbgCRIGOiVWNlOeeKOJs X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Nicolas Dufresne --- drivers/media/platform/chips-media/wave5/wave5-vpu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c index 0d90b5820bef..1b3df5b04249 100644 --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c @@ -250,7 +250,7 @@ static int wave5_vpu_probe(struct platform_device *pdev) return ret; } -static int wave5_vpu_remove(struct platform_device *pdev) +static void wave5_vpu_remove(struct platform_device *pdev) { struct vpu_device *dev = dev_get_drvdata(&pdev->dev); @@ -262,8 +262,6 @@ static int wave5_vpu_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); wave5_vdi_release(&pdev->dev); ida_destroy(&dev->inst_ida); - - return 0; } static const struct wave5_match_data ti_wave521c_data = { @@ -283,7 +281,7 @@ static struct platform_driver wave5_vpu_driver = { .of_match_table = of_match_ptr(wave5_dt_ids), }, .probe = wave5_vpu_probe, - .remove = wave5_vpu_remove, + .remove_new = wave5_vpu_remove, }; module_platform_driver(wave5_vpu_driver); From patchwork Fri Feb 23 12:59:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 775772 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 397557D413 for ; Fri, 23 Feb 2024 12:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693175; cv=none; b=LcXzV2ykDM5m0coFasLzLJN6l4rjr7b5887pni0xc1WNeHYcD2yQ6KVs2DGVlZnpKKvC0Ai5csSdlQ63FzmJFnMqThTdPs5Y0mwHg6WhmKpwQlEqMj2j6NPKiQsJQUbCkmUZpRYA/wJ00nUShoXptlhEPRQfD7HmQ1GwPw0Q6CU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693175; c=relaxed/simple; bh=k1QMieIBunEIOZi8P48RqEFigMM1q8GmcNTidnDO258=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Kp6LYgfrke4mV9+Y8F5QyMgrSuK2Z0CANy46Q7nmrASbX8RREl3FxmCLo/95I1T1wziiNi8DXujuTOVUsMjGbTgo4jEzev8/NNXahCNRnBQHbGpQsPSvq67H6AiXygiiQ76jRPj4toARclGQ4m67nJUAmP9Dy/9mkk5lPBJlIw0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdV9D-0005W1-4m; Fri, 23 Feb 2024 13:59:27 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdV9B-002QaN-PL; Fri, 23 Feb 2024 13:59:25 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdV9B-00AKBj-2G; Fri, 23 Feb 2024 13:59:25 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab Cc: Joseph Liu , Marvin Lin , linux-media@vger.kernel.org, openbmc@lists.ozlabs.org, kernel@pengutronix.de Subject: [PATCH 2/5] media: nuvoton: Convert to platform remove callback returning void Date: Fri, 23 Feb 2024 13:59:05 +0100 Message-ID: <21a291dc5ab4e21c380648621fea9de8ea55198b.1708692946.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1973; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=k1QMieIBunEIOZi8P48RqEFigMM1q8GmcNTidnDO258=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl2JaeXbyggXgi8IFWtbiV7XN3JGmmloq8ucrcJ Gyty73V0ZWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdiWngAKCRCPgPtYfRL+ Tkj2B/wM/+SfXNqRWlQg90V2FlGPB7iuSaQZvDRVwtWULuKYb82I4dsF7VO9np2oyQHrCoC1ObS E7pQ3peiJ7OjcI920Lboku3Pm/UEeiL0SDMpt0tAT6Vzxcn/s3QwsujVgCJrH/G5QZHf5K648i+ a0dPOoFAhXFuO6WEnzEZfnHgOHrzYqvk36m9A+TnY7cq+HX+GBws99OnUtC10AXvaFGwWmaNBVW e1cYbQYqOEQypiNB6QL1ovwrTnu6Oq+HsrRABf+bW+Ao1xljYHqqh36gOnjQGTbUA6WYo8BqL0r XKTH1IVY8Sn1M33i26qbhtyG1u+g3BA7gga8T8Uh5dgqD4kG X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- 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/platform/nuvoton/npcm-video.c index a1fcb616b256..60fbb9140035 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -1785,7 +1785,7 @@ static int npcm_video_probe(struct platform_device *pdev) return 0; } -static int npcm_video_remove(struct platform_device *pdev) +static void npcm_video_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct v4l2_device *v4l2_dev = dev_get_drvdata(dev); @@ -1798,8 +1798,6 @@ static int npcm_video_remove(struct platform_device *pdev) if (video->ece.enable) npcm_video_ece_stop(video); of_reserved_mem_device_release(dev); - - return 0; } static const struct of_device_id npcm_video_match[] = { @@ -1816,7 +1814,7 @@ static struct platform_driver npcm_video_driver = { .of_match_table = npcm_video_match, }, .probe = npcm_video_probe, - .remove = npcm_video_remove, + .remove_new = npcm_video_remove, }; module_platform_driver(npcm_video_driver); From patchwork Fri Feb 23 12:59:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 775400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 671427E779 for ; Fri, 23 Feb 2024 12:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693174; cv=none; b=G7CnSsIF9ricXfDGNtsgmW4eRd9E58EhLShXWGdhBG9Q2LV6S9nQlD9vdcojtlNwX6BqcjRSG285edgh+Nb5JbybopdNZugqUj+sqOOwc1eAFYs29KYnQbF7uqu1tatP8Ncwg9EsdvThr/bhwgfM1rW/lVELR4bayujj5sNzpOI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693174; c=relaxed/simple; bh=E7ixt9bejmqPsEXF4Y9G6SEIQ5e1STE67Lq1/1c+n9A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HOohWrm7Wrzn5EtmKmZWREKaKVud7te6ot3XHZenDJApqZIiZMErQabtomkf/XXhmHr4g9J5oVHxU5niiYXRXTS4r5mDG8Rkm8PH6DhtrGaq1Kn9UI5oY2J8zNlGCohNi7LeTFe7x/xc6Ol3RUJrmua+d89OHjI9CaTrnbcU1yo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdV9C-0005W8-EW; Fri, 23 Feb 2024 13:59:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdV9C-002QaQ-0O; Fri, 23 Feb 2024 13:59:26 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdV9B-00AKBn-2y; Fri, 23 Feb 2024 13:59:25 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab Cc: Laurent Pinchart , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 3/5] media: nxp: imx8-isi: Convert to platform remove callback returning void Date: Fri, 23 Feb 2024 13:59:06 +0100 Message-ID: <2ccfcae7bab286651fcf6deff988e23c5113ac22.1708692946.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1977; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=E7ixt9bejmqPsEXF4Y9G6SEIQ5e1STE67Lq1/1c+n9A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl2JagJXkMm7LYwx9xfCGyElXFSriLLDC9+0UiQ R8bb/PmHw6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdiWoAAKCRCPgPtYfRL+ TlB8CACQRNTrGnOtSKYPjUtNma55r8JlzQGu/zJ1VT74MAlqgbvfH43L7qoa5zw6oZho7NHfOAI ue1iFMv62rvfp8cLD2NAk4ZSzqAhY+svBCGz+nMJZlNmTSvAU4EcHoxcf1ZkV4UuhYyQtemehkt jHR5+9yCjhVq9PGt82UmLjP6BsEIp0aIxHHLu2ulBnajBU4VaMMrkRuPR0K4MmAcVpjoNMzUAYa ajIgWVTZxcNnjSE/cbvIaOag8uX8uqku6IrbxfuzfxpniP3k2tNhxjQgyx0g7K+Uco8VrF1EIwD WxsiMfZvfjRGkx2ZqE71o5DGq94wZrweTEbFLa3WIAX385iK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Laurent Pinchart --- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c index f73facb97dc5..c2013995049c 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c @@ -506,7 +506,7 @@ static int mxc_isi_probe(struct platform_device *pdev) return ret; } -static int mxc_isi_remove(struct platform_device *pdev) +static void mxc_isi_remove(struct platform_device *pdev) { struct mxc_isi_dev *isi = platform_get_drvdata(pdev); unsigned int i; @@ -523,8 +523,6 @@ static int mxc_isi_remove(struct platform_device *pdev) mxc_isi_v4l2_cleanup(isi); pm_runtime_disable(isi->dev); - - return 0; } static const struct of_device_id mxc_isi_of_match[] = { @@ -537,7 +535,7 @@ MODULE_DEVICE_TABLE(of, mxc_isi_of_match); static struct platform_driver mxc_isi_driver = { .probe = mxc_isi_probe, - .remove = mxc_isi_remove, + .remove_new = mxc_isi_remove, .driver = { .of_match_table = mxc_isi_of_match, .name = MXC_ISI_DRIVER_NAME, From patchwork Fri Feb 23 12:59:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 775773 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 07F527E595 for ; Fri, 23 Feb 2024 12:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693174; cv=none; b=GqsUtB7sn7IT2FHrNgHhyaHDtHr9/GafvjCRVJxZbbJ6KQCrX36vbE/sJ+JVN3N8IJNeb8MKTAiSXKJ9fD2DXIqLhcgD/uJViEmhgffKRqHe+hKzbB9KR3XXyghXVQUXOpktcDFxBV+jE/ow4Ae1D9tuJK4GIS4NXY6ANqQohPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693174; c=relaxed/simple; bh=cGnrBxqGxCmEtDuWxONLei27GY0x+yDrPiamFnG8NHg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NudV7v+P4HNMjDwQjGbcbN2/fS6PxdVcwwx1MIS8UCJc1qY4/qyDn9RLIGnjxRwyAXyPqRH+iJidBQE1YcMAzSYcQTBbVRV2+th0PucF34eOYOb3sscK15NH3buDK8YFWE0DHyVrapNzjezCyqKUNlhd9IZOZa4LVLiGyh2xOmY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdV9D-0005WK-4S; Fri, 23 Feb 2024 13:59:27 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdV9C-002QaT-6U; Fri, 23 Feb 2024 13:59:26 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdV9C-00AKBw-0M; Fri, 23 Feb 2024 13:59:26 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab Cc: Hugues Fruchet , Alain Volmat , Maxime Coquelin , Alexandre Torgue , linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 4/5] media: stm32-dcmipp: Convert to platform remove callback returning void Date: Fri, 23 Feb 2024 13:59:07 +0100 Message-ID: <7e85adb3c2f11fc10e5a18bb341c5af8b35c4d88.1708692946.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2028; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=cGnrBxqGxCmEtDuWxONLei27GY0x+yDrPiamFnG8NHg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl2JahwqaMRF1CPxbj1EwCu77uTj4TmU1PEFAv0 XDuPOLeA6mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdiWoQAKCRCPgPtYfRL+ TvIEB/wO/V5+nBYCIwEezMcTGrxF/tGJ/B8e/Tpc+wD+9fdC08TczkaX3SjLpKbKXnUBz1gFtSF eSgmgjBxElnAHO8nk9zwJ36R+tTm3zouqkIPCJ9x5oOVZFTqHXWl2hkqZJ/eOBSLZ7O76LQdicn 7pJXhibFTOEsnBgJhYP5225xLWw99rc0uxtq2RV7ycJ3KqlbbSoxbuc06Dxy2yg8YJkJuYvWLat 8mB8DZ6OHnK2nY3DBQUgnPfNu6zdBlWqRGTgTSMKPzOh91wSSNgxttjlXhPA0TJwf+IAyrs5tTO 4yAdjF6oXbhvr8pgTbOMcOXlVabbFgqgVOkVUJ0h6ebidEfK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c index 32c6619be9a2..bce821eb71ce 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c +++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c @@ -517,7 +517,7 @@ static int dcmipp_probe(struct platform_device *pdev) return 0; } -static int dcmipp_remove(struct platform_device *pdev) +static void dcmipp_remove(struct platform_device *pdev) { struct dcmipp_device *dcmipp = platform_get_drvdata(pdev); unsigned int i; @@ -534,8 +534,6 @@ static int dcmipp_remove(struct platform_device *pdev) media_device_cleanup(&dcmipp->mdev); v4l2_device_unregister(&dcmipp->v4l2_dev); - - return 0; } static int dcmipp_runtime_suspend(struct device *dev) @@ -588,7 +586,7 @@ static const struct dev_pm_ops dcmipp_pm_ops = { static struct platform_driver dcmipp_pdrv = { .probe = dcmipp_probe, - .remove = dcmipp_remove, + .remove_new = dcmipp_remove, .driver = { .name = DCMIPP_PDEV_NAME, .of_match_table = dcmipp_of_match, From patchwork Fri Feb 23 12:59:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 775401 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (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 3979B7E0FB for ; Fri, 23 Feb 2024 12:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693173; cv=none; b=MGCStCclES/+UIYYI93D5uge98jxOSevqQMTX5qk/Md54KUGA9EKyoMd4OTKBDWNnXqGbndMRQ1NyXCXkXWR3C067lMIOqurGPAzzIJgWGoj0ICgKkLiPqUVUvsYoXyXnJGp6hDjXZJDV1FX1FsWNUeZz5ni1LOXnvDn7dNhDa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708693173; c=relaxed/simple; bh=VJMVlrS16drlOOGwbgU0Ipy8a/X2XtrdWCXFGVSA314=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KqKdfg4/IBJAL4xoVq60+0DSO3hKHUtc/MdWWaDBNrZ8mrFS7OIFKR8tcwrmVwSI4ay7kz8eQHBmVp/DRdkMfivUJnvkAfPxtbJxf/4izkcq8H391Gyd10CphhIB/ei0RYgjHth9SF8lWDZHcZwKZaS2KmtYOE38xe2FxMJF87I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rdV9D-0005We-7v; Fri, 23 Feb 2024 13:59:27 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rdV9C-002QaX-DR; Fri, 23 Feb 2024 13:59:26 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rdV9C-00AKC0-15; Fri, 23 Feb 2024 13:59:26 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab Cc: Jai Luthra , linux-media@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 5/5] media: ti: j721e-csi2rx: Convert to platform remove callback returning void Date: Fri, 23 Feb 2024 13:59:08 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1997; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=VJMVlrS16drlOOGwbgU0Ipy8a/X2XtrdWCXFGVSA314=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl2JaiJcW73diK46Yovq0fxV8ISHkTBBN2Zcplh 74lJ9e/ZeCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdiWogAKCRCPgPtYfRL+ TmKQCACmNheh1VEeSDhnnaLYgwLvudtoUX8v4Ez0xJQKv015VhCsnidjH+dMruFLpts7cNGD+Gs k1s8pPzRObrHjdbUMcUjcsb2QFkZhg9QoSoFZPCh/XBOmavui8T1IGdG6s39syeaSGA9g8R0bjW XWzdzr3edqZTiSzNKkWxVZtxFDyVHWVpO+iUp0qDXxrOU3VrJWgHyHE1JSL1EuXawk0yRtpIw/F ZYK9hOPmI+4sLjUfwwe8jZ17QAsnakX6o2JlWdhKY+PkPj7CGkqAnZCEgqgwwcOTz4j45639oJB hEUVcv0v90epU2D5Xn9MqBhASKcYUPBxXO1TuJrJgMD8Ppa3 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c index 54aba055c96b..6da83d0cffaa 100644 --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c @@ -1142,7 +1142,7 @@ static int ti_csi2rx_probe(struct platform_device *pdev) return ret; } -static int ti_csi2rx_remove(struct platform_device *pdev) +static void ti_csi2rx_remove(struct platform_device *pdev) { struct ti_csi2rx_dev *csi = platform_get_drvdata(pdev); @@ -1154,8 +1154,6 @@ static int ti_csi2rx_remove(struct platform_device *pdev) ti_csi2rx_cleanup_dma(csi); mutex_destroy(&csi->mutex); - - return 0; } static const struct of_device_id ti_csi2rx_of_match[] = { @@ -1166,7 +1164,7 @@ MODULE_DEVICE_TABLE(of, ti_csi2rx_of_match); static struct platform_driver ti_csi2rx_pdrv = { .probe = ti_csi2rx_probe, - .remove = ti_csi2rx_remove, + .remove_new = ti_csi2rx_remove, .driver = { .name = TI_CSI2RX_MODULE_NAME, .of_match_table = ti_csi2rx_of_match,