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: 823893 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2057.outbound.protection.outlook.com [40.107.255.57]) (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 9987018C91D; Thu, 29 Aug 2024 08:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724921627; cv=fail; b=SJ8WzLpatb5+/BVOSqcJqBc4NSAQmEVL+hAAMvGM03nHy9WFMYvKT/yD61HWkWnqHBO330K5csviTDnbqaPZzO/fviKvIJu5aevROBHbu96riQy0+ofTraqPbWZ3y128QdkbZYEzn29FKUR7bzDYk+LU42Np5/jPB8W9oUNJ1OM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724921627; c=relaxed/simple; bh=QseR9XIxFYcs9IA91uMEaLHQJxz2D7jpKiVrgf62+8k=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=fqACUOeh/e+HuRGTfiRFCq00cLdW7SCfxRpjgVybi+dDBry1iKHffFnMumvyv07UlOHiZaaMrV4kBolS1TNURee/TtuIktc1suriGhioZte/ZJdqRdUd9T592xfWQbgvVn3owoD504tH7p4ga4j/nIDURbOvrsOJuC+TnWHBmOA= 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=CO7eTIZ0; arc=fail smtp.client-ip=40.107.255.57 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="CO7eTIZ0" 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) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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/vBEWHWkb4nWyClxtszvr+uEoziba5QOpKG7vN1mV9iMbV96Uv0YUADJiM3aEzzRhI3OdFx0Kgtd59gi0aKDEUdVuhfFUude7q0QWl/qRG6p2PHRKm/6Q2jxxy1ZH4pPONWQFhuTlnUq9TOK8nPuoRupyloA6ob3MIZyiZ+JlWk2HV0yAhHcnwnFrOrrMi3yiP6DZ19hcU6OwbtfZ6+s8lXGuNtwzfXMkYEcXAiPvUH58NjV8h7Yo7WhdUyMbZDTrwsZKjj+GVkGB6wpV/jsPtD7nHDK9QhZMjatjDq9Xy9LHFgxiEAlLBJEVFzpPAjGrp1SmfWEZVUXICYoMmfeKgTI79VVc14SiHFc0OA0bj6jKbI+xytzIZqyHtJUgU3qBCN9OHoPONNjMd3ILYoqEB7pQYVqUIrH/skqpsjzusREHmy1BeZLNCqhzLcrpdtcAQ9Xeap392twGLzDlsx2KuomvMTqqsmVAzrq8Jks5bTk62M9jBeAe1E25OYGLZbomdWIafgawUGUCSZfOdJIwvOqtcDRYdU0fWNBCbIsy+w1Kgt7ZHQA7IZtFRQDvvL47icBr9/7453qTwm4rrBcbjX6UMs6P8xhTEV2xjtLW8vYmoN+fZNseS20KqRxT5M7SgUK92wggidnSIrITozpKI005c5EfPiay+ouzwW2DskxIESck6LKSj27obPPb2ETA8+XKSaHJaVB1GBUVIq5C4kSvAj9w6sgmjsjfuFbQNu93kk/WrYcK7pGNcYrL5Pax7E+gwgDhkXSEeBCKeEbD9j2DLWBn3oV8h2+kdFESno+rhLy14bdwcTO10r8+iYI5qmfJR4KTZmAmsvr4UGRbrAcNnZDXiJkQO7NxVp4KPGR9iklvkrDxn0X+XEplGeBwElUDzgzmVH60CuwiAt7W6hTPc2Zb8wnDiw2L2gq1Hmp4SLp6Hg/BfJvr5fWeynLoER7g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYZPR06MB4461.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38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5ZmqmvI9t2drVqKL7x6dYs2oVCQ/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 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);