Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccp - Remove check for x86 family and model

Each x86 SoC will make use of a unique PCI ID for the CCP
device so it is not necessary to check for the CPU family
and model.

Signed-off-by: Gary R Hook <gary.hook@amd.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Gary R Hook and committed by
Herbert Xu
3f19ce20 ce0ae266

+11 -36
+11 -36
drivers/crypto/ccp/ccp-dev.c
··· 1 1 /* 2 2 * AMD Cryptographic Coprocessor (CCP) driver 3 3 * 4 - * Copyright (C) 2013 Advanced Micro Devices, Inc. 4 + * Copyright (C) 2013,2016 Advanced Micro Devices, Inc. 5 5 * 6 6 * Author: Tom Lendacky <thomas.lendacky@amd.com> 7 7 * ··· 577 577 } 578 578 #endif 579 579 580 - #ifdef CONFIG_X86 581 - static const struct x86_cpu_id ccp_support[] = { 582 - { X86_VENDOR_AMD, 22, }, 583 - { }, 584 - }; 585 - #endif 586 - 587 580 static int __init ccp_mod_init(void) 588 581 { 589 582 #ifdef CONFIG_X86 590 - struct cpuinfo_x86 *cpuinfo = &boot_cpu_data; 591 583 int ret; 592 584 593 - if (!x86_match_cpu(ccp_support)) 585 + ret = ccp_pci_init(); 586 + if (ret) 587 + return ret; 588 + 589 + /* Don't leave the driver loaded if init failed */ 590 + if (!ccp_get_device()) { 591 + ccp_pci_exit(); 594 592 return -ENODEV; 595 - 596 - switch (cpuinfo->x86) { 597 - case 22: 598 - if ((cpuinfo->x86_model < 48) || (cpuinfo->x86_model > 63)) 599 - return -ENODEV; 600 - 601 - ret = ccp_pci_init(); 602 - if (ret) 603 - return ret; 604 - 605 - /* Don't leave the driver loaded if init failed */ 606 - if (!ccp_get_device()) { 607 - ccp_pci_exit(); 608 - return -ENODEV; 609 - } 610 - 611 - return 0; 612 - 613 - break; 614 593 } 594 + 595 + return 0; 615 596 #endif 616 597 617 598 #ifdef CONFIG_ARM64 ··· 617 636 static void __exit ccp_mod_exit(void) 618 637 { 619 638 #ifdef CONFIG_X86 620 - struct cpuinfo_x86 *cpuinfo = &boot_cpu_data; 621 - 622 - switch (cpuinfo->x86) { 623 - case 22: 624 - ccp_pci_exit(); 625 - break; 626 - } 639 + ccp_pci_exit(); 627 640 #endif 628 641 629 642 #ifdef CONFIG_ARM64