Skip to content

Commit 9ddb9dc

Browse files
garyrhookherbertx
authored andcommitted
crypto: ccp - clean up data structure
Change names of data structure instances. Add const keyword where appropriate. Add error handling path. Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 8df4f27 commit 9ddb9dc

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎drivers/crypto/ccp/ccp-dev-v3.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ static const struct ccp_actions ccp3_actions = {
566566
.irqhandler = ccp_irq_handler,
567567
};
568568

569-
struct ccp_vdata ccpv3 = {
569+
const struct ccp_vdata ccpv3 = {
570570
.version = CCP_VERSION(3, 0),
571571
.setup = NULL,
572572
.perform = &ccp3_actions,

‎drivers/crypto/ccp/ccp-dev-v5.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,13 @@ static int ccp5_init(struct ccp_device *ccp)
835835
/* Register the DMA engine support */
836836
ret = ccp_dmaengine_register(ccp);
837837
if (ret)
838-
goto e_kthread;
838+
goto e_hwrng;
839839

840840
return 0;
841841

842+
e_hwrng:
843+
ccp_unregister_rng(ccp);
844+
842845
e_kthread:
843846
for (i = 0; i < ccp->cmd_q_count; i++)
844847
if (ccp->cmd_q[i].kthread)
@@ -994,15 +997,15 @@ static const struct ccp_actions ccp5_actions = {
994997
.irqhandler = ccp5_irq_handler,
995998
};
996999

997-
struct ccp_vdata ccpv5 = {
1000+
const struct ccp_vdata ccpv5a = {
9981001
.version = CCP_VERSION(5, 0),
9991002
.setup = ccp5_config,
10001003
.perform = &ccp5_actions,
10011004
.bar = 2,
10021005
.offset = 0x0,
10031006
};
10041007

1005-
struct ccp_vdata ccpv5other = {
1008+
const struct ccp_vdata ccpv5b = {
10061009
.version = CCP_VERSION(5, 0),
10071010
.setup = ccp5other_config,
10081011
.perform = &ccp5_actions,

‎drivers/crypto/ccp/ccp-dev.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,8 @@ struct ccp_vdata {
639639
const unsigned int offset;
640640
};
641641

642-
extern struct ccp_vdata ccpv3;
643-
extern struct ccp_vdata ccpv5;
644-
extern struct ccp_vdata ccpv5other;
642+
extern const struct ccp_vdata ccpv3;
643+
extern const struct ccp_vdata ccpv5a;
644+
extern const struct ccp_vdata ccpv5b;
645645

646646
#endif

‎drivers/crypto/ccp/ccp-pci.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,8 @@ static int ccp_pci_resume(struct pci_dev *pdev)
325325

326326
static const struct pci_device_id ccp_pci_table[] = {
327327
{ PCI_VDEVICE(AMD, 0x1537), (kernel_ulong_t)&ccpv3 },
328-
{ PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&ccpv5 },
329-
{ PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&ccpv5other },
328+
{ PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&ccpv5a },
329+
{ PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&ccpv5b },
330330
/* Last entry must be zero */
331331
{ 0, }
332332
};

0 commit comments

Comments
 (0)