Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3958477rdg; Wed, 18 Oct 2023 10:32:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvGOBfgAvHYlvTjrZ9nPHlB8x8j5tlEj6Qjn8aaRkEZ5Kj7cKgdDPoJMbcuA0IQQpSJRDU X-Received: by 2002:a05:6358:c10a:b0:166:cda9:c1d5 with SMTP id fh10-20020a056358c10a00b00166cda9c1d5mr6153667rwb.10.1697650332986; Wed, 18 Oct 2023 10:32:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697650332; cv=pass; d=google.com; s=arc-20160816; b=KjulOFO93nmapZCtqYQ6TFYveuMSPHUmT1rjUXAg5ddUMcqJt5oXh6m43+Z11ESCAi lQV4RjEyNu9uiL4cKhj0oNGU8L4pZTRC2w40X7v/XODs871byKNwkHnt0iNAGX+iSwBm cXnO4Bz7Go9tEJshFVZaPW3CR07rTyOnwae93WWuoJPijsAab8OR6YBPQZemdj5EeVGm u1Vnr3Q19cwgG7lOshmROTExGE+gGdRekirMgmQZrMW1D5ZR8hj8PWuGAahixanMivtn Gwdb7wpwjjAZ1DUEd5o7JjaaVIBqIDhDLp4+fbTPAjdOGUslc/GOaavxSgvS2PcBUFDj W+Kw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9sDEWl2jwqd1G2P3lOG6nRF+RXcG5Z8R7T0UdFKmmd8=; fh=hFvTC2Mxk7ZxjicXyx01h9ZhwAKmUJzmpKxGklSSNB8=; b=hmPptUFfMn9hGHRK/1IHJD8jqF+G2nLKh4ZgdcNTv6PyzCzQruH/NCWcbJ7157q6Dy S2Ou1cCzhUTsO5dJYpEmnjCGU5vvxrDHc9LgeomjDqvIZXaAuviuDdXOEAtso5vY1iFW DFjA9DH+lBCis23BKFuOkqIDdxPOkpMFD3/MPLZPBxjX4lBEEDXmuWmTxHJ2LVOWgn+4 359I+9Kw89Bij0RdwEagRSucGG7SBB7V4PzH0VdMhn2lZ5t2hFMFfk9GfpdIC2D33sfQ JLQpthLVoel4ttSporWjIHfuxlRplnKgNLXOQBIuP8Z7m81R2jtrtwiBRjZVxiiS3d3R ldZQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=FwwgIzSH; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ca27-20020a056a00419b00b006b356972c78si3966558pfb.405.2023.10.18.10.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:32:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=FwwgIzSH; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 59C90809C933; Wed, 18 Oct 2023 10:32:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232187AbjJRRbx (ORCPT + 99 others); Wed, 18 Oct 2023 13:31:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbjJRRb0 (ORCPT ); Wed, 18 Oct 2023 13:31:26 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2058.outbound.protection.outlook.com [40.107.212.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9B403AAB; Wed, 18 Oct 2023 10:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lkZoxab54vQbnOAQKGIUzbuuv/k5pqVU2bThBS5mLm656mn+yCwxjFcsDAvRxsmkoH4rwlfN/JI2+g3iAG0W5RUH4ngbmLvF+t9fkqeaqrqxYLTgCppFwyROHBz8iMU4dMCuIHw4Kqi1LTMmCG+vMnJ27xfXVI4sRLg7gLfM/8lBtZJoonmGnXn1BaY7FH/jqBpbYA4ECZH7Tk5pEhbQBHwJ8bKb2yfXxlHNhRgsqAZSwJPuNKPy7lRW5ynqcCnWSsdadEmP79gK25jDUTgTwaCGXNn6D9mAUrdjbEV1Bbml1WynnXm7sD1cL8xjy39HBg+8TOD+ljMmoU1TKtrpyw== 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=9sDEWl2jwqd1G2P3lOG6nRF+RXcG5Z8R7T0UdFKmmd8=; b=lkKrMC2NX9TYCb2DPCohkx7nIvHnHbt+z0IDplteih10s0YnpLOhajpkL3MSEWoz99fqHuBe9BdngP3Mqdj6s+zYJVsGoGkPZB3W3QFmh7CrL0+6sXy1YHkPzhhU+3r4WVfu56J7otCYhOCuPaEqxA6TXRO6MCBYa/ZpVovXGv9tTI9FGvbxWUolELhV3nSDQuR68zZVcWVgEXetn6HG2xgbOp/chr85weg0PCB6qXivshV+xBmtks2VTy9AoriYlZ/lWdbgO7cHAOqX1Z+dNWLdCN+2jq6DS8HCuSWraavqppdeLD5TcfyBUsky49lpIk8hjk1P+qVjM23VE51oAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=stgolabs.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9sDEWl2jwqd1G2P3lOG6nRF+RXcG5Z8R7T0UdFKmmd8=; b=FwwgIzSH7947WaQwfV8On3ZjO1iUVpoC9rT2IBcvtB+sHC+AQUce1J4uyQ3T8z7dq6XwB4T6V6LO247TlRsN1zOPXWV+jY6NXZgvsAK3FdUA0L5Y+XE8zP5DjfuMH5/c7fGdmyYqCr5qtvCR9QyUQBwtVECK4DG8iXtzGZM6YjM= Received: from PR0P264CA0185.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::29) by MW4PR12MB6801.namprd12.prod.outlook.com (2603:10b6:303:1e8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Wed, 18 Oct 2023 17:20:51 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10a6:100:1c:cafe::f3) by PR0P264CA0185.outlook.office365.com (2603:10a6:100:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Wed, 18 Oct 2023 17:20:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Wed, 18 Oct 2023 17:20:50 +0000 Received: from rric.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 18 Oct 2023 12:20:45 -0500 From: Robert Richter To: Davidlohr Bueso , Jonathan Cameron , Dave Jiang , "Alison Schofield" , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams CC: , , Bjorn Helgaas , Terry Bowman , Robert Richter , Jonathan Cameron Subject: [PATCH v12 20/20] cxl/core/regs: Rework cxl_map_pmu_regs() to use map->dev for devm Date: Wed, 18 Oct 2023 19:17:13 +0200 Message-ID: <20231018171713.1883517-21-rrichter@amd.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20231018171713.1883517-1-rrichter@amd.com> References: <20231018171713.1883517-1-rrichter@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|MW4PR12MB6801:EE_ X-MS-Office365-Filtering-Correlation-Id: c37b7886-d943-47ed-ddf6-08dbcffe9362 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n4VbFb7QVSD/M5CFFraPyCgrovq80Mw1TaqD7dmjLRk0g69t4ilPQr7OzEbsuaMp7+8xbWKQQkMjVgpDjysFCQU4OE94oDAjt2xDLBLS0n9aOtU8kStwLn3XJicmUZpygmkXWNzxVBxzAZ2taE6OFOe/liT/brZxL38u/vmis3hvAAgcSr2tgT+ZQLiihzW3LmvEuOrnVVlmxkHye7GeFRcCYkR8catAOdBgR7rbu3P7j6DPrGKCOVtR1SbH1Usci+UcPn2YflHRZv0TOF5h/Kfh2eIpwXIk+ikU/BxfbU2fYxmJXTUNDVTyUpM5jb0BRYwTETP8GjsI1p9tNyNp2EcQRf4GtXbv9gXs9VdVuTfRMK1hjUqBRiFtuO/MpqvudsEnhB+XMrPv+3pvOWnralikJVkop/ehlc98Fr0fcL6FUUoIgPpHQPOkqEyg4iVCX8fH/qCOW9BumFV72DoVDO7BVD/DWCqQl3zgWy4rzL9tuc8XbAQpuy21qsmhSy0CMao0JsaLvJtAWvXfGaVT2mqAvxjIBIcVFxFAyoVm8QGzJ4xHdxncLTwAk76ctOC0ubSqxeTz6teHlgWAglvbi08AMW6Fh5k79ywZQgJoZwIpDpSXQkK15Y7+RTXQTj1/DY6YeNsLAGr9c1WLoX1UE5XRLqEFO/Q1dpugOXVhZDSoV8pZZLjI2yEKENXnyXw6f6zFpY93yyVpnPH7xaoy8rr/xD4QB56fpNVH7FxwGHMCtu/uVUbXZp+Mkn9LD1WFFLV6o6bDYnnLIX83Hv1Raw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(346002)(136003)(39860400002)(376002)(230922051799003)(451199024)(64100799003)(82310400011)(1800799009)(186009)(46966006)(36840700001)(40470700004)(426003)(6666004)(41300700001)(2616005)(1076003)(2906002)(82740400003)(81166007)(36860700001)(40460700003)(40480700001)(70586007)(356005)(36756003)(83380400001)(7416002)(478600001)(16526019)(5660300002)(336012)(316002)(47076005)(8676002)(26005)(4326008)(110136005)(70206006)(8936002)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 17:20:50.3804 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c37b7886-d943-47ed-ddf6-08dbcffe9362 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6801 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:32:09 -0700 (PDT) struct cxl_register_map carries a @dev parameter for devm operations. Simplify the function interface to use that instead of a separate @dev argument. Signed-off-by: Terry Bowman Signed-off-by: Robert Richter Reviewed-by: Jonathan Cameron --- drivers/cxl/core/regs.c | 5 ++--- drivers/cxl/cxl.h | 3 +-- drivers/cxl/pci.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/cxl/core/regs.c b/drivers/cxl/core/regs.c index cac28a656cb8..372786f80955 100644 --- a/drivers/cxl/core/regs.c +++ b/drivers/cxl/core/regs.c @@ -386,10 +386,9 @@ int cxl_count_regblock(struct pci_dev *pdev, enum cxl_regloc_type type) } EXPORT_SYMBOL_NS_GPL(cxl_count_regblock, CXL); -int cxl_map_pmu_regs(struct pci_dev *pdev, struct cxl_pmu_regs *regs, - struct cxl_register_map *map) +int cxl_map_pmu_regs(struct cxl_register_map *map, struct cxl_pmu_regs *regs) { - struct device *dev = &pdev->dev; + struct device *dev = map->host; resource_size_t phys_addr; phys_addr = map->resource; diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h index 3b09286d9d52..378fc96ff7ff 100644 --- a/drivers/cxl/cxl.h +++ b/drivers/cxl/cxl.h @@ -286,8 +286,7 @@ int cxl_map_component_regs(const struct cxl_register_map *map, unsigned long map_mask); int cxl_map_device_regs(const struct cxl_register_map *map, struct cxl_device_regs *regs); -int cxl_map_pmu_regs(struct pci_dev *pdev, struct cxl_pmu_regs *regs, - struct cxl_register_map *map); +int cxl_map_pmu_regs(struct cxl_register_map *map, struct cxl_pmu_regs *regs); enum cxl_regloc_type; int cxl_count_regblock(struct pci_dev *pdev, enum cxl_regloc_type type); diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 037792e941f2..fa94bc61af25 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -898,7 +898,7 @@ static int cxl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) break; } - rc = cxl_map_pmu_regs(pdev, &pmu_regs, &map); + rc = cxl_map_pmu_regs(&map, &pmu_regs); if (rc) { dev_dbg(&pdev->dev, "Could not map PMU regs\n"); break; -- 2.30.2