Skip to content

Commit

Permalink
crypto: ccp - clean up data structure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gary R Hook authored and Herbert Xu committed Oct 2, 2016
1 parent 8df4f27 commit 9ddb9dc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drivers/crypto/ccp/ccp-dev-v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ static const struct ccp_actions ccp3_actions = {
.irqhandler = ccp_irq_handler,
};

struct ccp_vdata ccpv3 = {
const struct ccp_vdata ccpv3 = {
.version = CCP_VERSION(3, 0),
.setup = NULL,
.perform = &ccp3_actions,
Expand Down
9 changes: 6 additions & 3 deletions drivers/crypto/ccp/ccp-dev-v5.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,10 +835,13 @@ static int ccp5_init(struct ccp_device *ccp)
/* Register the DMA engine support */
ret = ccp_dmaengine_register(ccp);
if (ret)
goto e_kthread;
goto e_hwrng;

return 0;

e_hwrng:
ccp_unregister_rng(ccp);

e_kthread:
for (i = 0; i < ccp->cmd_q_count; i++)
if (ccp->cmd_q[i].kthread)
Expand Down Expand Up @@ -994,15 +997,15 @@ static const struct ccp_actions ccp5_actions = {
.irqhandler = ccp5_irq_handler,
};

struct ccp_vdata ccpv5 = {
const struct ccp_vdata ccpv5a = {
.version = CCP_VERSION(5, 0),
.setup = ccp5_config,
.perform = &ccp5_actions,
.bar = 2,
.offset = 0x0,
};

struct ccp_vdata ccpv5other = {
const struct ccp_vdata ccpv5b = {
.version = CCP_VERSION(5, 0),
.setup = ccp5other_config,
.perform = &ccp5_actions,
Expand Down
6 changes: 3 additions & 3 deletions drivers/crypto/ccp/ccp-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,8 @@ struct ccp_vdata {
const unsigned int offset;
};

extern struct ccp_vdata ccpv3;
extern struct ccp_vdata ccpv5;
extern struct ccp_vdata ccpv5other;
extern const struct ccp_vdata ccpv3;
extern const struct ccp_vdata ccpv5a;
extern const struct ccp_vdata ccpv5b;

#endif
4 changes: 2 additions & 2 deletions drivers/crypto/ccp/ccp-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ static int ccp_pci_resume(struct pci_dev *pdev)

static const struct pci_device_id ccp_pci_table[] = {
{ PCI_VDEVICE(AMD, 0x1537), (kernel_ulong_t)&ccpv3 },
{ PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&ccpv5 },
{ PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&ccpv5other },
{ PCI_VDEVICE(AMD, 0x1456), (kernel_ulong_t)&ccpv5a },
{ PCI_VDEVICE(AMD, 0x1468), (kernel_ulong_t)&ccpv5b },
/* Last entry must be zero */
{ 0, }
};
Expand Down

0 comments on commit 9ddb9dc

Please sign in to comment.