From nobody Wed Feb 11 19:01:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE722C6FD19 for ; Fri, 10 Mar 2023 22:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231898AbjCJWmi (ORCPT ); Fri, 10 Mar 2023 17:42:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbjCJWmI (ORCPT ); Fri, 10 Mar 2023 17:42:08 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFDE314D083 for ; Fri, 10 Mar 2023 14:41:43 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1palQg-0002dA-Ci; Fri, 10 Mar 2023 23:41:38 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1palQe-003GqK-PW; Fri, 10 Mar 2023 23:41:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1palQd-003uEV-Tw; Fri, 10 Mar 2023 23:41:35 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Stuart Yoder , Laurentiu Tudor Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] bus: fsl-mc: Only warn once about errors on device unbind Date: Fri, 10 Mar 2023 23:41:23 +0100 Message-Id: <20230310224128.2638078-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> References: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=959; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=soyW7qTmvLYZjqko2bU9Wwukx4vz+pHXyLiUEo5BE/k=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkC7ICu4CcOxQg/SDY7ITR2qMbSiRlYm+mW1eYT 2LMemXdmyCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAuyAgAKCRDB/BR4rcrs CTO4CACB4/9hoCCFS63udqPEt25X5YNtEcx6g17uulRdRr3YvP0UrswrzXQcFDuua+LWWn3jbt0 95PWumPSIH+HoznhsoXg4e5CWtEPRR9oM00ZSR5M5R6+HONbarn/jiE1eGrGK06hrOiKrXp2HQG DdWhR/qEGVjxNZmAw+cm3eS+4tiex/oIN+TgD3BZMS+iZMJI9wp4UN/Nx+IYFWLUp9Yfpl4IbxL PpFV3rzLosWHSubLoWl7WZWwhMku4s8cxeRduT00Dp3X5lEmPYkYW3ryh/aMlQeNsV/9hhQ7vAo tzihQ5oJECMj5dnRkfvBR37bT0n/BGO3saVBnptKAKFDqXot X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If a platform driver's remove function returns an error code, this results in a (generic and little helpful) error message. Otherwise the value is ignored. As fsl_mc_driver_remove() already emit an error message, return 0 also in the error case. The only effect is to suppress the device core's error message. Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Ioana Ciornei Reviewed-by: Laurentiu Tudor Tested-by: Ioana Ciornei # sanity checks Tested-by: Laurentiu Tudor --- drivers/bus/fsl-mc/fsl-mc-bus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bu= s.c index 36cb091a33b4..1531e6101fb1 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -457,10 +457,8 @@ static int fsl_mc_driver_remove(struct device *dev) int error; =20 error =3D mc_drv->remove(mc_dev); - if (error < 0) { + if (error < 0) dev_err(dev, "%s failed: %d\n", __func__, error); - return error; - } =20 return 0; } --=20 2.39.1 From nobody Wed Feb 11 19:01:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 920ABC6FD19 for ; Fri, 10 Mar 2023 22:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231733AbjCJWm3 (ORCPT ); Fri, 10 Mar 2023 17:42:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231766AbjCJWmG (ORCPT ); Fri, 10 Mar 2023 17:42:06 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF3A214DA10 for ; Fri, 10 Mar 2023 14:41:42 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1palQg-0002dB-Cc; Fri, 10 Mar 2023 23:41:38 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1palQe-003GqN-Ss; Fri, 10 Mar 2023 23:41:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1palQe-003uEY-3g; Fri, 10 Mar 2023 23:41:36 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Stuart Yoder , Laurentiu Tudor Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] bus: fsl-mc: dprc: Push down error message from fsl_mc_driver_remove() Date: Fri, 10 Mar 2023 23:41:24 +0100 Message-Id: <20230310224128.2638078-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> References: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1279; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zyomHc/a8RjH8rB16Pl7Aa7f3JBTHoJGdtnzhJxLWMk=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkC7IFde5cyfUUkluP5sb7EamLPCdvIGyRB0CDc 6qzXQhBDUqJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAuyBQAKCRDB/BR4rcrs CbADB/9d/5bLFRXln06G6ARKHRV+gcjOlv4P0ca124EZ6TwrRFHYRbbXlkHt9INfzPIPHT7CS9f MkH+Dh01R5ZH+tmMcArElHWhm3c0nJGcySFZgTsZCH/+SJX5wCk+gHXRGWHWX8G6ATfvQ5eiQr5 53Q1y0De1BXCmJBdW29mm4GN5PLcdteL7oVKRJIYY+y41vtGXXxdwQAKv5nTZi9S4bcRe8GZmGe IM2JeI1mzP++cK2M6UCdd7KPCU7GTuhhQ6IoF35iA+JPHe8kV9dqtV83702BPxxVVPAgGmrKOTu eoNge9LwTl84FvjOIFkLuaHIg6EBzbeczfHkA1TO7Sx153Ra X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The error message emitted in fsl_mc_driver_remove() is very generic. Replace it by a message that mentions the reason for the failure. Returning zero instead of a negative value has no side effect apart from suppressing the generic error message. The first if condition in dprc_remove() can never be true, as this would prevent successful probing of the device and then .remove wasn't called. So this can just be dropped. Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Ioana Ciornei Reviewed-by: Laurentiu Tudor Tested-by: Ioana Ciornei # sanity checks Tested-by: Laurentiu Tudor --- drivers/bus/fsl-mc/dprc-driver.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-dri= ver.c index 4c84be378bf2..ef4f43f67b80 100644 --- a/drivers/bus/fsl-mc/dprc-driver.c +++ b/drivers/bus/fsl-mc/dprc-driver.c @@ -839,11 +839,10 @@ static int dprc_remove(struct fsl_mc_device *mc_dev) { struct fsl_mc_bus *mc_bus =3D to_fsl_mc_bus(mc_dev); =20 - if (!is_fsl_mc_bus_dprc(mc_dev)) - return -EINVAL; - - if (!mc_bus->irq_resources) - return -EINVAL; + if (!mc_bus->irq_resources) { + dev_err(&mc_dev->dev, "No irq resources, so unbinding the device failed\= n"); + return 0; + } =20 if (dev_get_msi_domain(&mc_dev->dev)) dprc_teardown_irq(mc_dev); --=20 2.39.1 From nobody Wed Feb 11 19:01:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32726C6FD1E for ; Fri, 10 Mar 2023 22:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231975AbjCJWmn (ORCPT ); Fri, 10 Mar 2023 17:42:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231887AbjCJWmI (ORCPT ); Fri, 10 Mar 2023 17:42:08 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49D6814FE04 for ; Fri, 10 Mar 2023 14:41:44 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1palQg-0002dC-Cg; Fri, 10 Mar 2023 23:41:38 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1palQe-003GqP-UJ; Fri, 10 Mar 2023 23:41:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1palQe-003uEb-A7; Fri, 10 Mar 2023 23:41:36 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Stuart Yoder , Laurentiu Tudor Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition Date: Fri, 10 Mar 2023 23:41:25 +0100 Message-Id: <20230310224128.2638078-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> References: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1280; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Us0uaGo+ZVeSCyVAMYktRapjadAzUAbMySr9dkZDyhY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkC7IIiLBXyBkvldrNjLxXSuVihB+XZFHPrH9iZ bSlYnYChKKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAuyCAAKCRDB/BR4rcrs CUUWB/9/k9C4veBM5Ob0UtSIRQ0RivJZb9RntiAY5ubwFG0IuOjbbv7HTRcqEAHgS4cjiroDepr fSyQLcyu3ha75lLy3dvgFC61wso4UbZpTyPFO1GGUsmHihdhRP+nwnb14lQe40QPUX23fKiYKgZ 7QRGp3c+Vvlufr+G43AloQzBpDYgzqCyLH+KpXW9Wq2psPWujyDhQiFPTjci8dNQJnY/isPi6IP gsYRdbtoiB922C7ibOW7Zbu7jIjPxlTZHSlyrrrapXtN4jilw43+naa4rnKUgI9ql/lhClvqnzo LeD899Bgjn62Eyk5CVpT45EyFpAWkwkzDITW1VPBtDSVa/pU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If fsl_mc_is_allocatable(mc_dev) evaluates to false, the driver won't have bound to that device and then fsl_mc_allocator_remove() is never called for that device. fsl_mc_allocator_remove() is the only caller of fsl_mc_resource_pool_remove_device(), so the same check can be removed from there. Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Ioana Ciornei Reviewed-by: Laurentiu Tudor Tested-by: Ioana Ciornei # sanity checks Tested-by: Laurentiu Tudor --- drivers/bus/fsl-mc/fsl-mc-allocator.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl= -mc-allocator.c index dced427ca8ba..e60faf8edaa1 100644 --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c @@ -103,9 +103,6 @@ static int __must_check fsl_mc_resource_pool_remove_dev= ice(struct fsl_mc_device struct fsl_mc_resource *resource; int error =3D -EINVAL; =20 - if (!fsl_mc_is_allocatable(mc_dev)) - goto out; - resource =3D mc_dev->resource; if (!resource || resource->data !=3D mc_dev) goto out; @@ -613,9 +610,6 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device= *mc_dev) { int error; =20 - if (!fsl_mc_is_allocatable(mc_dev)) - return -EINVAL; - if (mc_dev->resource) { error =3D fsl_mc_resource_pool_remove_device(mc_dev); if (error < 0) --=20 2.39.1 From nobody Wed Feb 11 19:01:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18147C6FA99 for ; Fri, 10 Mar 2023 22:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231773AbjCJWmY (ORCPT ); Fri, 10 Mar 2023 17:42:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231764AbjCJWmG (ORCPT ); Fri, 10 Mar 2023 17:42:06 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76ECA14ACC8 for ; Fri, 10 Mar 2023 14:41:42 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1palQg-0002dD-Cl; Fri, 10 Mar 2023 23:41:38 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1palQf-003GqV-C4; Fri, 10 Mar 2023 23:41:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1palQe-003uEe-HA; Fri, 10 Mar 2023 23:41:36 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Stuart Yoder , Laurentiu Tudor Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] bus: fsl-mc: fsl-mc-allocator: Improve error reporting Date: Fri, 10 Mar 2023 23:41:26 +0100 Message-Id: <20230310224128.2638078-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> References: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=2224; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=m2h84BsJapWQ+IP/SZ8E8V7ar6wuL3BLup87a7Nixzk=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkC7IM8pg2g6H3wvwxPUVPKdlZoGauxCIeCp/j2 I+Raw+nlGaJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAuyDAAKCRDB/BR4rcrs CZMuB/0eCfFruQMz0wK1d6qgSDIzcVBfL8c2MHcqYpHOhs7bWc+lEJKrSgHjislIyLjat3xR9U9 KQh+LY9ORGrQvlSYGaqFyjXqey6nvAgySQZE+f+S5WQ+5S565+iFn/N/uI4n2el+HXjUmCKo2JN upmv0FpP0qeguyBr0hdzTbzWmMRqvjy6HCLsQcEdVRytGzxKsARdV18dNl2iAtUnGc62gMAJTdi 2etKfkhATvuK3LQrjOb4blRVjhopNkTIiPAaD2sQSeihTc/d0Ntmd+oR8QXZdRdS8q/IgTL7iqN nQGF+UDm9vle4ilielCJ/htVNRkTud1SV0xGmgg08P/HHPCO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of silently returning an error in the remove callback (which yields a generic and little informing error message), annotate each error path of fsl_mc_resource_pool_remove_device() with an error message and return zero in the remove callback to suppress the error message. Note that changing the return value has no other effect than suppressing the error message by the fsl_mc bus driver. Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Ioana Ciornei Reviewed-by: Laurentiu Tudor Tested-by: Ioana Ciornei # sanity checks Tested-by: Laurentiu Tudor --- drivers/bus/fsl-mc/fsl-mc-allocator.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl= -mc-allocator.c index e60faf8edaa1..36f70e5e418b 100644 --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c @@ -104,22 +104,30 @@ static int __must_check fsl_mc_resource_pool_remove_d= evice(struct fsl_mc_device int error =3D -EINVAL; =20 resource =3D mc_dev->resource; - if (!resource || resource->data !=3D mc_dev) + if (!resource || resource->data !=3D mc_dev) { + dev_err(&mc_bus_dev->dev, "resource mismatch\n"); goto out; + } =20 mc_bus_dev =3D to_fsl_mc_device(mc_dev->dev.parent); mc_bus =3D to_fsl_mc_bus(mc_bus_dev); res_pool =3D resource->parent_pool; - if (res_pool !=3D &mc_bus->resource_pools[resource->type]) + if (res_pool !=3D &mc_bus->resource_pools[resource->type]) { + dev_err(&mc_bus_dev->dev, "pool mismatch\n"); goto out; + } =20 mutex_lock(&res_pool->mutex); =20 - if (res_pool->max_count <=3D 0) + if (res_pool->max_count <=3D 0) { + dev_err(&mc_bus_dev->dev, "max_count underflow\n"); goto out_unlock; + } if (res_pool->free_count <=3D 0 || - res_pool->free_count > res_pool->max_count) + res_pool->free_count > res_pool->max_count) { + dev_err(&mc_bus_dev->dev, "free_count mismatch\n"); goto out_unlock; + } =20 /* * If the device is currently allocated, its resource is not @@ -613,7 +621,7 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device= *mc_dev) if (mc_dev->resource) { error =3D fsl_mc_resource_pool_remove_device(mc_dev); if (error < 0) - return error; + return 0; } =20 dev_dbg(&mc_dev->dev, --=20 2.39.1 From nobody Wed Feb 11 19:01:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0789C6FA99 for ; Fri, 10 Mar 2023 22:42:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231869AbjCJWmd (ORCPT ); Fri, 10 Mar 2023 17:42:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231879AbjCJWmI (ORCPT ); Fri, 10 Mar 2023 17:42:08 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5029214FE05 for ; Fri, 10 Mar 2023 14:41:44 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1palQh-0002dE-9u; Fri, 10 Mar 2023 23:41:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1palQf-003GqY-Fa; Fri, 10 Mar 2023 23:41:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1palQe-003uEi-NF; Fri, 10 Mar 2023 23:41:36 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Roy Pledge , Li Yang Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/6] soc: fsl: dpio: Suppress duplicated error reporting on device remove Date: Fri, 10 Mar 2023 23:41:27 +0100 Message-Id: <20230310224128.2638078-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> References: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1085; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=jrvcriG6LY6cgmfGJKCy0SYPFV25hxPQL+k/hItVWeg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkC7IP8/ceFmpLmvUa+JsfOgJYo497N77Opym3s j+VaP7QeOGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAuyDwAKCRDB/BR4rcrs CVd8B/0VPto9yl5L2YKsfnTkyeyixLFuoF5giyuRmEzixWQLgAOxwFlkNcvGPkZ90qZb21QU1mo Kpbs8F6zt3hXiJVvZkdaUt6uMVRB+lQaRELXDQuwrKi8hYbMGkumj0DA0FakSoQQrn1ouqd/T1S Ww8QCmU/aAl5ncKRoJZVQq20saEPSV0TPAj2QcjhHvOnjXRxt9QPjOt3UWJd5cezIJn5fEongop 0mVDsnqLmNQnn94Dw47gAAU1Zb9l94LVWyzPl8Qoxt6GxIZhT4uFBg0Hq5CT4RCSIX2J/eNV+dP 6bCsDwjxVFhZvC+ebQoPTnRGNS1ibo9X9qG7BsdO5O0B5J8g X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Returning an error code from a fsl_mc_driver's remove callback results in a generic error message, otherwise the value is ignored and the device gets unbound. As the only error path in dpaa2_dpio_remove() already emits an error message, return zero unconditionally to suppress another (less helpful) error report. Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Ioana Ciornei Reviewed-by: Laurentiu Tudor Tested-by: Ioana Ciornei # sanity checks Tested-by: Laurentiu Tudor --- drivers/soc/fsl/dpio/dpio-driver.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio= -driver.c index 74eace3109a1..09df5302d255 100644 --- a/drivers/soc/fsl/dpio/dpio-driver.c +++ b/drivers/soc/fsl/dpio/dpio-driver.c @@ -297,14 +297,10 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dp= io_dev) =20 dpio_close(dpio_dev->mc_io, 0, dpio_dev->mc_handle); =20 - fsl_mc_portal_free(dpio_dev->mc_io); - - return 0; - err_open: fsl_mc_portal_free(dpio_dev->mc_io); =20 - return err; + return 0; } =20 static const struct fsl_mc_device_id dpaa2_dpio_match_id_table[] =3D { --=20 2.39.1 From nobody Wed Feb 11 19:01:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50A40C6FA99 for ; Fri, 10 Mar 2023 22:43:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbjCJWnA (ORCPT ); Fri, 10 Mar 2023 17:43:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjCJWm2 (ORCPT ); Fri, 10 Mar 2023 17:42:28 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 204C7147760 for ; Fri, 10 Mar 2023 14:42:07 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1palQh-0002dF-AE; Fri, 10 Mar 2023 23:41:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1palQf-003Gqb-K3; Fri, 10 Mar 2023 23:41:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1palQe-003uEm-Ud; Fri, 10 Mar 2023 23:41:36 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Stuart Yoder , Laurentiu Tudor , =?utf-8?q?Horia_Geant=C4=83?= , Pankaj Gupta , Gaurav Jain , Herbert Xu , "David S. Miller" , Vinod Koul , Ioana Ciornei , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yangbo Lu , Roy Pledge , Li Yang , Diana Craciun , Alex Williamson , Richard Cochran Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, dmaengine@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org Subject: [PATCH 6/6] bus: fsl-mc: Make remove function return void Date: Fri, 10 Mar 2023 23:41:28 +0100 Message-Id: <20230310224128.2638078-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> References: <20230310224128.2638078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=10084; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=9mBAd0011vCFVMqmKv0sG8u7xl0d5ng9BqpXGJnY3UY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkC7IS4iDBmtk6endpHGEPsd8XTh4Wj6zZvJ4+p 3A9Hbr8tomJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAuyEgAKCRDB/BR4rcrs Cd01B/472HXgkkn1dxwJPe/PvNhCuB9iH9vI0Z1P6W+GYbYOaQK+LurDS+akY5QNd7tjzm4qWfm dZ4bbwuSY/lbJGxiDl3ZPsis0maetj+wnZFrxeVoH6+lNMmDaY8mqcKRjYRudOrP7aHGH7G7SQR o2n7D3BLUtp8aa6N9z87rmGT0CjTgOHoBshxHP2X5C/Mxs0Salc6xzduYSqyA5gqyFx4hwYaGcI vxLxA0+n0+TvBJGthGurOF977Cy8QlSysrsMuNnlOu2h241u2Vmr5ZOt8IqzN4D6e7ZDOOaG7d9 akuL2eJqsYXWXQ/ODB390DjCekbI2cL9jLOdoZn7SuQnOYWF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-K=C3=B6nig The value returned by an fsl-mc driver's remove function is mostly ignored. (Only an error message is printed if the value is non-zero and then device removal continues unconditionally.) So change the prototype of the remove function to return no value. This way driver authors are not tempted to assume that passing an error to the upper layer is a good idea. All drivers are adapted accordingly. There is no intended change of behaviour, all callbacks were prepared to return 0 before. Signed-off-by: Uwe Kleine-K=C3=B6nig Reviewed-by: Ioana Ciornei Reviewed-by: Laurentiu Tudor Tested-by: Ioana Ciornei # sanity checks Tested-by: Laurentiu Tudor --- drivers/bus/fsl-mc/dprc-driver.c | 5 ++--- drivers/bus/fsl-mc/fsl-mc-allocator.c | 5 ++--- drivers/bus/fsl-mc/fsl-mc-bus.c | 5 +---- drivers/crypto/caam/caamalg_qi2.c | 4 +--- drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c | 4 +--- drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 4 +--- drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 4 +--- drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 4 +--- drivers/soc/fsl/dpio/dpio-driver.c | 4 +--- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 3 +-- include/linux/fsl/mc.h | 2 +- 11 files changed, 13 insertions(+), 31 deletions(-) diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-dri= ver.c index ef4f43f67b80..595d4cecd041 100644 --- a/drivers/bus/fsl-mc/dprc-driver.c +++ b/drivers/bus/fsl-mc/dprc-driver.c @@ -835,13 +835,13 @@ EXPORT_SYMBOL_GPL(dprc_cleanup); * It tears down the interrupts that were configured for the DPRC device. * It destroys the interrupt pool associated with this MC bus. */ -static int dprc_remove(struct fsl_mc_device *mc_dev) +static void dprc_remove(struct fsl_mc_device *mc_dev) { struct fsl_mc_bus *mc_bus =3D to_fsl_mc_bus(mc_dev); =20 if (!mc_bus->irq_resources) { dev_err(&mc_dev->dev, "No irq resources, so unbinding the device failed\= n"); - return 0; + return; } =20 if (dev_get_msi_domain(&mc_dev->dev)) @@ -852,7 +852,6 @@ static int dprc_remove(struct fsl_mc_device *mc_dev) dprc_cleanup(mc_dev); =20 dev_info(&mc_dev->dev, "DPRC device unbound from driver"); - return 0; } =20 static const struct fsl_mc_device_id match_id_table[] =3D { diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl= -mc-allocator.c index 36f70e5e418b..0ad68099684e 100644 --- a/drivers/bus/fsl-mc/fsl-mc-allocator.c +++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c @@ -614,19 +614,18 @@ static int fsl_mc_allocator_probe(struct fsl_mc_devic= e *mc_dev) * fsl_mc_allocator_remove - callback invoked when an allocatable device is * being removed from the system */ -static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev) +static void fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev) { int error; =20 if (mc_dev->resource) { error =3D fsl_mc_resource_pool_remove_device(mc_dev); if (error < 0) - return 0; + return; } =20 dev_dbg(&mc_dev->dev, "Allocatable fsl-mc device unbound from fsl_mc_allocator driver"); - return 0; } =20 static const struct fsl_mc_device_id match_id_table[] =3D { diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bu= s.c index 1531e6101fb1..08b7dc8f2181 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -454,11 +454,8 @@ static int fsl_mc_driver_remove(struct device *dev) { struct fsl_mc_driver *mc_drv =3D to_fsl_mc_driver(dev->driver); struct fsl_mc_device *mc_dev =3D to_fsl_mc_device(dev); - int error; =20 - error =3D mc_drv->remove(mc_dev); - if (error < 0) - dev_err(dev, "%s failed: %d\n", __func__, error); + mc_drv->remove(mc_dev); =20 return 0; } diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamal= g_qi2.c index 5c8d35edaa1c..9156bbe038b7 100644 --- a/drivers/crypto/caam/caamalg_qi2.c +++ b/drivers/crypto/caam/caamalg_qi2.c @@ -5402,7 +5402,7 @@ static int dpaa2_caam_probe(struct fsl_mc_device *dps= eci_dev) return err; } =20 -static int __cold dpaa2_caam_remove(struct fsl_mc_device *ls_dev) +static void __cold dpaa2_caam_remove(struct fsl_mc_device *ls_dev) { struct device *dev; struct dpaa2_caam_priv *priv; @@ -5443,8 +5443,6 @@ static int __cold dpaa2_caam_remove(struct fsl_mc_dev= ice *ls_dev) free_percpu(priv->ppriv); fsl_mc_portal_free(priv->mc_io); kmem_cache_destroy(qi_cache); - - return 0; } =20 int dpaa2_caam_enqueue(struct device *dev, struct caam_request *req) diff --git a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c b/drivers/dma/fsl-dpaa= 2-qdma/dpaa2-qdma.c index 8dd40d00a672..a42a37634881 100644 --- a/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c +++ b/drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c @@ -765,7 +765,7 @@ static int dpaa2_qdma_probe(struct fsl_mc_device *dpdma= i_dev) return err; } =20 -static int dpaa2_qdma_remove(struct fsl_mc_device *ls_dev) +static void dpaa2_qdma_remove(struct fsl_mc_device *ls_dev) { struct dpaa2_qdma_engine *dpaa2_qdma; struct dpaa2_qdma_priv *priv; @@ -787,8 +787,6 @@ static int dpaa2_qdma_remove(struct fsl_mc_device *ls_d= ev) dma_async_device_unregister(&dpaa2_qdma->dma_dev); kfree(priv); kfree(dpaa2_qdma); - - return 0; } =20 static void dpaa2_qdma_shutdown(struct fsl_mc_device *ls_dev) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net= /ethernet/freescale/dpaa2/dpaa2-eth.c index a62cffaf6ff1..a9676d0dece8 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -5025,7 +5025,7 @@ static int dpaa2_eth_probe(struct fsl_mc_device *dpni= _dev) return err; } =20 -static int dpaa2_eth_remove(struct fsl_mc_device *ls_dev) +static void dpaa2_eth_remove(struct fsl_mc_device *ls_dev) { struct device *dev; struct net_device *net_dev; @@ -5073,8 +5073,6 @@ static int dpaa2_eth_remove(struct fsl_mc_device *ls_= dev) dev_dbg(net_dev->dev.parent, "Removed interface %s\n", net_dev->name); =20 free_netdev(net_dev); - - return 0; } =20 static const struct fsl_mc_device_id dpaa2_eth_match_id_table[] =3D { diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c b/drivers/net= /ethernet/freescale/dpaa2/dpaa2-ptp.c index 90d23ab1ce9d..4497e3c0456d 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c @@ -219,7 +219,7 @@ static int dpaa2_ptp_probe(struct fsl_mc_device *mc_dev) return err; } =20 -static int dpaa2_ptp_remove(struct fsl_mc_device *mc_dev) +static void dpaa2_ptp_remove(struct fsl_mc_device *mc_dev) { struct device *dev =3D &mc_dev->dev; struct ptp_qoriq *ptp_qoriq; @@ -232,8 +232,6 @@ static int dpaa2_ptp_remove(struct fsl_mc_device *mc_de= v) fsl_mc_free_irqs(mc_dev); dprtc_close(mc_dev->mc_io, 0, mc_dev->mc_handle); fsl_mc_portal_free(mc_dev->mc_io); - - return 0; } =20 static const struct fsl_mc_device_id dpaa2_ptp_match_id_table[] =3D { diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/= net/ethernet/freescale/dpaa2/dpaa2-switch.c index f4ae4289c41a..21cc4e52425a 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -3221,7 +3221,7 @@ static void dpaa2_switch_teardown(struct fsl_mc_devic= e *sw_dev) dev_warn(dev, "dpsw_close err %d\n", err); } =20 -static int dpaa2_switch_remove(struct fsl_mc_device *sw_dev) +static void dpaa2_switch_remove(struct fsl_mc_device *sw_dev) { struct ethsw_port_priv *port_priv; struct ethsw_core *ethsw; @@ -3252,8 +3252,6 @@ static int dpaa2_switch_remove(struct fsl_mc_device *= sw_dev) kfree(ethsw); =20 dev_set_drvdata(dev, NULL); - - return 0; } =20 static int dpaa2_switch_probe_port(struct ethsw_core *ethsw, diff --git a/drivers/soc/fsl/dpio/dpio-driver.c b/drivers/soc/fsl/dpio/dpio= -driver.c index 09df5302d255..9e3fddd8f5a9 100644 --- a/drivers/soc/fsl/dpio/dpio-driver.c +++ b/drivers/soc/fsl/dpio/dpio-driver.c @@ -270,7 +270,7 @@ static void dpio_teardown_irqs(struct fsl_mc_device *dp= io_dev) fsl_mc_free_irqs(dpio_dev); } =20 -static int dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev) +static void dpaa2_dpio_remove(struct fsl_mc_device *dpio_dev) { struct device *dev; struct dpio_priv *priv; @@ -299,8 +299,6 @@ static int dpaa2_dpio_remove(struct fsl_mc_device *dpio= _dev) =20 err_open: fsl_mc_portal_free(dpio_dev->mc_io); - - return 0; } =20 static const struct fsl_mc_device_id dpaa2_dpio_match_id_table[] =3D { diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vfio_f= sl_mc.c index c89a047a4cd8..f2140e94d41e 100644 --- a/drivers/vfio/fsl-mc/vfio_fsl_mc.c +++ b/drivers/vfio/fsl-mc/vfio_fsl_mc.c @@ -570,7 +570,7 @@ static void vfio_fsl_mc_release_dev(struct vfio_device = *core_vdev) mutex_destroy(&vdev->igate); } =20 -static int vfio_fsl_mc_remove(struct fsl_mc_device *mc_dev) +static void vfio_fsl_mc_remove(struct fsl_mc_device *mc_dev) { struct device *dev =3D &mc_dev->dev; struct vfio_fsl_mc_device *vdev =3D dev_get_drvdata(dev); @@ -578,7 +578,6 @@ static int vfio_fsl_mc_remove(struct fsl_mc_device *mc_= dev) vfio_unregister_group_dev(&vdev->vdev); dprc_remove_devices(mc_dev, NULL, 0); vfio_put_device(&vdev->vdev); - return 0; } =20 static const struct vfio_device_ops vfio_fsl_mc_ops =3D { diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h index a86115bc799c..a1b3de87a3d1 100644 --- a/include/linux/fsl/mc.h +++ b/include/linux/fsl/mc.h @@ -48,7 +48,7 @@ struct fsl_mc_driver { struct device_driver driver; const struct fsl_mc_device_id *match_id_table; int (*probe)(struct fsl_mc_device *dev); - int (*remove)(struct fsl_mc_device *dev); + void (*remove)(struct fsl_mc_device *dev); void (*shutdown)(struct fsl_mc_device *dev); int (*suspend)(struct fsl_mc_device *dev, pm_message_t state); int (*resume)(struct fsl_mc_device *dev); --=20 2.39.1