From patchwork Mon Mar 11 21:49:52 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: 780612 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 669E657303 for ; Mon, 11 Mar 2024 21:50:08 +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=1710193810; cv=none; b=DccWaM9DvbJEO7yXt9loRgHYCkku0OdthsNZ6luGr20CmKYzZu8VAYou/Zd7WeeFP2rXzi9HVolbTLrGzERqYVmckiE3f1KfAjPzJpxPAc85XAXzcZIoNZIHLuQoA3nLMcqka9R2+PxTwY1FX/U4sF8aNekRVmu5WVc1gEztdVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193810; c=relaxed/simple; bh=siklY8AyTepBDoVjY5hu8J7Bk3TQfvEqwxIzIKqkXfM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Np1CMKyTzqdZZduwsrMRd62CU1xbA+ITPP6HMLKptJpdP0KVHkpVFKJjy4wO/0JLr1eG3txDGMYajRbKhtwUbG/foSj2/5CTrZHu//TyhNzJjfuq2x/Qb7+itbSm4vWSfo8cl8hgzynQrgrDcM3666jwJjPFTLzKD7sj9zCn/w4= 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 1rjnWz-0003DX-Kg; Mon, 11 Mar 2024 22:50:01 +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 1rjnWz-005nDk-5d; Mon, 11 Mar 2024 22:50:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rjnWz-004IoU-0I; Mon, 11 Mar 2024 22:50:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marcel Holtmann , Luiz Augusto von Dentz Cc: Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/3] Bluetooth: btqcomsmd: Convert to platform remove callback returning void Date: Mon, 11 Mar 2024 22:49:52 +0100 Message-ID: <0707da8c41e85d74788733bc455275580bed778b.1710193561.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1879; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=siklY8AyTepBDoVjY5hu8J7Bk3TQfvEqwxIzIKqkXfM=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtT3NU1Rn3wXpyxf3yMs9988Ppn5pVyIYblWQ9V3kRnbz To51f07GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZhIpQf7X1l31pM/uSTOsQSz amTNVbDR1dW4sbvF/hjnvfQyrfLbvK38zhlW4Tf3b9khrVehPyciaYupc98N4YoDJi+drCPOOF1 es+Ltgj1RbYyPyyNC/RM4d4RZubsWLFkxzcX+heD2o1/Y9QKktasMfE2DVM/9szT4f6dfTOHFjO L6xgBZjdNCu8SMkkyz/3D2Tj2s1WHTq+UndKmrdfL2pbOFPz9YFbvhvCrr1/JDj3tP72q/ab37h uz+jFsKu6dy2plkhN/l3P2Fx9Jwd0X+8UX2WV3T93c3twhJnGAJz5PpEjBjq0nPje68wfZVps11 0SZeZf891xfKqE1VMJO1q5R6WhctPf/jVoHrhguM3gAA 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-bluetooth@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/bluetooth/btqcomsmd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/btqcomsmd.c b/drivers/bluetooth/btqcomsmd.c index 11c7e04bf394..88dbb2f3fabf 100644 --- a/drivers/bluetooth/btqcomsmd.c +++ b/drivers/bluetooth/btqcomsmd.c @@ -197,7 +197,7 @@ static int btqcomsmd_probe(struct platform_device *pdev) return ret; } -static int btqcomsmd_remove(struct platform_device *pdev) +static void btqcomsmd_remove(struct platform_device *pdev) { struct btqcomsmd *btq = platform_get_drvdata(pdev); @@ -206,8 +206,6 @@ static int btqcomsmd_remove(struct platform_device *pdev) rpmsg_destroy_ept(btq->cmd_channel); rpmsg_destroy_ept(btq->acl_channel); - - return 0; } static const struct of_device_id btqcomsmd_of_match[] = { @@ -218,7 +216,7 @@ MODULE_DEVICE_TABLE(of, btqcomsmd_of_match); static struct platform_driver btqcomsmd_driver = { .probe = btqcomsmd_probe, - .remove = btqcomsmd_remove, + .remove_new = btqcomsmd_remove, .driver = { .name = "btqcomsmd", .of_match_table = btqcomsmd_of_match, From patchwork Mon Mar 11 21:49:53 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: 779530 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 75E1A56B7F for ; Mon, 11 Mar 2024 21:50:04 +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=1710193807; cv=none; b=jhDiitejsiXfrqz++rTQ10HbIoa3B6ybs0NkEUhMX2pHxLw413AB9x/Zi/iEgT+3XBpYODsOqTayaqUZqke8xtER4kFgrnTrKptjyEEjuClUfybIRl9bhTsF/tuLejFebfPRBwS1UkO91TssG2jl+xz5nWeycKihyIACch5s98w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193807; c=relaxed/simple; bh=8CWy7yQAZ/4JZBIif/DTp7WMMVIFt0WevEHTptyTTUo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AnDZPFYe8HiZ3QZIzlGsLZwoPoaGBtuIZph2gaE2+76+++ntbS8PkuwbjXD9xQzC1ctw7fbsv85kbFzBoxXoRk3XNaobejg4pAFTDsBs5SGfjTDXtYQC3SzKFZEf95U3TfeuYuF9YX0Npqi2uAgfkpwsVdU+GPH7OYRwSuzm10g= 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 1rjnWz-0003DY-QC; Mon, 11 Mar 2024 22:50:01 +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 1rjnWz-005nDn-DH; Mon, 11 Mar 2024 22:50:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rjnWz-004IoY-14; Mon, 11 Mar 2024 22:50:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marcel Holtmann , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/3] Bluetooth: hci_bcm: Convert to platform remove callback returning void Date: Mon, 11 Mar 2024 22:49:53 +0100 Message-ID: <75fe619ff30d0d974492c70f3bab032ddafb4d95.1710193561.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1842; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=8CWy7yQAZ/4JZBIif/DTp7WMMVIFt0WevEHTptyTTUo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl73yDMKcGelQOjbLd5icGuBKpbWQx7NCStpHgK KC3pDBMaQ2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZe98gwAKCRCPgPtYfRL+ TkeJB/wLcvWgOvdij+Jymv56cZyfvdE57pvUN2lPoPZdD07GalOliXiAcoV5hqEDls9zPlKHryA 6lmT5xwgN+xwEuEGjcfRXGPJyR8ihRRLG3Izs46ISzQ/qxTmRuvgl9xphdEjasAv0b18h85wH85 MIjok/lAS9LxbY/M2JgoYm92QIgOchDs4FGpZLiF2Z6M12YiNsG1gDf0ie2kyHPSP1ZvUXihOR2 6Oe3HibuQpcANjyJRaM/Qi0PpJOdHnRNfy3wI/6l1iBLX2Vu0IstE0dCVCFsuRSKMOuh+Uc8Fqo tS9q+EALtqf+ho2JWK3HL6quFW1+CyGe9k5qQTmMPqlZCVJz 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-bluetooth@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/bluetooth/hci_bcm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 874d23089b39..3a227f73c063 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1293,7 +1293,7 @@ static int bcm_probe(struct platform_device *pdev) return 0; } -static int bcm_remove(struct platform_device *pdev) +static void bcm_remove(struct platform_device *pdev) { struct bcm_device *dev = platform_get_drvdata(pdev); @@ -1302,8 +1302,6 @@ static int bcm_remove(struct platform_device *pdev) mutex_unlock(&bcm_device_lock); dev_info(&pdev->dev, "%s device unregistered.\n", dev->name); - - return 0; } static const struct hci_uart_proto bcm_proto = { @@ -1509,7 +1507,7 @@ static const struct dev_pm_ops bcm_pm_ops = { static struct platform_driver bcm_driver = { .probe = bcm_probe, - .remove = bcm_remove, + .remove_new = bcm_remove, .driver = { .name = "hci_bcm", .acpi_match_table = ACPI_PTR(bcm_acpi_match), From patchwork Mon Mar 11 21:49:54 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: 780613 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 75DF456B77 for ; Mon, 11 Mar 2024 21:50:04 +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=1710193808; cv=none; b=V5Zio11iyczgYON9G9b33FJwem4Vyjqxqhph7tgOKQMdOqwcKcw2o07LNyptQ5XJmH0m7a+MElzV+qmYmNoTd+LvHTepUbUicYA/a90x8aUlfbQ49O58iexd7zR4xS0Rjx4GmZiCYPoH2prULEU8C8neDHly7DpX9EpO3Q4UuHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710193808; c=relaxed/simple; bh=utqFOcp6ACV+cy8qTYsIXw7uFfcZt5FhhtAl/yvFyf8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uzhl3PggYjx0Lk6HKbaiSQ/p1FV8umLzM55wmAQbodlAVqadzps5hqHjEuP8mxWWcFfmznEWDtv4rHHnGo9Gt7A0MrWio0SY6NKNG7TJeRRXdhHO+tdE4GR65u+YcfOBlNSbYvJcy/AbarzIIWfFW5AogBTd4rCgujMonJj7Au8= 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 1rjnX0-0003Eq-4R; Mon, 11 Mar 2024 22:50:02 +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 1rjnWz-005nDq-NO; Mon, 11 Mar 2024 22:50:01 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rjnWz-004Ioe-24; Mon, 11 Mar 2024 22:50:01 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Marcel Holtmann , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 3/3] Bluetooth: hci_intel: Convert to platform remove callback returning void Date: Mon, 11 Mar 2024 22:49:54 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1740; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=utqFOcp6ACV+cy8qTYsIXw7uFfcZt5FhhtAl/yvFyf8=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtT3NS0n/BX3X5/q5i1g4liWpbzlfm3lG3uG8MWvhZt1k wWjVF92MhqzMDByMciKKbLYN67JtKqSi+xc++8yzCBWJpApDFycAjCR33/Z/8e4qhRcMjsue165 d3HjlUm3rAMdft+MLfWrPsMqoVsRvekpR/w3S08xnrdBZw55zj+/2WNdTJ4Kc4fNIzH3S+m9j39 rzMjtcsie9s3F3sVvxo3zmpGVW180b+yw445MZj9q80d4Q7FQl8Hxhf+uHf7NVH/DMjxVS+9aBc crt9hvCt88bCveHAng0e1c+ccwUN/i2qK/G27kv1Z/c1dbL9PuGOfa/6//WS9yKY+8IKS2tXRTw bnmluTzB67MUmHZfbzG4PHun8ePb5sgm7D9nYhT+KFJlUqq7tevszXFMsZae8XK20VbqExeU7zP VFfa6NqFD+I5X9Xaq/Uz1jmJanZkbbOcd0xljk2Oe/huAA== 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-bluetooth@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/bluetooth/hci_intel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index 78afb9a348e7..bd44d683b9be 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -1190,7 +1190,7 @@ static int intel_probe(struct platform_device *pdev) return 0; } -static int intel_remove(struct platform_device *pdev) +static void intel_remove(struct platform_device *pdev) { struct intel_device *idev = platform_get_drvdata(pdev); @@ -1201,13 +1201,11 @@ static int intel_remove(struct platform_device *pdev) mutex_unlock(&intel_device_list_lock); dev_info(&pdev->dev, "unregistered.\n"); - - return 0; } static struct platform_driver intel_driver = { .probe = intel_probe, - .remove = intel_remove, + .remove_new = intel_remove, .driver = { .name = "hci_intel", .acpi_match_table = ACPI_PTR(intel_acpi_match),