Commit 7358733a authored by Gilad Ben-Yossef's avatar Gilad Ben-Yossef Committed by Greg Kroah-Hartman

staging: ccree: fix sram mgr naming convention

The SRAM manager files were using a naming convention which was
inconsistent (ssi vs. cc) and often too long.

Make the code more readable by switching to a simpler, consistent naming
convention.
Signed-off-by: default avatarGilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 84d39a90
...@@ -312,9 +312,9 @@ static int init_cc_resources(struct platform_device *plat_dev) ...@@ -312,9 +312,9 @@ static int init_cc_resources(struct platform_device *plat_dev)
dev_err(dev, "CC_FIPS_INIT failed 0x%x\n", rc); dev_err(dev, "CC_FIPS_INIT failed 0x%x\n", rc);
goto post_sysfs_err; goto post_sysfs_err;
} }
rc = ssi_sram_mgr_init(new_drvdata); rc = cc_sram_mgr_init(new_drvdata);
if (rc) { if (rc) {
dev_err(dev, "ssi_sram_mgr_init failed\n"); dev_err(dev, "cc_sram_mgr_init failed\n");
goto post_fips_init_err; goto post_fips_init_err;
} }
...@@ -391,7 +391,7 @@ static int init_cc_resources(struct platform_device *plat_dev) ...@@ -391,7 +391,7 @@ static int init_cc_resources(struct platform_device *plat_dev)
post_req_mgr_err: post_req_mgr_err:
cc_req_mgr_fini(new_drvdata); cc_req_mgr_fini(new_drvdata);
post_sram_mgr_err: post_sram_mgr_err:
ssi_sram_mgr_fini(new_drvdata); cc_sram_mgr_fini(new_drvdata);
post_fips_init_err: post_fips_init_err:
ssi_fips_fini(new_drvdata); ssi_fips_fini(new_drvdata);
post_sysfs_err: post_sysfs_err:
...@@ -423,7 +423,7 @@ static void cleanup_cc_resources(struct platform_device *plat_dev) ...@@ -423,7 +423,7 @@ static void cleanup_cc_resources(struct platform_device *plat_dev)
cc_pm_fini(drvdata); cc_pm_fini(drvdata);
cc_buffer_mgr_fini(drvdata); cc_buffer_mgr_fini(drvdata);
cc_req_mgr_fini(drvdata); cc_req_mgr_fini(drvdata);
ssi_sram_mgr_fini(drvdata); cc_sram_mgr_fini(drvdata);
ssi_fips_fini(drvdata); ssi_fips_fini(drvdata);
#ifdef ENABLE_CC_SYSFS #ifdef ENABLE_CC_SYSFS
ssi_sysfs_fini(); ssi_sysfs_fini();
......
...@@ -18,37 +18,37 @@ ...@@ -18,37 +18,37 @@
#include "ssi_sram_mgr.h" #include "ssi_sram_mgr.h"
/** /**
* struct ssi_sram_mgr_ctx -Internal RAM context manager * struct cc_sram_ctx -Internal RAM context manager
* @sram_free_offset: the offset to the non-allocated area * @sram_free_offset: the offset to the non-allocated area
*/ */
struct ssi_sram_mgr_ctx { struct cc_sram_ctx {
cc_sram_addr_t sram_free_offset; cc_sram_addr_t sram_free_offset;
}; };
/** /**
* ssi_sram_mgr_fini() - Cleanup SRAM pool. * cc_sram_mgr_fini() - Cleanup SRAM pool.
* *
* @drvdata: Associated device driver context * @drvdata: Associated device driver context
*/ */
void ssi_sram_mgr_fini(struct cc_drvdata *drvdata) void cc_sram_mgr_fini(struct cc_drvdata *drvdata)
{ {
struct ssi_sram_mgr_ctx *smgr_ctx = drvdata->sram_mgr_handle; struct cc_sram_ctx *smgr_ctx = drvdata->sram_mgr_handle;
/* Free "this" context */ /* Free "this" context */
if (smgr_ctx) { if (smgr_ctx) {
memset(smgr_ctx, 0, sizeof(struct ssi_sram_mgr_ctx)); memset(smgr_ctx, 0, sizeof(struct cc_sram_ctx));
kfree(smgr_ctx); kfree(smgr_ctx);
} }
} }
/** /**
* ssi_sram_mgr_init() - Initializes SRAM pool. * cc_sram_mgr_init() - Initializes SRAM pool.
* The pool starts right at the beginning of SRAM. * The pool starts right at the beginning of SRAM.
* Returns zero for success, negative value otherwise. * Returns zero for success, negative value otherwise.
* *
* @drvdata: Associated device driver context * @drvdata: Associated device driver context
*/ */
int ssi_sram_mgr_init(struct cc_drvdata *drvdata) int cc_sram_mgr_init(struct cc_drvdata *drvdata)
{ {
/* Allocate "this" context */ /* Allocate "this" context */
drvdata->sram_mgr_handle = kzalloc(sizeof(*drvdata->sram_mgr_handle), drvdata->sram_mgr_handle = kzalloc(sizeof(*drvdata->sram_mgr_handle),
...@@ -71,7 +71,7 @@ int ssi_sram_mgr_init(struct cc_drvdata *drvdata) ...@@ -71,7 +71,7 @@ int ssi_sram_mgr_init(struct cc_drvdata *drvdata)
*/ */
cc_sram_addr_t cc_sram_alloc(struct cc_drvdata *drvdata, u32 size) cc_sram_addr_t cc_sram_alloc(struct cc_drvdata *drvdata, u32 size)
{ {
struct ssi_sram_mgr_ctx *smgr_ctx = drvdata->sram_mgr_handle; struct cc_sram_ctx *smgr_ctx = drvdata->sram_mgr_handle;
struct device *dev = drvdata_to_dev(drvdata); struct device *dev = drvdata_to_dev(drvdata);
cc_sram_addr_t p; cc_sram_addr_t p;
......
...@@ -40,14 +40,14 @@ typedef u64 cc_sram_addr_t; ...@@ -40,14 +40,14 @@ typedef u64 cc_sram_addr_t;
* *
* \return int Zero for success, negative value otherwise. * \return int Zero for success, negative value otherwise.
*/ */
int ssi_sram_mgr_init(struct cc_drvdata *drvdata); int cc_sram_mgr_init(struct cc_drvdata *drvdata);
/*! /*!
* Uninits SRAM pool. * Uninits SRAM pool.
* *
* \param drvdata * \param drvdata
*/ */
void ssi_sram_mgr_fini(struct cc_drvdata *drvdata); void cc_sram_mgr_fini(struct cc_drvdata *drvdata);
/*! /*!
* Allocated buffer from SRAM pool. * Allocated buffer from SRAM pool.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment