From patchwork Thu Aug 29 08:53:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Jiaoliang X-Patchwork-Id: 13782809 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 918F5C83028 for ; Thu, 29 Aug 2024 09:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=jslOOAygf6ExEFxZUEIrshT0/0QcWXbW47Zz4rVKLoc=; b=qT2abixqjO2vOhya7VXk6MJcFM eBZh9khfSBWXjjevSfCq1Uz2Bgn7D9WKtPKUTsxn4KzdZSP3dut9KyWNdIOX5AGrfuQ3UqbvxBcmF S2lmwIyCFfxsGx40QRSUQs0vIghRc4Z8f2VAT0Mn5mae5U/dtP5SnA+kluiXi3TRHyRkaesv3zxs0 f9lav6uVcQvBRN8Vvmc2fPdTkJlWrQYX1q4TKdyfjpyWrsOiUjCmifMotc+YJYlGJhKMGSb7FrR+d Ym92DsVjNtlTfhfsEeDiuqnLsxTXJjXif1kWsvYT8OaySq1UPayV34f9Dzx31BFxoAQXRYd4Ls4xm AHM1F5wQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjb2g-00000001GPy-1r0D; Thu, 29 Aug 2024 09:02:10 +0000 Received: from mail-tyzapc01on20626.outbound.protection.outlook.com ([2a01:111:f403:2011::626] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjaul-00000001EW7-2Ebf for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2024 08:54:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=st1VL0Y08GC5+439L47up74z0uEdw/aK8oAqfwWYTi8xWkrWbhvLOU80O6rDiqoN2B55V83dk5fxRBVnXiueUpgZ6CgFq7h93Sxg3Hcfu4UIEVjcXGR5BH5yH7YrTnpa9Z14a13gFPAph1ZrmOkEHooYMy6MvLXaf60pEe9HT8RURvlhD50SjiO+6oNLRBrfZh636vq/uD9JpFUnOqTDzBj+Hz2hFzkT40oYnUj0vM4Dd/fVrgsYGxKDmGXtRY7oobN8lHGjhV72qcYViY+ogxdPYeCW9LfZkgF6ZKkdTw7E7cy54COcKqzJt8jZso0tiM6CLGHPdC7aBt8mP86Jxw== 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=jslOOAygf6ExEFxZUEIrshT0/0QcWXbW47Zz4rVKLoc=; b=sTrpe0HQ47zX0spYkHjQzuZLcewXYUBDr0KcuP8tm+Ou3S9BPSm2nhwVEa66VTt+v9ChGYQsZm2IjOm/lcarf2N/wZb04bR+k3GtksXMhGeupxYTeptV1bwYFSVY3O01eWp5lthun0nEGS2Wv5Ve7dhSp7GJvlCXOf6o/sqbo2d5dijBh5t7UCJUVKRxALMzrA32XBGw0ui+Tca1BjR2RVqAX3hNtd6Z+hTeUM9f6OsLMiF3YkycWQ9aHfB3pnq4cJIz/JJeXPo/0RqtVT2ph7MrI2/sH2mGxVOWUA96/vYmM00JjV7c9lW4J4zmutouzAEV7ei/d+IJSVo3WxP8Fw== 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=jslOOAygf6ExEFxZUEIrshT0/0QcWXbW47Zz4rVKLoc=; b=CO7eTIZ0ZgO5c00s7/uvUoa/cad3ezhsEuxDifA4oKWCZK78hIJZnxtxKYX8vg8VcmsarU6zO7VPcHfnv3lznrPdmIDy593zaoxK4/A27T2rJ4LmsIC4+CWh7/O4HXcnLgEwKREU/rZlzpYF8SqBaclRk/lvAx9tYe249c0ferXxYKKL+Vl7Xo9kFHJFFSRVUDcoCKOEfgNEVEBau0j/VhGP9qPgyeCqXRyO5UigVdJnoykzHy5S9LAlc507wqDnbpsEAK/86YKHwy+Um3ZUTn4f+H+9osAzKXMZ334GKRM47NrXTcRjyT/SPMZAyBhyavHkcn8IO5E2e4+8X9x9Hg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) by TYZPR06MB5870.apcprd06.prod.outlook.com (2603:1096:400:338::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 08:53:41 +0000 Received: from TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70]) by TYZPR06MB4461.apcprd06.prod.outlook.com ([fe80::9c62:d1f5:ede3:1b70%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024 08:53:41 +0000 From: Yu Jiaoliang To: Jacky Huang , Shan-Chun Hung , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Cc: opensource.kernel@vivo.com Subject: [PATCH v1] tty: serial: ma35d1: Simplify with dev_err_probe() Date: Thu, 29 Aug 2024 16:53:16 +0800 Message-Id: <20240829085316.3144246-1-yujiaoliang@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYCP286CA0049.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b5::7) To TYZPR06MB4461.apcprd06.prod.outlook.com (2603:1096:400:82::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB4461:EE_|TYZPR06MB5870:EE_ X-MS-Office365-Filtering-Correlation-Id: b9c3919a-d44f-4750-afea-08dcc80814d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: 37cMdPyECuP/2ORfrVflAWDH0Z1d96mju1OhDvYKOj62+Zt+x7OwsP5ynDbdm8TI27E6tjIRA2ERjA9QvbgsC8XA/fCDJH49bYZm8WfV3su/XU9mjR8Xk8D+I/AqEEd8NpHpZoclX4D+OmuiqQDQHvf2jjM6/qeB6qX1m3P1I+Kb7x3yEqvzxZ+FSFcaCBIt4JTrknHddvkwashdeSIDj+wms2j/Wo/k+BjmR4rAZP7C5jB9WIlDLcuBrB+ote0xov93IDJS4X3EPGJD+Oabn890mmSqMzkCfx2HRuG/ND/VVQYtdRf3zfIuZr6HSwwf6ETvpqXNwSrzVx1RW3JQzZ4jZE48O8kA2fQGYgwhrzHN49TuUe0Jj0yJ/lcrfn0Vg5oP8qit8R4DjLC+TVT9i6zXG3d6aNXz5aZujTzoniDb/rUTJKou4sH2UUKwlLc4PEvNCEWrkjBMvceiQ/v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;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6TfyQupAUqXlKRjOcBrV8G+Msz5+tXAjQcEqznwkSj7rQnqvB+0kP2aAvz4Ud1PTupMNb5dlirUVo/R6msr9g2eo7CNVp4R1LLILhfoLWHvx5MbOiJ2xyiLQbqsxM/67RVb02jPML2Jb/5hzJEgYOce43T57ZmNfZ2/G57XjgiU6ERIk7lTCEVzswxSsZvm8tJBxibiQJ42gB+tMNT9+1A38gl/eznflYJXLHzE8BGjEvf2VKiTCe+hjEAHumGtG9/qU0M8BAi4jT/i7efVwsuKbSgpjDc1OOM8Eg2H3vUBNdEtmg2CojoKTR8zonhjjFopPliBreB+MNijvr8oDc/i0MSgBFbku8yLu/SgLhytrPdzTR3+LWw8NB4mtI10g9gbbKVibSNa/huu2lc32RJzXET1qVAuDiyBqgj0yLJ0ZqUa32mxcWYgV3Xe1r8t8M4azMsSmGGNP/XCrVc8YKX3cmFnVzUZBddFtSFXAiAjCveatv3TvuYjWwtQsG+S1XHLLE7s66S2Gqe7ypaRB+KbHukVddsHU4FTQXfemSBXwikrDE1E8Effsc69A2WkTKFARxjov4jGdhVES80Wi9jn/0pSdDdJQOC2DYU27POLULEp3giNFUCKpMEZHbLXXzPp/0hqn8YexxtNofzANT6b2rjyILSf+XaUPc62OGs0ihAFmU4mephPaI14U06iuBcmJYWxzaKJpbzajbBRAvxNLbT4CtJV1ZkPMgwukWdo+kO3YCj2wFJJUefM8Amhk/vHtDEYPjWFSD8zS7iOT5ZFC0ZOIbUh6cVA0V0TdY0Q2E9HRG306xlpT0pNxpwr/ByPdbtDw0GSS3RgkDXQxnXWXiZA1HGQCWwfFPJ0h8vemfX7EenRdJT7s2zPU94qDpwgC45HMXth0e7h8C3N7ybGvq6bKtH1zG/oYW1xvDbRAPNcZJ+IEUJ4YJupt1Sl11W8GjltjMgOopC0VxgoEezF62HYiac+ZhWe2sracNhqfe1Nz5ZmqmvI9t2drVqKL7x6dYs2oVCQ/2o22Msng2RGhFPe+gs0SXWqUedLMMgqbXSjxuabqA/MhRiKGP9XQPk6Q29IY1dLPkDIguXoL/zZwh9Cfx5qm4V3/2nX+bkDb7lwXyFYptABzfIVNhcANSDDH/Mxlm3pc1PlluY5hbNwXHFjGYJ8RD48U5qTPI7LEdmM73eFUmfdWPjYnoEawlnHyIelBzGvUxAJD4s4i3Tcao48emohrCkouCBNsvlVtBpmbj0iMeFOb0/4DRxYHVjUNwEsrw7rhRk1IwjoOThex3wsFn3sij915lX7ZoqsyMJdo//p80+JRsDp0IFrZ5N4wxBa0QDr3v9RaRNckTHlCWaW8/swBmSiE3FBw9rJWGPARkQq+fgG+aMxcLIAn/JcSe3HoRtuXGThDfjzNXFaCHXTWi1+YoKYyeM8BYwTEijbYdk+jDVrSnMk/MuPZZiOyEatq9N3YbemF6pK4fwZ1IgvKCWRn6EWs2ZKUGkuJZ/df57tKNqtyt3kNwh0Cf5t36JBXkuNxqd83qIhBtfcuyKzUUnjNbNnUlKnvgfweQmFW0FT0Uk9/UodxqBNT X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9c3919a-d44f-4750-afea-08dcc80814d3 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB4461.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 08:53:41.6006 (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: Xow49idZ1F9VxhUSnYc18FTnXu/glL+SacVh839qfQYRvDvVoZXiQWfiZxPAvZu0Qec0A4VXEWsQCK4pwQSqpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB5870 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_015359_595642_2F78C651 X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Error handling in probe() can be a bit simpler with dev_err_probe(). Signed-off-by: Yu Jiaoliang --- drivers/tty/serial/ma35d1_serial.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c index 3b4206e815fe..09d42a4054b3 100644 --- a/drivers/tty/serial/ma35d1_serial.c +++ b/drivers/tty/serial/ma35d1_serial.c @@ -692,10 +692,9 @@ static int ma35d1serial_probe(struct platform_device *pdev) return -ENODEV; ret = of_alias_get_id(pdev->dev.of_node, "serial"); - if (ret < 0) { - dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", ret); - return ret; - } + if (ret < 0) + return dev_err_probe(&pdev->dev, ret, "failed to get alias/pdev id\n"); + up = &ma35d1serial_ports[ret]; up->port.line = ret; res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);