From patchwork Tue Sep 3 12:38:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Suma Hegde X-Patchwork-Id: 13788651 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2067.outbound.protection.outlook.com [40.107.244.67]) (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 4ECD21CE6F5 for ; Tue, 3 Sep 2024 12:39:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725367150; cv=fail; b=LDemYk8jIlPkW6VzEe839Ymxjl/8fP+GJab11E+K0SfgMbJExGFsSy9JjINjNleBB+EQS0CxBoFIGFdl5F1QsfUSY+PO9ZPEnw524q7MMVVsdrY3yuHn8KWAEp6VNVLI8vwaogob7Hxs/LzWuroBsPKgsb0ElnJ3Go2sosJirSk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725367150; c=relaxed/simple; bh=dSKNd7V0rbBEQnkWFIQurqqa2+vjQNrstGwSsI4Mspo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DxSPL4ARxznxsPuV26HkR5zeFcm7iErCm+LRqHSYrt6dRT7jy+86Rv24z5Elff/PILqWmPk/XYHAaDy6VLj23tnEFvTNU6qAuOPrnXPmQTkYXsXXMFHkwre1AdDdfPG64czMAbnSknvirC34/frYBlitndveCgN28x/RTyIEvoY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=vrg52K7D; arc=fail smtp.client-ip=40.107.244.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="vrg52K7D" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L6n12ENvVy8efgt1HoTCoaRKbMsmrP90gNjCg5B/rA4hGYk30h5E/ha7qxHxHCLuy/qWuxibpnfrhVpYnXoKkerA8mOgk4CkMdZMBqO5sBYtHBloXttObbL9jfrN8JB1pukvVm18ZIxsHSMdSYtlN/wihdxDIeaQtfxovC8EvO3zgFKJdCjm6E/Mxu1dMcPE/WHOSMnA7xFLfGzWQToOlxpu15L4ujvCoAjuOR+TTjPczdZeJbMotHZO7WKpoQvHmTqCWb7sAHHZI0XIrV2XneYd+2Lc8NYgGePFXphnI8D3kIobt3Am05Y4ynf2DJ4tYIwubBcHrEiWoyMeEy0t4A== 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=LNazj1u7/aJ9Durh8mptior5dwLufRAmYpGxNbnZdk8=; b=rF7AM9gBbYBHbFeu+88h5tpKbflxaSX7IAVvoMghGL8aHLx2FgchH7q+qIq9acbubZhkNNQT0ePFQK9o3I6HyQj0jgRKPLva9xktEFRIkH1zbaVYn7nnwh45EEpbuVK796BOoIO8XxClYnzHBnz0J/QwueKprqxl2Pjkb+TRpUM3jplx87IFSo8dELq/7Z/QzLSb85PfOJ0Jk2FiTDu2XXvZdI90wfkYUOJt5BaEY5HEEi336ElixJtm3+lVAWRspkWz2ZHGYYetmwsmG9u5ofyym8JeJeSLe/AgUKSruPCM/yMvyVf2JXYJ+6kYVlvNFdpkvKLgoOmdONYgPKA6/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org 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 (0) 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=LNazj1u7/aJ9Durh8mptior5dwLufRAmYpGxNbnZdk8=; b=vrg52K7D6epxq7kFgOSULZGsSAPFG8CJse6I4DvaAO8anOXihnjE8a0Mt6kALJ24zTNzd1t+1M4jUa6MWdwPFacAIyd0212AJcXpi/hpsqJAseGiCehZvsdLWHn9Mhk+UXqbXJp2iBWawcKq85bjO4UY8QKyGr+NHA6eZPNo6uw= Received: from MN2PR05CA0055.namprd05.prod.outlook.com (2603:10b6:208:236::24) by DS7PR12MB8420.namprd12.prod.outlook.com (2603:10b6:8:e9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Tue, 3 Sep 2024 12:39:03 +0000 Received: from BL02EPF00029927.namprd02.prod.outlook.com (2603:10b6:208:236:cafe::55) by MN2PR05CA0055.outlook.office365.com (2603:10b6:208:236::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.14 via Frontend Transport; Tue, 3 Sep 2024 12:39:02 +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=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by BL02EPF00029927.mail.protection.outlook.com (10.167.249.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Tue, 3 Sep 2024 12:39:02 +0000 Received: from amd.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 3 Sep 2024 07:39:00 -0500 From: Suma Hegde To: CC: , , Suma Hegde , Naveen Krishna Chatradhi Subject: [v7 07/10] platform/x86/amd/hsmp: Change generic plat_dev name to hsmp_pdev Date: Tue, 3 Sep 2024 12:38:27 +0000 Message-ID: <20240903123830.2717196-7-suma.hegde@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240903123830.2717196-1-suma.hegde@amd.com> References: <20240903123830.2717196-1-suma.hegde@amd.com> Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB03.amd.com (10.181.40.144) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00029927:EE_|DS7PR12MB8420:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b900af3-ebef-45ef-2ff0-08dccc156455 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?jBl8pLwwYoiE5MPlDhj9FkgDM22H1TF?= =?utf-8?q?gPu3S1H307OXVabxh/TxYhSw8RcFeL2dtLUiHGCy024DlbCKyLRoJo/8X+HUeQvJU?= =?utf-8?q?fOd7gpeAOKE4/EL42bMQdnf24Xzg88kf+TkM/6mIekXzlUd4U9FwWjzZDxoPcuHlk?= =?utf-8?q?v8xaQbm/miiftVdU7nCDZsSAWfN1mwDGV1tmzp42hkURVpJifvMHBkbpqn4VxIvEC?= =?utf-8?q?58m9X/grrJhK0uO9dcdPMdSlno43JgBxw0qTFfF2Bo13nPUzV46Z9cdD+6QyRJSPZ?= =?utf-8?q?ijmgMnwyQ7t4c+t5LNL8aBFIcgkwjGccPnywL4VFjsrAhdTyV3mFo37/v31vG71L4?= =?utf-8?q?+FYrVKygYrLnbh2TXzyQpZDAlj13QYl2AxWIBeGMCi8NdkYVfD1cCVSPbgG2KPSdp?= =?utf-8?q?yBC2PcP/ycObzHjc1QuyFg7d+HdLI1R7us79LbG6IMX362WL+PXe+gUQ0p4whcMTF?= =?utf-8?q?ZmHuuBYSa+SqxpOtbrs6t9u/LaXzGRYf9fmX0YQJz4oblVQdSYP8JfRydwJyXPgZd?= =?utf-8?q?zyJwYftIN268ALXABU9mtzlzlG7omgaDiSdVkTqVhV/byel8masC5bj/KmVmkLbhh?= =?utf-8?q?zFQU1//EcPSrus7xdIXK21z0Qw7nGaNZCaT32Wsl+6aq0TuaEPiJ/vGmzmFGOh9D/?= =?utf-8?q?oSW2bKMbAkrQAiTtil/VUgrLx4hCWLRN3Ih8TBZtnWoTDGpyblNgPpSyI+o4zBC4G?= =?utf-8?q?xkFzeAX1taaueluDbpCPLs67HdVu+tai95xhLag+wD9xCVI68RP3q24N9f8vmBWcf?= =?utf-8?q?HKsMvOt5XpXWJ6ccVMqs+LoMDc+je0pyGJVVh5QfAqSZyYZxUoYQsQhdl4pINtn0X?= =?utf-8?q?F3aaQfbSmk32/V88uNVagVd6cgC3kmsVIAQMW7CAuueD5f26ZX55Bx/B9DO52ed4b?= =?utf-8?q?ZUQPUwWbWFcwkTuruZ10b7fBGHNHK9mLbJMnWKN9rr/CyksR+H0eFgb8L0y0dAAQQ?= =?utf-8?q?T3inTKP0uzz/Rnzc7rpB+eS2mrpxW3grgm8Y2J4B5vQ+urex8bD73ADL6ZilPPnxA?= =?utf-8?q?u56knRCCl21qbhpUxGAaYc2jrh1YVrfFM1Ao4UoIR6RK957I+V6NYUDWCmgRjVxN9?= =?utf-8?q?8e1Kw2pki4WFWGdDcZs2tkasNxnS4ulQhqyfdwklKny+Bxw+Bkgu2F/qe8NBC19L4?= =?utf-8?q?20FsiZ3fTR5LX/kJOtr2Jk6uXbnGJcgd/qdZ83BYO+FU0jbvLP9QbUjSdksiqi5Us?= =?utf-8?q?yAytLGlJ/f0/ZfdnVVpriU/vnYeOdCoxudos6sAf6N46HGXuywF7If4UJdQgDFhiS?= =?utf-8?q?qS+QVWLWEs3lSryq9/IqJKC+EPTFAM/bXA3D8E8gCff15R5BOnnNfN8GoQhX3pZxf?= =?utf-8?q?1C0IA8bn0r5Dpq89ynrJofXyckmwE7x4rZppe/GqHJmj5lYlrM2pNoN0XEsM9Igud?= =?utf-8?q?vxDkUw3V7sI?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Sep 2024 12:39:02.8670 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b900af3-ebef-45ef-2ff0-08dccc156455 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=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00029927.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8420 plat_dev is a commonly used variable name, since its made as extern now, change it to more specific name. Also change miscdevice hsmp_device to mdev. Signed-off-by: Suma Hegde Reviewed-by: Naveen Krishna Chatradhi Reviewed-by: Ilpo Järvinen --- Changes since v6: None Changes since v5: None Changes since v4: Add Reviewed-by: Ilpo Järvinen Changes since v3: code indentation is removed in hsmp_parse_acpi_table(). Changes since v2: None Changes since v1: 1. This is a new patch to rename generic name "plat_dev" in hsmp.h, hsmp.c, plat.c and acpi.c to more specific name "hsmp_pdev" 2. Rename miscdevice hsmp_device to mdev. drivers/platform/x86/amd/hsmp/acpi.c | 6 +-- drivers/platform/x86/amd/hsmp/hsmp.c | 60 ++++++++++++++-------------- drivers/platform/x86/amd/hsmp/hsmp.h | 4 +- drivers/platform/x86/amd/hsmp/plat.c | 12 +++--- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/platform/x86/amd/hsmp/acpi.c b/drivers/platform/x86/amd/hsmp/acpi.c index 61c072216fb7..6f8e7962266a 100644 --- a/drivers/platform/x86/amd/hsmp/acpi.c +++ b/drivers/platform/x86/amd/hsmp/acpi.c @@ -194,13 +194,13 @@ static int hsmp_read_acpi_crs(struct hsmp_socket *sock) /* Parse the ACPI table to read the data */ static int hsmp_parse_acpi_table(struct device *dev, u16 sock_ind) { - struct hsmp_socket *sock = &plat_dev.sock[sock_ind]; + struct hsmp_socket *sock = &hsmp_pdev.sock[sock_ind]; int ret; sock->sock_ind = sock_ind; sock->dev = dev; sock->amd_hsmp_rdwr = amd_hsmp_acpi_rdwr; - plat_dev.is_acpi_device = true; + hsmp_pdev.is_acpi_device = true; sema_init(&sock->hsmp_sem, 1); @@ -244,7 +244,7 @@ int init_acpi(struct device *dev) ret = hsmp_get_uid(dev, &sock_ind); if (ret) return ret; - if (sock_ind >= plat_dev.num_sockets) + if (sock_ind >= hsmp_pdev.num_sockets) return -EINVAL; ret = hsmp_parse_acpi_table(dev, sock_ind); diff --git a/drivers/platform/x86/amd/hsmp/hsmp.c b/drivers/platform/x86/amd/hsmp/hsmp.c index 573867c17fd5..78945750d590 100644 --- a/drivers/platform/x86/amd/hsmp/hsmp.c +++ b/drivers/platform/x86/amd/hsmp/hsmp.c @@ -39,7 +39,7 @@ #define HSMP_WR true #define HSMP_RD false -struct hsmp_plat_device plat_dev; +struct hsmp_plat_device hsmp_pdev; /* * Send a message to the HSMP port via PCI-e config space registers @@ -176,9 +176,9 @@ int hsmp_send_message(struct hsmp_message *msg) if (ret) return ret; - if (!plat_dev.sock || msg->sock_ind >= plat_dev.num_sockets) + if (!hsmp_pdev.sock || msg->sock_ind >= hsmp_pdev.num_sockets) return -ENODEV; - sock = &plat_dev.sock[msg->sock_ind]; + sock = &hsmp_pdev.sock[msg->sock_ind]; /* * The time taken by smu operation to complete is between @@ -219,7 +219,7 @@ int hsmp_test(u16 sock_ind, u32 value) /* Check the response value */ if (msg.args[0] != (value + 1)) { - dev_err(plat_dev.sock[sock_ind].dev, + dev_err(hsmp_pdev.sock[sock_ind].dev, "Socket %d test message failed, Expected 0x%08X, received 0x%08X\n", sock_ind, (value + 1), msg.args[0]); return -EBADE; @@ -320,7 +320,7 @@ ssize_t hsmp_metric_tbl_read(struct file *filp, struct kobject *kobj, static int hsmp_get_tbl_dram_base(u16 sock_ind) { - struct hsmp_socket *sock = &plat_dev.sock[sock_ind]; + struct hsmp_socket *sock = &hsmp_pdev.sock[sock_ind]; struct hsmp_message msg = { 0 }; phys_addr_t dram_addr; int ret; @@ -354,7 +354,7 @@ static int hsmp_get_tbl_dram_base(u16 sock_ind) umode_t hsmp_is_sock_attr_visible(struct kobject *kobj, struct bin_attribute *battr, int id) { - if (plat_dev.proto_ver == HSMP_PROTO_VER6) + if (hsmp_pdev.proto_ver == HSMP_PROTO_VER6) return battr->attr.mode; else return 0; @@ -362,17 +362,17 @@ umode_t hsmp_is_sock_attr_visible(struct kobject *kobj, static int hsmp_init_metric_tbl_bin_attr(struct bin_attribute **hattrs, u16 sock_ind) { - struct bin_attribute *hattr = &plat_dev.sock[sock_ind].hsmp_attr; + struct bin_attribute *hattr = &hsmp_pdev.sock[sock_ind].hsmp_attr; sysfs_bin_attr_init(hattr); hattr->attr.name = HSMP_METRICS_TABLE_NAME; hattr->attr.mode = 0444; hattr->read = hsmp_metric_tbl_read; hattr->size = sizeof(struct hsmp_metric_table); - hattr->private = &plat_dev.sock[sock_ind]; + hattr->private = &hsmp_pdev.sock[sock_ind]; hattrs[0] = hattr; - if (plat_dev.proto_ver == HSMP_PROTO_VER6) + if (hsmp_pdev.proto_ver == HSMP_PROTO_VER6) return hsmp_get_tbl_dram_base(sock_ind); else return 0; @@ -409,7 +409,7 @@ int hsmp_cache_proto_ver(u16 sock_ind) ret = hsmp_send_message(&msg); if (!ret) - plat_dev.proto_ver = msg.args[0]; + hsmp_pdev.proto_ver = msg.args[0]; return ret; } @@ -441,11 +441,11 @@ static int hsmp_pltdrv_probe(struct platform_device *pdev) * Hence allocate memory for all the sockets at once instead of allocating * on each probe. */ - if (!plat_dev.is_probed) { - plat_dev.sock = devm_kcalloc(&pdev->dev, plat_dev.num_sockets, - sizeof(*plat_dev.sock), - GFP_KERNEL); - if (!plat_dev.sock) + if (!hsmp_pdev.is_probed) { + hsmp_pdev.sock = devm_kcalloc(&pdev->dev, hsmp_pdev.num_sockets, + sizeof(*hsmp_pdev.sock), + GFP_KERNEL); + if (!hsmp_pdev.sock) return -ENOMEM; } if (check_acpi_support(&pdev->dev)) { @@ -468,19 +468,19 @@ static int hsmp_pltdrv_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Failed to create HSMP sysfs interface\n"); } - if (!plat_dev.is_probed) { - plat_dev.hsmp_device.name = HSMP_CDEV_NAME; - plat_dev.hsmp_device.minor = MISC_DYNAMIC_MINOR; - plat_dev.hsmp_device.fops = &hsmp_fops; - plat_dev.hsmp_device.parent = &pdev->dev; - plat_dev.hsmp_device.nodename = HSMP_DEVNODE_NAME; - plat_dev.hsmp_device.mode = 0644; + if (!hsmp_pdev.is_probed) { + hsmp_pdev.mdev.name = HSMP_CDEV_NAME; + hsmp_pdev.mdev.minor = MISC_DYNAMIC_MINOR; + hsmp_pdev.mdev.fops = &hsmp_fops; + hsmp_pdev.mdev.parent = &pdev->dev; + hsmp_pdev.mdev.nodename = HSMP_DEVNODE_NAME; + hsmp_pdev.mdev.mode = 0644; - ret = misc_register(&plat_dev.hsmp_device); + ret = misc_register(&hsmp_pdev.mdev); if (ret) return ret; - plat_dev.is_probed = true; + hsmp_pdev.is_probed = true; } return 0; @@ -493,9 +493,9 @@ static void hsmp_pltdrv_remove(struct platform_device *pdev) * We register only one misc_device even on multi socket system. * So, deregister should happen only once. */ - if (plat_dev.is_probed) { - misc_deregister(&plat_dev.hsmp_device); - plat_dev.is_probed = false; + if (hsmp_pdev.is_probed) { + misc_deregister(&hsmp_pdev.mdev); + hsmp_pdev.is_probed = false; } } @@ -567,15 +567,15 @@ static int __init hsmp_plt_init(void) * amd_nb_num() returns number of SMN/DF interfaces present in the system * if we have N SMN/DF interfaces that ideally means N sockets */ - plat_dev.num_sockets = amd_nb_num(); - if (plat_dev.num_sockets == 0 || plat_dev.num_sockets > MAX_AMD_SOCKETS) + hsmp_pdev.num_sockets = amd_nb_num(); + if (hsmp_pdev.num_sockets == 0 || hsmp_pdev.num_sockets > MAX_AMD_SOCKETS) return ret; ret = platform_driver_register(&amd_hsmp_driver); if (ret) return ret; - if (!plat_dev.is_acpi_device) { + if (!hsmp_pdev.is_acpi_device) { if (legacy_hsmp_support()) { /* Not ACPI device, but supports HSMP, register a plat_dev */ ret = hsmp_plat_dev_register(); diff --git a/drivers/platform/x86/amd/hsmp/hsmp.h b/drivers/platform/x86/amd/hsmp/hsmp.h index f465600cb843..9c5b9c263fc1 100644 --- a/drivers/platform/x86/amd/hsmp/hsmp.h +++ b/drivers/platform/x86/amd/hsmp/hsmp.h @@ -48,7 +48,7 @@ struct hsmp_socket { }; struct hsmp_plat_device { - struct miscdevice hsmp_device; + struct miscdevice mdev; struct hsmp_socket *sock; u32 proto_ver; u16 num_sockets; @@ -56,7 +56,7 @@ struct hsmp_plat_device { bool is_probed; }; -extern struct hsmp_plat_device plat_dev; +extern struct hsmp_plat_device hsmp_pdev; ssize_t hsmp_metric_tbl_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, diff --git a/drivers/platform/x86/amd/hsmp/plat.c b/drivers/platform/x86/amd/hsmp/plat.c index 85a104859acd..e18cf82478a0 100644 --- a/drivers/platform/x86/amd/hsmp/plat.c +++ b/drivers/platform/x86/amd/hsmp/plat.c @@ -56,21 +56,21 @@ int hsmp_create_non_acpi_sysfs_if(struct device *dev) struct attribute_group *attr_grp; u16 i; - hsmp_attr_grps = devm_kcalloc(dev, plat_dev.num_sockets + 1, + hsmp_attr_grps = devm_kcalloc(dev, hsmp_pdev.num_sockets + 1, sizeof(*hsmp_attr_grps), GFP_KERNEL); if (!hsmp_attr_grps) return -ENOMEM; /* Create a sysfs directory for each socket */ - for (i = 0; i < plat_dev.num_sockets; i++) { + for (i = 0; i < hsmp_pdev.num_sockets; i++) { attr_grp = devm_kzalloc(dev, sizeof(struct attribute_group), GFP_KERNEL); if (!attr_grp) return -ENOMEM; - snprintf(plat_dev.sock[i].name, HSMP_ATTR_GRP_NAME_SIZE, "socket%u", (u8)i); - attr_grp->name = plat_dev.sock[i].name; + snprintf(hsmp_pdev.sock[i].name, HSMP_ATTR_GRP_NAME_SIZE, "socket%u", (u8)i); + attr_grp->name = hsmp_pdev.sock[i].name; attr_grp->is_bin_visible = hsmp_is_sock_attr_visible; hsmp_attr_grps[i] = attr_grp; @@ -93,10 +93,10 @@ int init_platform_device(struct device *dev) struct hsmp_socket *sock; int ret, i; - for (i = 0; i < plat_dev.num_sockets; i++) { + for (i = 0; i < hsmp_pdev.num_sockets; i++) { if (!node_to_amd_nb(i)) return -ENODEV; - sock = &plat_dev.sock[i]; + sock = &hsmp_pdev.sock[i]; sock->root = node_to_amd_nb(i)->root; sock->sock_ind = i; sock->dev = dev;