Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1547830rdb; Wed, 24 Jan 2024 21:16:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXZsLE+fesiahUsoh4Sj9B1mSREju6kHonz24ZIYI4dC1oWdVOZxF71IOkUefGx4UDTrMi X-Received: by 2002:a05:622a:1990:b0:42a:4f5a:6ad6 with SMTP id u16-20020a05622a199000b0042a4f5a6ad6mr696197qtc.5.1706159798049; Wed, 24 Jan 2024 21:16:38 -0800 (PST) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id e10-20020ac85dca000000b0042a29690dcesi11973427qtx.746.2024.01.24.21.16.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 21:16:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=aiY0npBn; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-37973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 753051C2327F for ; Thu, 25 Jan 2024 05:16:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8658910A25; Thu, 25 Jan 2024 05:16:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="aiY0npBn" Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2087.outbound.protection.outlook.com [40.107.249.87]) (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 4868710A22; Thu, 25 Jan 2024 05:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.87 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706159763; cv=fail; b=SeBS5u6hTBjSvCf9ssLJkAwOZIp4aKGmK701GIKQiENZOzZ5W5SH5NFixcRtoQKlfp7X2QchFj+MapJCJeuCPLpTD2B1xFCPcXUIYF6rbbmQjIHewCKGFGrWkP4AWFGxlRPogir6opFCVovtnaFb4yQyLgT1o5GjCHolewCyT2Q= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706159763; c=relaxed/simple; bh=LDN7O/dpGg31VW4DZx50TL7inOfSwn3xUBm8mLyixjA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=reqsdkKbX2s9xbLwmF8IQYRxTPN97NOi5/BhTc5av3I1RvuNrPG/9hofQueMxhSHwkoT5y6y7G8bFdo9oXTZ999zLBw1Sojm9RFcnS9iAWG4UIk7F4hNqw5b2Zh36rdXgHp5g/uREgaRHXgyaG3oIQEVKBflEq1d48WBsne7h7s= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (1024-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=aiY0npBn; arc=fail smtp.client-ip=40.107.249.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y2Gi5Oi9DIQ/cUmUNXFtKVLA8Z+KR/x+pQdgEvzqvtfjNnCWGevthEPS4ZoPK/uO46DpyfCkzkfwD/9xp8xwNyDZFa5f9NOffgZUyA5Ewc0d1vOqOt5+0TzznHhBpBJgyCXMZqDaYSgqbdLjD0ofuvKP4KK5MwS32gHn/SOy4jsIqBBS3OWMLjncg5sv0t9Np2JQvsrYb4MUxg628rnCTHu/FOtw3yVFwVVXil0e4B/kXdiFbIcVYqUy1akNRpOY60H7HeCKkHPZfCRda5NzwKCKCNAm9qI0hIDWM21QfClfkKcpNNkrIhH9FDM+d8O/O9q59rOU7EE1Y+LP14z67Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lVF+lIifocnKZkWBqalKhcjKGKvD/NfO5sSqA4z8S+g=; b=YAdkZsl8gftGwXDX233yB2UPKe3ACyxCNvKntmsX1dKmqTUXdTFx35mvgHwPxZtfCQW2VQAYDzra1s8jpsOO7NZ2t/dPwhD1qsUz8h0vC7hhDn7TSNG4IsXS8IrLUHm0IjUV+ob6XckiwKsWA0fXBqwEUmy++GnqB5PCaHj0rYHIVEGVcJfY1sKeoWPoVlUIsouE17LVTGXRnO9o/rN7go/X1S3KPkc8mEI8+OR+PoAvQaaT+vLOpeCEXXe2acH+1kpnvemC2Jbj0hhdKahlmds7pvQDmT7Z3wX4PBkeUBQqcW+8zQN3eh+LZlfP2HwBXy0KiYpM59vLHeX5rqjpCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lVF+lIifocnKZkWBqalKhcjKGKvD/NfO5sSqA4z8S+g=; b=aiY0npBnoP+HnXAgmHH4I1MkN9VffurUBsUxhd7I7chuxpsHbB2vTCuFeyIALnbjO2RU4A+tiVEeW+p2SYvyIymwm9iEPsljcbgLcqxJKlVepwDO08NW0SCo1/AzsyKcKKl4k7nPhk71vsp4t6lw/QLl8RaItODzWTn2HRiJ2Mo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AM9PR04MB8275.eurprd04.prod.outlook.com (2603:10a6:20b:3ec::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Thu, 25 Jan 2024 05:15:58 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::c499:8cef:9bb1:ced6%3]) with mapi id 15.20.7228.022; Thu, 25 Jan 2024 05:15:58 +0000 From: "Peng Fan (OSS)" Date: Thu, 25 Jan 2024 13:20:04 +0800 Subject: [PATCH v4 2/4] mailbox: imx: support return value of init Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240125-imx-mailbox-v4-2-800be5383c20@nxp.com> References: <20240125-imx-mailbox-v4-0-800be5383c20@nxp.com> In-Reply-To: <20240125-imx-mailbox-v4-0-800be5383c20@nxp.com> To: Jassi Brar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dong Aisheng , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peng Fan X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1706160018; l=3343; i=peng.fan@nxp.com; s=20230812; h=from:subject:message-id; bh=+Gd+/hMaY4KbnLg+mAxCKcpz6HM1MVsMqwBCKUxGXc0=; b=jrGwXVeZrCtbYrIpbRKhaIScl3XUdA+WXHE/EacTeNle57CnLCZIKACIFeDK89AvN3fHwe9tI 4MDYljwA7q8A3JhGUFzit8fMhXe/JFzTG4Cg/wkmuRPNPOYK8fbwNH+ X-Developer-Key: i=peng.fan@nxp.com; a=ed25519; pk=I4sJg7atIT1g63H7bb5lDRGR2gJW14RKDD0wFL8TT1g= X-ClientProxiedBy: SI2PR01CA0036.apcprd01.prod.exchangelabs.com (2603:1096:4:192::22) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AM9PR04MB8275:EE_ X-MS-Office365-Filtering-Correlation-Id: fd8404d7-f91a-4935-e6bd-08dc1d64b6bb X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0XLVHGm0TQtfyZ+GRaHKsRhGF+/pMX3u1nP3TzZaDYXL7xiHEbibeFl335IbROGydLawBqisWyADKxFrTYcDT5hnegbj3DGNwSICZ63BVLnm+UlN6vz3HHsewpljDIu9lTA+Wr0+vMfpC22E3sJv7TLae2gr7BHBcOCDYV5NfJYKQ74KbwLEBs9SY1NakFG3OQtzp4mwmd7O6tZdZ40dCQEm+fHjJhSkRoJJjJCZLELLvU1DwF1g6w7Z6FK5BplsJDLTBSTcT8lyRJ6Yjw0+oFXe3QzEwJ6zS8r/nasKHN49qfVKU1gWFWWm6EpASPdpQBIzjahN4W/bPPdBTnH3Twq1ioJvD2ZEiMI4wpU9gOmNYYh9yitcgZpqyrte+q3naHdcKD3jmy4eyl6/mREgD0OpUVgzGrHqqCrd945wFZG/MYxfO4uKEHDGB8ocIBE6UTkAKsQcGEeXgjf+AIGxF1obfaKhZ/6T9Z8nuucj2lBC5B/QJuLA4iG6hOvjKOHs/r60GzGzwVRQk+/r7eUxeDHl6r3qKAoo6BpHq+eHPr+cEMRjl9bEV8U8YOnGNzJLav5kEnZkV/iiGs2/ufDGnA92rm37GsgcN2ZszN6CykDpHXUzlf5kTzKqDWLUVOji X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(346002)(396003)(39860400002)(366004)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(921011)(41300700001)(26005)(38350700005)(36756003)(9686003)(52116002)(6512007)(6506007)(6666004)(478600001)(6486002)(83380400001)(38100700002)(316002)(5660300002)(66476007)(15650500001)(66556008)(66946007)(7416002)(86362001)(110136005)(2906002)(4326008)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UGhma3FPeFF2SXdSQjZNQTNNYzV6QTJ2WE5WejNPeHYrdXZyRWxvdEFsUElT?= =?utf-8?B?dWgyRzBNbk5KNjdURDdRZTB3SVVNU3E5SkpoZ0tPWWJXZjlPQjc3endXUlVW?= =?utf-8?B?eGdHTmVEMElCZk9nY3VMWHhrb2s3eVg1UU5aTTV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utf-8?B?M2JsMllpMGpMU1d3cHUzUEltd1oxQm1BZW9FbDJSdUlYckVjbU8wOStXKzV5?= =?utf-8?B?NkloM2ZzVVVEQ1dJU20wMXZzTGpNck1EZ082Rk1jTCt3aWczVkk2ZkQ0eXpD?= =?utf-8?B?STJkRGVCU09kQk1iSGE4NEwwbnVKdWk3V0hUZkpnb3Jiczg5SEcrcUlUUGFK?= =?utf-8?Q?rLFHTxfHuoavMYmUfUKT4DjGx?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd8404d7-f91a-4935-e6bd-08dc1d64b6bb X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 05:15:58.0460 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pcxfgHzifFWKwc4xx7I5CJuTBUDhoEF4auJ4qkPLuTGTmGcfVbKVgT6rieC5BAEBYVUA/CsUI0+5aENyrCyhlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8275 From: Peng Fan There will be changes that init may fail, so adding return value for init function. Signed-off-by: Peng Fan --- drivers/mailbox/imx-mailbox.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 656171362fe9..dced4614065f 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -110,7 +110,7 @@ struct imx_mu_dcfg { int (*tx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp, void *data); int (*rx)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp); int (*rxdb)(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp); - void (*init)(struct imx_mu_priv *priv); + int (*init)(struct imx_mu_priv *priv); enum imx_mu_type type; u32 xTR; /* Transmit Register0 */ u32 xRR; /* Receive Register0 */ @@ -737,7 +737,7 @@ static struct mbox_chan *imx_mu_seco_xlate(struct mbox_controller *mbox, return imx_mu_xlate(mbox, sp); } -static void imx_mu_init_generic(struct imx_mu_priv *priv) +static int imx_mu_init_generic(struct imx_mu_priv *priv) { unsigned int i; unsigned int val; @@ -757,7 +757,7 @@ static void imx_mu_init_generic(struct imx_mu_priv *priv) priv->mbox.of_xlate = imx_mu_xlate; if (priv->side_b) - return; + return 0; /* Set default MU configuration */ for (i = 0; i < IMX_MU_xCR_MAX; i++) @@ -770,9 +770,11 @@ static void imx_mu_init_generic(struct imx_mu_priv *priv) /* Clear any pending RSR */ for (i = 0; i < IMX_MU_NUM_RR; i++) imx_mu_read(priv, priv->dcfg->xRR + (i % 4) * 4); + + return 0; } -static void imx_mu_init_specific(struct imx_mu_priv *priv) +static int imx_mu_init_specific(struct imx_mu_priv *priv) { unsigned int i; int num_chans = priv->dcfg->type & IMX_MU_V2_S4 ? IMX_MU_S4_CHANS : IMX_MU_SCU_CHANS; @@ -794,12 +796,20 @@ static void imx_mu_init_specific(struct imx_mu_priv *priv) /* Set default MU configuration */ for (i = 0; i < IMX_MU_xCR_MAX; i++) imx_mu_write(priv, 0, priv->dcfg->xCR[i]); + + return 0; } -static void imx_mu_init_seco(struct imx_mu_priv *priv) +static int imx_mu_init_seco(struct imx_mu_priv *priv) { - imx_mu_init_generic(priv); + int ret; + + ret = imx_mu_init_generic(priv); + if (ret) + return ret; priv->mbox.of_xlate = imx_mu_seco_xlate; + + return 0; } static int imx_mu_probe(struct platform_device *pdev) @@ -866,7 +876,11 @@ static int imx_mu_probe(struct platform_device *pdev) priv->side_b = of_property_read_bool(np, "fsl,mu-side-b"); - priv->dcfg->init(priv); + ret = priv->dcfg->init(priv); + if (ret) { + dev_err(dev, "Failed to init MU\n"); + goto disable_clk; + } spin_lock_init(&priv->xcr_lock); @@ -878,10 +892,8 @@ static int imx_mu_probe(struct platform_device *pdev) platform_set_drvdata(pdev, priv); ret = devm_mbox_controller_register(dev, &priv->mbox); - if (ret) { - clk_disable_unprepare(priv->clk); - return ret; - } + if (ret) + goto disable_clk; pm_runtime_enable(dev); @@ -899,6 +911,7 @@ static int imx_mu_probe(struct platform_device *pdev) disable_runtime_pm: pm_runtime_disable(dev); +disable_clk: clk_disable_unprepare(priv->clk); return ret; } -- 2.37.1