diff options
author | Gary R Hook <gary.hook@amd.com> | 2016-03-01 14:48:54 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-03-11 08:19:06 -0500 |
commit | 3f19ce2054541a6c663c8a5fcf52e7baa1c6c5f5 (patch) | |
tree | 8054e5de4041b92206dc77b064d374182a501ea8 | |
parent | ce0ae266feaf35930394bd770c69778e4ef03ba9 (diff) |
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>
-rw-r--r-- | drivers/crypto/ccp/ccp-dev.c | 47 |
1 files changed, 11 insertions, 36 deletions
diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c index 861bacc1bb94..725c59016a36 100644 --- a/drivers/crypto/ccp/ccp-dev.c +++ b/drivers/crypto/ccp/ccp-dev.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * AMD Cryptographic Coprocessor (CCP) driver | 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 | * Author: Tom Lendacky <thomas.lendacky@amd.com> | 6 | * Author: Tom Lendacky <thomas.lendacky@amd.com> |
7 | * | 7 | * |
@@ -577,41 +577,22 @@ bool ccp_queues_suspended(struct ccp_device *ccp) | |||
577 | } | 577 | } |
578 | #endif | 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 | static int __init ccp_mod_init(void) | 580 | static int __init ccp_mod_init(void) |
588 | { | 581 | { |
589 | #ifdef CONFIG_X86 | 582 | #ifdef CONFIG_X86 |
590 | struct cpuinfo_x86 *cpuinfo = &boot_cpu_data; | ||
591 | int ret; | 583 | int ret; |
592 | 584 | ||
593 | if (!x86_match_cpu(ccp_support)) | 585 | ret = ccp_pci_init(); |
594 | return -ENODEV; | 586 | if (ret) |
595 | 587 | return ret; | |
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 | 588 | ||
613 | break; | 589 | /* Don't leave the driver loaded if init failed */ |
590 | if (!ccp_get_device()) { | ||
591 | ccp_pci_exit(); | ||
592 | return -ENODEV; | ||
614 | } | 593 | } |
594 | |||
595 | return 0; | ||
615 | #endif | 596 | #endif |
616 | 597 | ||
617 | #ifdef CONFIG_ARM64 | 598 | #ifdef CONFIG_ARM64 |
@@ -636,13 +617,7 @@ static int __init ccp_mod_init(void) | |||
636 | static void __exit ccp_mod_exit(void) | 617 | static void __exit ccp_mod_exit(void) |
637 | { | 618 | { |
638 | #ifdef CONFIG_X86 | 619 | #ifdef CONFIG_X86 |
639 | struct cpuinfo_x86 *cpuinfo = &boot_cpu_data; | 620 | ccp_pci_exit(); |
640 | |||
641 | switch (cpuinfo->x86) { | ||
642 | case 22: | ||
643 | ccp_pci_exit(); | ||
644 | break; | ||
645 | } | ||
646 | #endif | 621 | #endif |
647 | 622 | ||
648 | #ifdef CONFIG_ARM64 | 623 | #ifdef CONFIG_ARM64 |