From patchwork Fri Aug 30 07:05:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhen X-Patchwork-Id: 13784379 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2080.outbound.protection.outlook.com [40.107.215.80]) (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 12E7114EC7C; Fri, 30 Aug 2024 07:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725001543; cv=fail; b=AWyS4nFv3Rg4Lj+LcWNx5NCJ6gPqKG2E0fcYnZB+MRA/r1BRnK4+K2H8LDPW3yMozwGH7t6fVGKPcyRq650g/lbfMBgTewUupStFSx4/Q4XqCxWDw9GNCDq7qZfu4ddFpiBzzb0eAaZc39GMALOxbTpLSr1N/4XUliVsmHLilgg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725001543; c=relaxed/simple; bh=xcK7DMRnFshWgkQY3h6gieej/wQT6Pm5BvvgRkmnCoA=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=H18mwuKcUMqDmJ4SzHmH2tVf6LBk2aUYgkPdHw8OciXcdlrKXEjeV9upfZ+W52wLnsj9oAej9z0XRLs25gV0gCvbouW812llsnSXx2ACF3fyyGeyuQb6UglFY0N79vpmJrvt0EV+sINdkLlfeqK/PcjEvPYBvrWbDqNbV/8QVuE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=lqhvX2sM; arc=fail smtp.client-ip=40.107.215.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="lqhvX2sM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eOgR8BUFuTkVOI/Dahs/JV+XhQBNG4In8Y81PMpvoEXOG58AZhSRT0lImWF7xYApIsJpFCjaBe2LZoiMETZ/Ca1bj2wKR2J/7DjCm/6jVEYk8d2xVQdgUra+iCHMlcCoQg1x2ZqXeWOxVWPftgnUZiXxiVmz5z3vzjtG/hW/m4KwS19nRf+vY+doadyQu+webqdw1qFNoqrsoXO55v5poH01KdtPN41L2TxPNsqGGWmTWcpmO0YOs1r+URq5nvQ7Xp6S95q84BxxK0ov3OfSbOJ1dwXZh5nYTpghMh1QT51/G+9MsNbOu9+sZsr+rg0nrDxW81UipMOnilG4XD/zpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=gZe1OG7+Yr1X7hVRUJy/xCjYSjJkMA3UVP7A5N+//TY=; b=jiAulEwjoO0sRPMqcJilodqT4OpWTHrLFpXPK7AvJ65yJDj+7m9HhD494YYXpErkiQkCasj8fE/+Mu6e/rOhSC/9YZEzKpHqK/sga5bDVmy/sE3M1DYtT3KSfEbnNhYoBJE1syITlE4Ts4LZD1hPVciwhWT26A2BKvQgFPTTmjkCi0Q/IFIM0vw/EzciUR2ARUPgNh9O8UxsSLpKV8+VZOIfyObs1dWZog9Ea2jxw6gDAxfIjqJYSAHQmS2HV+Fuz7RTsngIL3B4/utbDliCfTLwJQjMNIWSo1jHan8H3rPwbBtERypjZrkJ6ak8vHrWTLxnja8q/+yIqxMtOHMWOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gZe1OG7+Yr1X7hVRUJy/xCjYSjJkMA3UVP7A5N+//TY=; b=lqhvX2sMLEWpeGReLI6qWu4IbfvBmg+8Q0iRon+vSUQcnF59J7xc0GnooUMwyNkuaN6WMgCpGtheWXRCuErx8TNrGYUyVAPiaK6cwVhGS9cTE6rtpeQL9Bp+lC5AI9Qf9oo/S+ta7gERztBqmvrzZMLSkn6Ew1zAhLR2t4da31dDtoeuBziJRyQsmmnVq7R3qO7EKzUDCBtcvi+F93DqoTzStVKun3oV4FaKXZepN4qvf/S++QyEdU9k5Xe2ofnP95SE6b48Z6Hv9U+eoRJSWKEE1o6MzFDNaFNod/3Kt3pcNiMToTXDGkdSQy8rAlUMw5f5Y2ILP1M76M6jBOD9yQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from KL1PR0601MB4113.apcprd06.prod.outlook.com (2603:1096:820:31::7) by SEZPR06MB5071.apcprd06.prod.outlook.com (2603:1096:101:39::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Fri, 30 Aug 2024 07:05:38 +0000 Received: from KL1PR0601MB4113.apcprd06.prod.outlook.com ([fe80::7e85:dad0:3f7:78a1]) by KL1PR0601MB4113.apcprd06.prod.outlook.com ([fe80::7e85:dad0:3f7:78a1%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 07:05:37 +0000 From: Yan Zhen To: ckeepax@opensource.cirrus.com, rf@opensource.cirrus.com, tglx@linutronix.de Cc: linux-sound@vger.kernel.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, Yan Zhen Subject: [PATCH v2] irqchip: Simplify with dev_err_probe() Date: Fri, 30 Aug 2024 15:05:04 +0800 Message-Id: <20240830070504.289450-1-yanzhen@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TY2PR01CA0008.jpnprd01.prod.outlook.com (2603:1096:404:a::20) To KL1PR0601MB4113.apcprd06.prod.outlook.com (2603:1096:820:31::7) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB4113:EE_|SEZPR06MB5071:EE_ X-MS-Office365-Filtering-Correlation-Id: d22ee1cb-75fe-4839-56f8-08dcc8c2269d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: PRmQaZbecnIHwwp1eSLNF63gnw/SnkcuMY4S5Ze0ztOnDpWskp3BX8fTc86JYvvZIcupteLg/n9JyjViijE8lf6k3BctFqcnPGRksmft5PbQaMDTNie6lFcmFRb2L3+WgGc+/3YczQD6quBv8M8guUhuEaS3OeMu3VtnJdeCmCTDHE9v9kiJ7gCyDH7rdWlS5LmSqAIKDACp4VCTpPNAtTO6gE37J6+4akhqIERV36DDN49sO8xZexJg88Ezsxk1PYfC1sEI8Lx5J7M2l/6GXyLwNPcvSNrzfcAuiQ6Tu8a9JJDMCrxN6Lfs9aWDObvclmIQOAk28d6qbsrxu0vMK+qWKA3cNR9dCkCS8CwiECNWkG3l9B6Tku+cVJJ3QDv1pbXlA097W4rCTIQ3Dr6DeUSM0PKQE65Bd/389tXDByonZ6mS/4kyHuWZJFJp+af/O1U/1Zs1X54aLTvPaQdk/GkfAMf0jvTHShJcevOYuG5lwWsREEADO+U/fhEeZz9T1hKWtQQZHu0P24/LVgTrQg7Oih3G7yVC2dhi/cTbidZVUqalhbd1tDh1VYv1AeGxMxNLuMus/omWbx6GWGck/pxtIYYD5oQ78kwKiO4ojGgpaLLdL3PfW+LqqZY8nwfXuvvqniiMa07O6BX19+IF1pK8+Q8ZsDzbl2028ncobRZVuI8GHzwz6KAM8z7rZNFoBspIDzuW8Wtz2kNjGevE5mUnAl07h0zAXTSdxAl+oYPFxtRV5z3OtpWDIN93l9PNuo1VETBWWlnd+XlvHEjKgneQHxFiG2e4F4qm8cNqNstQPuWup+Ll/UI/USFP8rtPOpefcpA/tKPwKjwELHodoahKnWrSTX73eRKHqjaPhfiP/EB8Zt4TOyIlk4YeumOpwMioCKVU/buPLgycuheAiG9NiF7iJYUoPifOhP9oYnoXlB7HLSCOXw+ci4iss87JXTt591gM682lX51ny/cUUy77rcRNMDQFkiu4ZKFg9INJ8BKqdz7HSuIGVnpO12BQh+QINnonQmkRo12PHiWo6UpDoF9XbH6tRzqv8buccX0Lyzwi/Z/C9BvGHDHwok7vPBkPh+uR0Q9qgPDbTTivp0lyNOmTda7uWq/5bM1qUC3PYfFN6+XcK4ycdfUvEKRYj431/iXXu82EZL/3D+2AGdURCYWbE4Prv5C1ySil2cu/dQrhjj58iwKoN4Pb8jAcrRkuCpo58TDfYFT/biLSsr/PF7OMtNWNNSKcQMbfV5ZS0Xyd9V8LBx16aGtnwLRAnBXzHxiH6wovHqcq2+yzPmZzXdOzkFoSKLcrQc8ZMX9hH9qYhnXsRQl5OVIWe5GEU4/+U1mcdqq3C6qf6EvujYEnPcr3J2DK8XD7fH7wti3oexHIvIbnHYC1wMwU6e575DjTUpKf389A7P/gmaHgmA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:KL1PR0601MB4113.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(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d4xILbz4kfeKqQSwcdlIe0KVb4WIGTqsnfb69SiAKdFTPJ33+MoFMAlxYZ9VqNGU4h1WNx2+3l/dgBejcOoB395V0Y1EnLVz9RTEnXJyLxPZYDGTnH+fJ2n+TivlBPidfM/gptKCqkeWIePcgl7A32ygREN1gTrrYPuwPSIYYXon5900zBNdlcNIK7EJX6Couciw6DJQ4yDWIXi/D8E6oUG2l5YjyhlrsgX2sJzG/3SnN4ymgj0RN3V9qfAXngEIcMqp6rEW4R7NJhwXS2UEEFhIEz39znWSfJ0c1RjYTWwKJrhn7Jx6qNnhHyr/0tuC44KBwCkeWALhcFta7CIPB7vlypxxFHdqypG0+4M7/zN6boui6Q2JGC0xonXxWai3Knkedbm5W/EIEhq2hm821XBdZaf9468k5i10ouWqktYPy8WTMjJbuOgwDMTsZcDmyOZ4SOLwXA4SLdMcJe0IVxCyuyy22/wyy9+ywJ6pm2lVBGU8SV5TtmpArOV9JEsZ17TgNBDX5eSvVu8P6wTiWJj5/GblN3yi408aHeN8q29LzjLeOFMbonGcG29ezIqkkqbg9f6d8DvWVarR X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d22ee1cb-75fe-4839-56f8-08dcc8c2269d X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4113.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 07:05:37.8665 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: niZ2FxaVy6QqpiwGPc3Q7nK0nTlKeUpekWLDScQyOUnMRBmBRjx9dYpDsqWlb/mKk1pl4R5m285iBqiik8DGhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB5071 Switch to use dev_err_probe() to simplify the error path and unify a message template. Using this helper is totally fine even if err is known to never be -EPROBE_DEFER. The benefit compared to a normal dev_err() is the standardized format of the error code, it being emitted symbolically and the fact that the error code is returned which allows more compact error paths. Signed-off-by: Yan Zhen Reviewed-by: Charles Keepax --- Changes in v2: -Rewrite the subject. -Remove 'ret' from the message. drivers/irqchip/irq-madera.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-madera.c b/drivers/irqchip/irq-madera.c index acceb6e7fa95..d5ad4466a140 100644 --- a/drivers/irqchip/irq-madera.c +++ b/drivers/irqchip/irq-madera.c @@ -199,9 +199,8 @@ static int madera_irq_probe(struct platform_device *pdev) ret = regmap_update_bits(madera->regmap, MADERA_IRQ1_CTRL, MADERA_IRQ_POL_MASK, 0); if (ret) { - dev_err(&pdev->dev, - "Failed to set IRQ polarity: %d\n", ret); - return ret; + return dev_err_probe(&pdev->dev, ret, + "Failed to set IRQ polarity"); } }