From patchwork Thu Oct 5 07:56:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13410124 X-Patchwork-Delegate: ilpo.jarvinen@linux.intel.com 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 CF1EDE92703 for ; Thu, 5 Oct 2023 14:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230443AbjJEOXr (ORCPT ); Thu, 5 Oct 2023 10:23:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232749AbjJEOWG (ORCPT ); Thu, 5 Oct 2023 10:22:06 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::601]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C19683DE for ; Thu, 5 Oct 2023 00:57:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MONqkwb66k+XncA3gz9lB410gcsh2Ev4RFgRjjHJqbMtAmytAN29SucbqE41r55uE5s4sJGnt8NbPUAyVUXnFASrnRZUJtAp+BQxtsD3/a0HCPVEfz+FyM+U2Ogj2FvpU4V6Yvm3VaLoGm2R45l0QzJvhp2zLScd24Z6wFCcQBxkISyT28z8AH78uXx2ZyibHgemrY74d7A9CdLLEWGqoV6fWfdVdAHOiRC4Qcmw9kThLTDwQPSygOSIK2yACBqbQiDfIEvT1f9KIs2I+JJ8sxxyOJ0y6Eck5ro54TI5W+J+JU21KZTQUFY0jxiK7yyWjiB50hMMYqK7GymbhhVhXQ== 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=0aJiJYmGTyz03pUuPjbhsbhbJe8H1KZ3QPBqD08/hRM=; b=fva/9kWYtbEkv2Kw/sNLR1nNqKbyVTx3+/CKtgP4Ly47VPgZ18JYyMuVO/JAoF9uTOzoRqP+gdi2Wr0ARlDDhRYDLOXIgl13bXc/Y3cYLoRk1WnGY9irZL8N0sFxr/VKzN2mnF8G7AN1MMg+dHyJ6YWf8YNDtSJdD464LxG6f2H/6hsdgwYk0y0qvSZ785Z6TXhFveVmXTM4yFnKx6Bgb1w0Z7jgoGkMioSCGDy23GgWC/17ExbL6/eO9X6LUWwLl2FLIMpqwZ6vyWkwYwkaH9NWOGwUiBp62ZNtk8WaNfTkqbMZEmMmwPHjqr94hjoW6GsUNhoZRiVMmgJEQo3kow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0aJiJYmGTyz03pUuPjbhsbhbJe8H1KZ3QPBqD08/hRM=; b=DbBoKiOIPLgl0Cl3r0ouzLgtgfBj/gT1HyVw24hb/CJBLxDJBCp8ydU2YfCHfS6qHgqXy7odIIhZPzXEQudUUCVDnRHixtfV6hQ8YUZZKNl7LVODt2LClfJ62WToCN++RmL8k8qPvkKQfMRuOSEYvbUolDRZRK365RfdhiwhjKN/4XqT1dihupjvoqsx6OBBrQPI+tTQAXxaokipYVkYck0sLlmY58+gcU72G3uXrDpU6Q9D23u4IwVUnEm15h7XK3tXGiCWBUi8Vzy+kZ74YctKIiEDWcgFKgGIXwoMNQjw94gMuN256i81EairjTlPVtQ2wgLAwP+kBUzsY5zGXw== Received: from SJ0PR05CA0166.namprd05.prod.outlook.com (2603:10b6:a03:339::21) by SJ1PR12MB6026.namprd12.prod.outlook.com (2603:10b6:a03:48b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.27; Thu, 5 Oct 2023 07:56:57 +0000 Received: from CO1PEPF000044EF.namprd05.prod.outlook.com (2603:10b6:a03:339:cafe::b) by SJ0PR05CA0166.outlook.office365.com (2603:10b6:a03:339::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.21 via Frontend Transport; Thu, 5 Oct 2023 07:56:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000044EF.mail.protection.outlook.com (10.167.241.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.14 via Frontend Transport; Thu, 5 Oct 2023 07:56:57 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 5 Oct 2023 00:56:40 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.35) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 5 Oct 2023 00:56:38 -0700 From: Vadim Pasternak To: , CC: , , Vadim Pasternak Subject: [PATCH platform 1/3] platform: mellanox: Fix a resource leak in an error handling path in probing flow Date: Thu, 5 Oct 2023 07:56:14 +0000 Message-ID: <20231005075616.42777-2-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20231005075616.42777-1-vadimp@nvidia.com> References: <20231005075616.42777-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail202.nvidia.com (10.129.68.7) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044EF:EE_|SJ1PR12MB6026:EE_ X-MS-Office365-Filtering-Correlation-Id: ebf6e9d9-8c5e-40e7-9340-08dbc578a5ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MnZor0UyxRFel3lREe7O3xgeQMG0kFmbQOFzgIvSbpJ4axD45/GLsbk+cH/wDNo7XuF/z+I7a0FKW/vH1IJk8QBluI8poJ4rbN6HnzxCGnYap7Cnxx8Y4i9Qo+Y2dsSsd3xhSIKycYRKKah0QLgLQIyqDztsMuHfrGpqwFKTOkLoHw+QpBv0imKRtxNVlwO/BvQSrvrTbgx1OLMZeRu5ozwQQdBtJ3yz+P3pN0h2s2Y/7qZSt/ySRd4Rxjz5Hup5xB7QMqBMN20C8s0EnH1j82HSqAOPbikLA/FSlsul08ly8EEqgLYAzOti0AtiXEr5LShGqgHHspSZKPST7eQyFyaBA/OgNtHO14l48bL5G6VXGGBkds+uBYOYiWy5IR5+fmxGCNhrQjCgUtwFWq+wbpOHdgvw+ZZoB62ydraUdYpYdrJvW/2LAbdPshoB94B4VLE8kJ88/kiXPhHwVBAZpPvmDrfc9TJ+GGZdnyXU5iEyWtzj0X9gYtAD0rJCGA5CYm748/Qb4HQ4Rh39CYqDbzsiKitShuWdgBXZ7aBq1FIIady7serOq9ZEwGFBeKhXrc4TBHoHi0LdR4W71ct/FJzABSnnOTQujhO4+8dHu6s1iCGvY5Pr2vCR4RBupvNa3EJjqb/EoN8U5FCmkas2qyVccj53tje9O+l5IOkjlHJt9LldQ3IoFGu8BJoLCn9EEljR6O8C50huORs6jIjuRyoVASwaQWmB42V+xhoCxJFx07m6iovM488IGLzZExihxSRuE00AFLSB3U8RqyZMAfEbdzaKhoFbvHSq9fM6iT4= X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(346002)(39860400002)(396003)(376002)(136003)(230922051799003)(186009)(82310400011)(1800799009)(64100799003)(451199024)(36840700001)(46966006)(40470700004)(41300700001)(26005)(426003)(16526019)(83380400001)(966005)(1076003)(336012)(478600001)(6666004)(36756003)(2616005)(356005)(7636003)(107886003)(82740400003)(316002)(54906003)(110136005)(70206006)(70586007)(36860700001)(47076005)(5660300002)(86362001)(8676002)(8936002)(4326008)(66899024)(40480700001)(40460700003)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 07:56:57.2677 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebf6e9d9-8c5e-40e7-9340-08dbc578a5ed X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6026 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Fix missed resource deallocation in rollback flows. Currently if an error occurs after a successful mlxplat_i2c_main_init(), mlxplat_i2c_main_exit() call is missed in rollback flow. Thus, some resources are not de-allocated. Move mlxplat_pre_exit() call from mlxplat_remove() into mlxplat_i2c_main_exit(). Call mlxplat_i2c_main_exit() instead of calling mlxplat_pre_exit() in mlxplat_probe() error handling flow. Unregister 'priv->pdev_i2c' device in mlxplat_i2c_main_init() cleanup flow if this device was successfully registered. Fixes: 158cd8320776 ("platform: mellanox: Split logic in init and exit flow") Reported-by: Christophe JAILLET Closes: https://lore.kernel.org/lkml/70165032-796e-6f5c-6748-f514e3b9d08c@linux.intel.com/T/ Signed-off-by: Vadim Pasternak Reviewed-by: Ilpo Järvinen --- drivers/platform/x86/mlx-platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 3d96dbf79a72..a2ffe4157df1 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6514,6 +6514,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) return 0; fail_mlxplat_i2c_mux_topology_init: + platform_device_unregister(priv->pdev_i2c); fail_platform_i2c_register: fail_mlxplat_mlxcpld_verify_bus_topology: return err; @@ -6521,6 +6522,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) { + mlxplat_pre_exit(priv); mlxplat_i2c_mux_topology_exit(priv); if (priv->pdev_i2c) platform_device_unregister(priv->pdev_i2c); @@ -6597,7 +6599,7 @@ static int mlxplat_probe(struct platform_device *pdev) fail_register_reboot_notifier: fail_regcache_sync: - mlxplat_pre_exit(priv); + mlxplat_i2c_main_exit(priv); fail_mlxplat_i2c_main_init: fail_regmap_write: fail_alloc: @@ -6614,7 +6616,6 @@ static int mlxplat_remove(struct platform_device *pdev) pm_power_off = NULL; if (mlxplat_reboot_nb) unregister_reboot_notifier(mlxplat_reboot_nb); - mlxplat_pre_exit(priv); mlxplat_i2c_main_exit(priv); mlxplat_post_exit(); return 0; From patchwork Thu Oct 5 07:56:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13410074 X-Patchwork-Delegate: ilpo.jarvinen@linux.intel.com 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 D6E88E9370C for ; Thu, 5 Oct 2023 13:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbjJEN4C (ORCPT ); Thu, 5 Oct 2023 09:56:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244040AbjJENu7 (ORCPT ); Thu, 5 Oct 2023 09:50:59 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20604.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eaa::604]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 054E483DF for ; Thu, 5 Oct 2023 00:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DIyfN3w+vxrooBCsEbVB/YJX6nNVACw/yCbGk/PTiFMJ0xbaQ+VAbeELikRukV5ccLmqMNQe/TsOWUycgWZJ5WKSeAZlwinRZxV1h2XyXjqT4s/P8TAbQen8Oh4fkNrkFVf4t+Z6324dyuDoLt8VnxyqdT6dfVNi+jj0gS/gckjqUWE/0cKXa4toJDvWB9Q5Cmv3Eeq60f6C5rcMNHkILQtWW99HMhkB0q8B4YZW+QiIjqcaSi/80j4z7xWtHdG575Sk87biPCHIWUacY1mMyQ84Skxq9hGKSa01j/5EOvkD/BbmEF9poAKw1/YMcLTHOlcoO4wnXRz8cOnd8R5UNQ== 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=Tod4HBy3gYhfo7gdRswQ+ygZSS106o4wAJ8obdh3+wQ=; b=Em+NEV58Bqy797gh5kTkNFrb3ZkTviSCzY16KU/PuxB0L/wK2UTCLgzpApSoWL1lSp1/yN4p3yBVDXAPZ0b6Wd+VMHQqsHN8rPFUmpto82cXAsSM0H2mrE8zNfgRzC0zWeOae/9xh4JALQeMlKXiW5vdIslliKKoHIh87JE6bKe+Jb3vPpWBEbFVdCI0ohHfFO6jeNE20eeQm6LcFvpFgN+0aYC0nYDWtvoXQmcX9E410mI0GFFG/WVv7LHyQTr6bCqsPIuCwM0pTNrW/Szn/mTE4wB0yMmpxOxfSO/7lXU1v3OLTEt/TUFe8acb2CVzDuh037SZVE+AfvBWyITHqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Tod4HBy3gYhfo7gdRswQ+ygZSS106o4wAJ8obdh3+wQ=; b=Cbok2TaVczhkas4lkz9NL4U7eZaChNU82qCrv2DUYmtzwmcdFwsDHzxkdmuFI/tcLt6C8N/fGpkVospOeVJDt6lXBXfQhBiScEY4Q2lTltSlBHlxacgjzEbk9jGi/y67Go5n8s5L4TRgbM76BRKD7WDTmqG7Q8qkVHe5x/JnOLePWsC7EgWZBzvsUPuEerU6XxeSoafeoyFXCV+6Kq0UAknoCB9njxE9WcANAXZWf/JdFgAcdW5G1lXmLWSLOtG0XKU0D3FGzRIRKhCFNCOANFpdqz1cQf9q/R6L7OgXClNF0RanGhb1eh8QLCbC/m2py4rpA7FOmnAN5HEOyaLI+g== Received: from SJ0PR03CA0133.namprd03.prod.outlook.com (2603:10b6:a03:33c::18) by CH3PR12MB8710.namprd12.prod.outlook.com (2603:10b6:610:173::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Thu, 5 Oct 2023 07:57:04 +0000 Received: from MWH0EPF000989E5.namprd02.prod.outlook.com (2603:10b6:a03:33c:cafe::1c) by SJ0PR03CA0133.outlook.office365.com (2603:10b6:a03:33c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.26 via Frontend Transport; Thu, 5 Oct 2023 07:57:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000989E5.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.14 via Frontend Transport; Thu, 5 Oct 2023 07:57:03 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 5 Oct 2023 00:56:44 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.35) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 5 Oct 2023 00:56:42 -0700 From: Vadim Pasternak To: , CC: , , Vadim Pasternak Subject: [PATCH platform 2/3] platform: mellanox: Fix misspelling error in routine name Date: Thu, 5 Oct 2023 07:56:15 +0000 Message-ID: <20231005075616.42777-3-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20231005075616.42777-1-vadimp@nvidia.com> References: <20231005075616.42777-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail202.nvidia.com (10.129.68.7) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E5:EE_|CH3PR12MB8710:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d3e2d21-3cdf-429d-1ffd-08dbc578a979 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9mZTKOdd2qBmYsjVPBrHZIjzmNHIkMOrvkFgQbNIjszHUryQlMcPwc60INyxNb3+rl/XdWU4Tn/qv+yNoiF9O/YPhY6m1IqRk9t9jx7wcisVdxYdkb575Act+imSNaTRAWAk43CDPjc4lusHGtArRkqXnd7IRSqOWH70CFQD4iz5S5m7RP68FHNOtOhXYCsuvEJHpw08AO48vMkMY0kfzmAYAvT4zKFcNSeaVGpJeVwvbcAysYVbgt0NgVE5uYdL8pbUARfxwbhe/MsSzZGXJN2LS0MV8yZuZFwyau4VRToCDat+WPxedJsvCBB2SuT9JnbWyWRvONo1aCOHVTT2KZamWjJU2lRGmZu3MN3FZp1qFXQ0Zg0p2GC6oF7unRkPWSWMOU4t+/ParKwyBDAXuxCC2A47Op4eps1diIiN+KugysXawKi0ggtgpza459O2hzIE9q57fP0mxErU0X27wpzp4XI/tQy+BYYuAJ6fnjIxfBUBMMwEV502x1nWTqFhRKaIlXeZY7pZQvy4ZuEoDTMqfFpES03gtZXxsk/Ncx7CihhlwrxIJy8+xir3gGU5Si7dLC939aI/T3Z08k+enjdmW1RwPA2/CLK1FtQdVjuMaLbSV28cnaOS4QHHXzR0CTGbj5MrMedy64yZaA63XZqWyWrXGQkGs6HSoygQD0lZs2hMXp7SYt6qk/mEsIh9jQVkb9ClXPEUyL4kMH8H+jhbOVowdAaXIXIpaROgBr4DE+/o6B/WZh+JW3A9w0Wz X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(39860400002)(346002)(396003)(376002)(230922051799003)(451199024)(82310400011)(186009)(1800799009)(64100799003)(36840700001)(46966006)(40470700004)(41300700001)(1076003)(107886003)(110136005)(70586007)(6666004)(2616005)(70206006)(316002)(54906003)(8676002)(4326008)(16526019)(8936002)(5660300002)(26005)(336012)(478600001)(426003)(40460700003)(2906002)(83380400001)(47076005)(82740400003)(7636003)(356005)(36860700001)(36756003)(40480700001)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 07:57:03.1685 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d3e2d21-3cdf-429d-1ffd-08dbc578a979 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E5.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8710 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Change mlxplat_i2c_main_complition_notify() to mlxplat_i2c_main_completion_notify(). Signed-off-by: Vadim Pasternak --- drivers/platform/x86/mlx-platform.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index a2ffe4157df1..5b4e57c37f2c 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -368,7 +368,7 @@ struct mlxplat_priv { }; static struct platform_device *mlxplat_dev; -static int mlxplat_i2c_main_complition_notify(void *handle, int id); +static int mlxplat_i2c_main_completion_notify(void *handle, int id); static void __iomem *i2c_bridge_addr, *jtag_bridge_addr; /* Regions for LPC I2C controller and LPC base register space */ @@ -384,7 +384,7 @@ static const struct resource mlxplat_lpc_resources[] = { /* Platform systems default i2c data */ static struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_i2c_default_data = { - .completion_notify = mlxplat_i2c_main_complition_notify, + .completion_notify = mlxplat_i2c_main_completion_notify, }; /* Platform i2c next generation systems data */ @@ -409,7 +409,7 @@ static struct mlxreg_core_hotplug_platform_data mlxplat_mlxcpld_i2c_ng_data = { .mask = MLXPLAT_CPLD_AGGR_MASK_COMEX, .cell_low = MLXPLAT_CPLD_LPC_REG_AGGRCO_OFFSET, .mask_low = MLXPLAT_CPLD_LOW_AGGR_MASK_I2C, - .completion_notify = mlxplat_i2c_main_complition_notify, + .completion_notify = mlxplat_i2c_main_completion_notify, }; /* Platform default channels */ @@ -6471,7 +6471,7 @@ static void mlxplat_i2c_mux_topology_exit(struct mlxplat_priv *priv) } } -static int mlxplat_i2c_main_complition_notify(void *handle, int id) +static int mlxplat_i2c_main_completion_notify(void *handle, int id) { struct mlxplat_priv *priv = handle; From patchwork Thu Oct 5 07:56:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Pasternak X-Patchwork-Id: 13410131 X-Patchwork-Delegate: ilpo.jarvinen@linux.intel.com 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 022CAE9270A for ; Thu, 5 Oct 2023 14:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232450AbjJEOZ4 (ORCPT ); Thu, 5 Oct 2023 10:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233584AbjJEOYH (ORCPT ); Thu, 5 Oct 2023 10:24:07 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::60a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C5783E1 for ; Thu, 5 Oct 2023 00:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DdAMqHmQ0xz7QuKaEVgxMMnHcow9XUjSRgXU9im19ynF3NcrmgklfJYS6pXdH1pDmLSozEQUS7kAtDeQbIsQveWN/sWc+fsQzajSfHJU9T+LtKacWoV058KOdqU+xluGVRJU6NrXdkDDRK5pHBOeVTFlEpPs5FVyx32SjWhWhZ2S6HJGJZQxNXR2eVqi8dNpE06fmgrzjUPlstxUVZTUYwAm33Dp4HAkSsSuQ9uRGFc8dvsmNUpJVVO081Sbc3tIpqXge37MdUOoPFkAfIBUY0nL2I3igsex1ZGDamFD2JCrJEahJFlGZuIWFBhM6zQiA9tIt5i8rEYotVPIveNeLw== 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=nzoLDu1qfsADlACrTl6Z/ExfFXiOx/ScBRk5uFF1Q4o=; b=Semni/llJIn9s4/OIDslGflfwUvFxqeIPYhkvNqsxZ9dP6NxhnKoJZidweDc+xNWBwKFr6eR+OaCQdfG1q0wtV2qu94sCLoKNlB9alGS+tE6ejETDcC9oDAQ2D1fSlAU8IVigVNtK8rfJte1e9EEOV5WyhOV0rEhwI0UCRVX9LCl9gmB0tFeUEsG3AILN5ZYnWPDYWy2XBE12Gaxnp189dpeE4MjxNmq9+GeQsjiovXvmO9XQxbhWn+0OOlLhfX4S9p+Cnc8kVLFJ/BQyMc9/BLSQt98X66SVQHRA2u9POn/bKqXQyBkNcIn2pOCsSCtGKbXo+imlujtHu9H44qX7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nzoLDu1qfsADlACrTl6Z/ExfFXiOx/ScBRk5uFF1Q4o=; b=QKqnE+9d5JM5PW5w6MboN/RqthQQO7YZFd5nGLPQsh+uABfAXie15mkHMr0YaHL2xaOM2jId4NFZstidVr0G7Szyk4uLt5m9Z5YnCLEdc/dGIv0H8/jG8H4CXgvQ+zIo0/q7ZpBDrjg+FKdBA/0afniQUCFnuqEobdttEHJwr07oz3SzCXiTfDGJur9eaKOyToSCBsSKStvKhljMUIpvhXGSY196R2UpHNFTIclRrGo1tV7b4JzUUjO8ERXEFd9s0yWfi9zCDfO4fw7S+DmTX9ikurd4okP4qIlUKMJOEaM2ccOGFoSkJWTkQ1/mGUxnVW3mt/Arg8NPV36HqMjwKA== Received: from SJ0PR05CA0183.namprd05.prod.outlook.com (2603:10b6:a03:330::8) by SN7PR12MB7911.namprd12.prod.outlook.com (2603:10b6:806:32a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Thu, 5 Oct 2023 07:57:06 +0000 Received: from CO1PEPF000044F0.namprd05.prod.outlook.com (2603:10b6:a03:330:cafe::46) by SJ0PR05CA0183.outlook.office365.com (2603:10b6:a03:330::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.21 via Frontend Transport; Thu, 5 Oct 2023 07:57:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF000044F0.mail.protection.outlook.com (10.167.241.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.14 via Frontend Transport; Thu, 5 Oct 2023 07:57:05 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 5 Oct 2023 00:56:47 -0700 Received: from r-build-bsp-02.mtr.labs.mlnx (10.126.231.35) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 5 Oct 2023 00:56:46 -0700 From: Vadim Pasternak To: , CC: , , Vadim Pasternak Subject: [PATCH platform 3/3] platform: mellanox: Rename some init()/exit() functions for consistent naming Date: Thu, 5 Oct 2023 07:56:16 +0000 Message-ID: <20231005075616.42777-4-vadimp@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20231005075616.42777-1-vadimp@nvidia.com> References: <20231005075616.42777-1-vadimp@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail202.nvidia.com (10.129.68.7) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F0:EE_|SN7PR12MB7911:EE_ X-MS-Office365-Filtering-Correlation-Id: c9437e5b-8692-4306-a709-08dbc578ab12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mmqE4mkzhbZNlUv1MGVG8xQxw+uhIzr1OIZAVUl9Y29LrVRT3wfalzcN6x187w7BHSeguC8hoXEQfTfw8aSAVT2nzm6LZLaeFUE5oXe9tCb5csFWEaFGHc4PyJjCb9LoQuqTMyfzgtqE9AY6xknN0LJdEfnVU1NdXDp4keyO/6suWzbetdtcCWJVgQ7KoNcMCKQRfeg7mJdOJ+jbMylxE9Mwt4i8+LYAFQjI/aRMqqVsLOU3rSmIvLlQzEvdp1DC+yGsaiJn7cWOKlIP5jv3B9H/MOV+wlexCg8IQU88fn/iqY4+DbGKBDb6XnSe3jK5qpPu/AclNE2GATBXrE3DHzGlEXMctBzBB+qdegQkf74FBU3X0SVJFrQHsAxkzgzpYFkY2H+m9k2DmnS5S4UShVeDwZp5XJH00Gr0Z+jjAxy8Tq87DytAcysUVaCrS4ezqXFgCcOSVWcI51tphJ0ER9cDrcmOTAibB7+Nl4Y2xqkpDgzmBM9ObDj4qjqGfM4FcUVZ+v4Uxr3VxhseNa6DEcb27WcdzeI1P4f36P0x9htLYkPeKuEKYYRwbaoVfMix9f0T4ZclHb0owjK2QWj8aAz32SywVa+8I2XpApG0H6SNOGpRJaGAvJY9IiEeawLvasTUSmKYBimiiw9kTr6h6pat0NqYsdMBNq9VO0a0q7KeMM7lYAlMASlthpVMb8nVsWOb3T5k34JruTz8A7ZOjcJafIrMAjHGcew/BU1zmfYfqgfu4KAyLtzjEuSHnydz X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(39860400002)(396003)(346002)(230922051799003)(451199024)(1800799009)(186009)(82310400011)(64100799003)(46966006)(40470700004)(36840700001)(40460700003)(6666004)(82740400003)(7636003)(356005)(86362001)(47076005)(36756003)(36860700001)(16526019)(26005)(2616005)(1076003)(107886003)(2906002)(426003)(83380400001)(336012)(40480700001)(8936002)(316002)(54906003)(70206006)(70586007)(110136005)(41300700001)(8676002)(478600001)(5660300002)(4326008);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 07:57:05.9149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c9437e5b-8692-4306-a709-08dbc578ab12 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044F0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7911 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Currently some names of init()/exit() pairing function are not consistent. Rename pair mlxplat_pre_init()/mlxplat_post_exit() to respectively mlxplat_logicdev_init()/mlxplat_logicdev_exit(). Rename pair mlxplat_post_init()/mlxplat_pre_exit() to respectively mlxplat_platdevs_init()/mlxplat_platdevs_exit(). Signed-off-by: Vadim Pasternak --- drivers/platform/x86/mlx-platform.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c index 5b4e57c37f2c..1bad4c64f36c 100644 --- a/drivers/platform/x86/mlx-platform.c +++ b/drivers/platform/x86/mlx-platform.c @@ -6291,7 +6291,7 @@ static void mlxplat_pci_fpga_devices_exit(void) } static int -mlxplat_pre_init(struct resource **hotplug_resources, unsigned int *hotplug_resources_size) +mlxplat_logicdev_init(struct resource **hotplug_resources, unsigned int *hotplug_resources_size) { int err; @@ -6302,7 +6302,7 @@ mlxplat_pre_init(struct resource **hotplug_resources, unsigned int *hotplug_reso return err; } -static void mlxplat_post_exit(void) +static void mlxplat_logicdev_exit(void) { if (lpc_bridge) mlxplat_pci_fpga_devices_exit(); @@ -6310,7 +6310,7 @@ static void mlxplat_post_exit(void) mlxplat_lpc_cpld_device_exit(); } -static int mlxplat_post_init(struct mlxplat_priv *priv) +static int mlxplat_platdevs_init(struct mlxplat_priv *priv) { int i = 0, err; @@ -6407,7 +6407,7 @@ static int mlxplat_post_init(struct mlxplat_priv *priv) return err; } -static void mlxplat_pre_exit(struct mlxplat_priv *priv) +static void mlxplat_platdevs_exit(struct mlxplat_priv *priv) { int i; @@ -6429,7 +6429,7 @@ mlxplat_i2c_mux_complition_notify(void *handle, struct i2c_adapter *parent, { struct mlxplat_priv *priv = handle; - return mlxplat_post_init(priv); + return mlxplat_platdevs_init(priv); } static int mlxplat_i2c_mux_topology_init(struct mlxplat_priv *priv) @@ -6522,7 +6522,7 @@ static int mlxplat_i2c_main_init(struct mlxplat_priv *priv) static void mlxplat_i2c_main_exit(struct mlxplat_priv *priv) { - mlxplat_pre_exit(priv); + mlxplat_platdevs_exit(priv); mlxplat_i2c_mux_topology_exit(priv); if (priv->pdev_i2c) platform_device_unregister(priv->pdev_i2c); @@ -6544,7 +6544,7 @@ static int mlxplat_probe(struct platform_device *pdev) mlxplat_dev = pdev; } - err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); + err = mlxplat_logicdev_init(&hotplug_resources, &hotplug_resources_size); if (err) return err; @@ -6603,7 +6603,7 @@ static int mlxplat_probe(struct platform_device *pdev) fail_mlxplat_i2c_main_init: fail_regmap_write: fail_alloc: - mlxplat_post_exit(); + mlxplat_logicdev_exit(); return err; } @@ -6617,7 +6617,7 @@ static int mlxplat_remove(struct platform_device *pdev) if (mlxplat_reboot_nb) unregister_reboot_notifier(mlxplat_reboot_nb); mlxplat_i2c_main_exit(priv); - mlxplat_post_exit(); + mlxplat_logicdev_exit(); return 0; }