diff options
author | Julius Werner <jwerner@chromium.org> | 2022-03-04 17:49:56 -0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2022-03-09 02:18:21 +0000 |
commit | 69cc557cfb6eb2cbb5b137bc206cd759c1dba5f0 (patch) | |
tree | ab51422700fa7f5257fb72cc72bf8330780f8e06 /src | |
parent | 270b0b60acba4802b8a9272d2727ee576733ad47 (diff) |
commonlib/bsd: Remove cb_err_t
cb_err_t was meant to be used in place of `enum cb_err` in all
situations, but the choice to use a typedef here seems to be
controversial. We should not be arbitrarily using two different
identifiers for the same thing across the codebase, so since there are
no use cases for serializing enum cb_err at the moment (which would be
the primary reason to typedef a fixed-width integer instead), remove
cb_err_t again for now.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Iaec36210d129db26d51f0a105d3de070c03b686b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62600
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/commonlib/bsd/cbfs_mcache.c | 14 | ||||
-rw-r--r-- | src/commonlib/bsd/cbfs_private.c | 28 | ||||
-rw-r--r-- | src/commonlib/bsd/include/commonlib/bsd/cb_err.h | 3 | ||||
-rw-r--r-- | src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h | 24 | ||||
-rw-r--r-- | src/drivers/mipi/panel.c | 4 | ||||
-rw-r--r-- | src/drivers/parade/ps8640/ps8640.c | 12 | ||||
-rw-r--r-- | src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c | 16 | ||||
-rw-r--r-- | src/include/cbfs.h | 10 | ||||
-rw-r--r-- | src/include/mipi/panel.h | 4 | ||||
-rw-r--r-- | src/lib/cbfs.c | 18 | ||||
-rw-r--r-- | src/security/vboot/vboot_loader.c | 2 | ||||
-rw-r--r-- | src/soc/mediatek/common/dsi.c | 2 | ||||
-rw-r--r-- | src/soc/qualcomm/sc7180/display/dsi.c | 9 | ||||
-rw-r--r-- | src/soc/qualcomm/sc7180/include/soc/display/mipi_dsi.h | 2 |
14 files changed, 73 insertions, 75 deletions
diff --git a/src/commonlib/bsd/cbfs_mcache.c b/src/commonlib/bsd/cbfs_mcache.c index 965f9faef6..29ba110d7c 100644 --- a/src/commonlib/bsd/cbfs_mcache.c +++ b/src/commonlib/bsd/cbfs_mcache.c @@ -40,8 +40,8 @@ struct cbfs_mcache_build_args { int count; }; -static cb_err_t build_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, - size_t already_read, void *arg) +static enum cb_err build_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, + size_t already_read, void *arg) { struct cbfs_mcache_build_args *args = arg; union mcache_entry *entry = args->mcache; @@ -62,8 +62,8 @@ static cb_err_t build_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mda return CB_CBFS_NOT_FOUND; } -cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, - struct vb2_hash *metadata_hash) +enum cb_err cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, + struct vb2_hash *metadata_hash) { struct cbfs_mcache_build_args args = { .mcache = mcache, @@ -73,7 +73,7 @@ cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, }; assert(size > sizeof(uint32_t) && IS_ALIGNED((uintptr_t)mcache, CBFS_MCACHE_ALIGNMENT)); - cb_err_t ret = cbfs_walk(dev, build_walker, &args, metadata_hash, 0); + enum cb_err ret = cbfs_walk(dev, build_walker, &args, metadata_hash, 0); union mcache_entry *entry = args.mcache; if (ret == CB_CBFS_NOT_FOUND) { ret = CB_SUCCESS; @@ -88,8 +88,8 @@ cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t size, return ret; } -cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, - union cbfs_mdata *mdata_out, size_t *data_offset_out) +enum cb_err cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, + union cbfs_mdata *mdata_out, size_t *data_offset_out) { const size_t namesize = strlen(name) + 1; /* Count trailing \0 so we can memcmp() it. */ const void *end = mcache + mcache_size; diff --git a/src/commonlib/bsd/cbfs_private.c b/src/commonlib/bsd/cbfs_private.c index a8c2a3a61f..e77c299e7b 100644 --- a/src/commonlib/bsd/cbfs_private.c +++ b/src/commonlib/bsd/cbfs_private.c @@ -3,8 +3,8 @@ #include <commonlib/bsd/cbfs_private.h> #include <assert.h> -static cb_err_t read_next_header(cbfs_dev_t dev, size_t *offset, struct cbfs_file *buffer, - const size_t devsize) +static enum cb_err read_next_header(cbfs_dev_t dev, size_t *offset, struct cbfs_file *buffer, + const size_t devsize) { DEBUG("Looking for next file @%#zx...\n", *offset); *offset = ALIGN_UP(*offset, CBFS_ALIGNMENT); @@ -22,10 +22,10 @@ static cb_err_t read_next_header(cbfs_dev_t dev, size_t *offset, struct cbfs_fil return CB_CBFS_NOT_FOUND; } -cb_err_t cbfs_walk(cbfs_dev_t dev, cb_err_t (*walker)(cbfs_dev_t dev, size_t offset, - const union cbfs_mdata *mdata, - size_t already_read, void *arg), - void *arg, struct vb2_hash *metadata_hash, enum cbfs_walk_flags flags) +enum cb_err cbfs_walk(cbfs_dev_t dev, enum cb_err (*walker)(cbfs_dev_t dev, size_t offset, + const union cbfs_mdata *mdata, + size_t already_read, void *arg), + void *arg, struct vb2_hash *metadata_hash, enum cbfs_walk_flags flags) { const bool do_hash = CBFS_ENABLE_HASHING && metadata_hash; const size_t devsize = cbfs_dev_size(dev); @@ -39,8 +39,8 @@ cb_err_t cbfs_walk(cbfs_dev_t dev, cb_err_t (*walker)(cbfs_dev_t dev, size_t off } size_t offset = 0; - cb_err_t ret_header; - cb_err_t ret_walker = CB_CBFS_NOT_FOUND; + enum cb_err ret_header; + enum cb_err ret_walker = CB_CBFS_NOT_FOUND; union cbfs_mdata mdata; while ((ret_header = read_next_header(dev, &offset, &mdata.h, devsize)) == CB_SUCCESS) { const uint32_t attr_offset = be32toh(mdata.h.attributes_offset); @@ -113,8 +113,8 @@ next_file: return ret_walker; } -cb_err_t cbfs_copy_fill_metadata(union cbfs_mdata *dst, const union cbfs_mdata *src, - size_t already_read, cbfs_dev_t dev, size_t offset) +enum cb_err cbfs_copy_fill_metadata(union cbfs_mdata *dst, const union cbfs_mdata *src, + size_t already_read, cbfs_dev_t dev, size_t offset) { /* First, copy the stuff that cbfs_walk() already read for us. */ memcpy(dst, src, already_read); @@ -135,8 +135,8 @@ struct cbfs_lookup_args { size_t *data_offset_out; }; -static cb_err_t lookup_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, - size_t already_read, void *arg) +static enum cb_err lookup_walker(cbfs_dev_t dev, size_t offset, const union cbfs_mdata *mdata, + size_t already_read, void *arg) { struct cbfs_lookup_args *args = arg; /* Check if the name we're looking for could fit, then we can safely memcmp() it. */ @@ -152,8 +152,8 @@ static cb_err_t lookup_walker(cbfs_dev_t dev, size_t offset, const union cbfs_md return CB_SUCCESS; } -cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out, - size_t *data_offset_out, struct vb2_hash *metadata_hash) +enum cb_err cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out, + size_t *data_offset_out, struct vb2_hash *metadata_hash) { struct cbfs_lookup_args args = { .mdata_out = mdata_out, diff --git a/src/commonlib/bsd/include/commonlib/bsd/cb_err.h b/src/commonlib/bsd/include/commonlib/bsd/cb_err.h index b61b956524..eec44f2f1c 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/cb_err.h +++ b/src/commonlib/bsd/include/commonlib/bsd/cb_err.h @@ -42,7 +42,4 @@ enum cb_err { CB_CBFS_CACHE_FULL = -403, /**< Metadata cache overflowed */ }; -/* Don't typedef the enum directly, so the size is unambiguous for serialization. */ -typedef int32_t cb_err_t; - #endif /* _COMMONLIB_BSD_CB_ERR_H_ */ diff --git a/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h b/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h index fc2d0d0457..410bfd62ba 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h +++ b/src/commonlib/bsd/include/commonlib/bsd/cbfs_private.h @@ -78,24 +78,24 @@ enum cbfs_walk_flags { * CB_SUCCESS/<other> - First non-CB_CBFS_NOT_FOUND code returned by walker() * CB_CBFS_NOT_FOUND - walker() returned CB_CBFS_NOT_FOUND for every file in the CBFS */ -cb_err_t cbfs_walk(cbfs_dev_t dev, cb_err_t (*walker)(cbfs_dev_t dev, size_t offset, - const union cbfs_mdata *mdata, - size_t already_read, void *arg), - void *arg, struct vb2_hash *metadata_hash, enum cbfs_walk_flags); +enum cb_err cbfs_walk(cbfs_dev_t dev, enum cb_err (*walker)(cbfs_dev_t dev, size_t offset, + const union cbfs_mdata *mdata, + size_t already_read, void *arg), + void *arg, struct vb2_hash *metadata_hash, enum cbfs_walk_flags); /* * Helper function that can be used by a |walker| callback to cbfs_walk() to copy the metadata * of a file into a permanent buffer. Will copy the |already_read| metadata from |src| into * |dst| and load remaining metadata from |dev| as required. */ -cb_err_t cbfs_copy_fill_metadata(union cbfs_mdata *dst, const union cbfs_mdata *src, - size_t already_read, cbfs_dev_t dev, size_t offset); +enum cb_err cbfs_copy_fill_metadata(union cbfs_mdata *dst, const union cbfs_mdata *src, + size_t already_read, cbfs_dev_t dev, size_t offset); /* Find a file named |name| in the CBFS on |dev|. Copy its metadata (including attributes) * into |mdata_out| and pass out the offset to the file data on the CBFS device. * Verify the metadata with |metadata_hash| if provided. */ -cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out, - size_t *data_offset_out, struct vb2_hash *metadata_hash); +enum cb_err cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_out, + size_t *data_offset_out, struct vb2_hash *metadata_hash); /* Both base address and size of CBFS mcaches must be aligned to this value! */ #define CBFS_MCACHE_ALIGNMENT sizeof(uint32_t) /* Largest data type used in CBFS */ @@ -105,15 +105,15 @@ cb_err_t cbfs_lookup(cbfs_dev_t dev, const char *name, union cbfs_mdata *mdata_o * CB_CBFS_CACHE_FULL, the mcache is still valid and can be used, but lookups may return * CB_CBFS_CACHE_FULL for files that didn't fit to indicate that the caller needs to fall back * to cbfs_lookup(). */ -cb_err_t cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t mcache_size, - struct vb2_hash *metadata_hash); +enum cb_err cbfs_mcache_build(cbfs_dev_t dev, void *mcache, size_t mcache_size, + struct vb2_hash *metadata_hash); /* * Find a file named |name| in a CBFS metadata cache and copy its metadata into |mdata_out|. * Pass out offset to the file data (on the original CBFS device used for cbfs_mcache_build()). */ -cb_err_t cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, - union cbfs_mdata *mdata_out, size_t *data_offset_out); +enum cb_err cbfs_mcache_lookup(const void *mcache, size_t mcache_size, const char *name, + union cbfs_mdata *mdata_out, size_t *data_offset_out); /* Returns the amount of bytes actually used by the CBFS metadata cache in |mcache|. */ size_t cbfs_mcache_real_size(const void *mcache, size_t mcache_size); diff --git a/src/drivers/mipi/panel.c b/src/drivers/mipi/panel.c index f1d87c32d1..9646ecaa86 100644 --- a/src/drivers/mipi/panel.c +++ b/src/drivers/mipi/panel.c @@ -4,7 +4,7 @@ #include <delay.h> #include <mipi/panel.h> -cb_err_t mipi_panel_parse_init_commands(const void *buf, mipi_cmd_func_t cmd_func) +enum cb_err mipi_panel_parse_init_commands(const void *buf, mipi_cmd_func_t cmd_func) { const struct panel_init_command *init = buf; enum mipi_dsi_transaction type; @@ -68,7 +68,7 @@ cb_err_t mipi_panel_parse_init_commands(const void *buf, mipi_cmd_func_t cmd_fun return CB_ERR; } - cb_err_t ret = cmd_func(type, init->data, len); + enum cb_err ret = cmd_func(type, init->data, len); if (ret != CB_SUCCESS) return ret; buf += len; diff --git a/src/drivers/parade/ps8640/ps8640.c b/src/drivers/parade/ps8640/ps8640.c index 587eae1d9c..ebb2f4805b 100644 --- a/src/drivers/parade/ps8640/ps8640.c +++ b/src/drivers/parade/ps8640/ps8640.c @@ -81,12 +81,12 @@ int ps8640_init(uint8_t bus, uint8_t chip) return 0; } -static cb_err_t ps8640_bridge_aux_request(uint8_t bus, - uint8_t chip, - unsigned int target_reg, - unsigned int total_size, - enum aux_request request, - uint8_t *data) +static enum cb_err ps8640_bridge_aux_request(uint8_t bus, + uint8_t chip, + unsigned int target_reg, + unsigned int total_size, + enum aux_request request, + uint8_t *data) { int i; uint32_t length; diff --git a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c index 2130e33ccf..c9f4ba5a81 100644 --- a/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c +++ b/src/drivers/ti/sn65dsi86bridge/sn65dsi86bridge.c @@ -155,12 +155,12 @@ static const unsigned int sn65dsi86_bridge_dp_rate_lut[] = { 0, 1620, 2160, 2430, 2700, 3240, 4320, 5400 }; -static cb_err_t sn65dsi86_bridge_aux_request(uint8_t bus, - uint8_t chip, - unsigned int target_reg, - unsigned int total_size, - enum aux_request request, - uint8_t *data) +static enum cb_err sn65dsi86_bridge_aux_request(uint8_t bus, + uint8_t chip, + unsigned int target_reg, + unsigned int total_size, + enum aux_request request, + uint8_t *data) { int i; uint32_t length; @@ -217,9 +217,9 @@ static cb_err_t sn65dsi86_bridge_aux_request(uint8_t bus, return CB_SUCCESS; } -cb_err_t sn65dsi86_bridge_read_edid(uint8_t bus, uint8_t chip, struct edid *out) +enum cb_err sn65dsi86_bridge_read_edid(uint8_t bus, uint8_t chip, struct edid *out) { - cb_err_t err; + enum cb_err err; u8 edid[EDID_LENGTH * 2]; int edid_size = EDID_LENGTH; diff --git a/src/include/cbfs.h b/src/include/cbfs.h index 5731d6efd8..f0ae7a80ef 100644 --- a/src/include/cbfs.h +++ b/src/include/cbfs.h @@ -132,7 +132,7 @@ void cbfs_preload(const char *name); void cbfs_unmap(void *mapping); /* Load stage into memory filling in prog. Return 0 on success. < 0 on error. */ -int cbfs_prog_stage_load(struct prog *prog); +enum cb_err cbfs_prog_stage_load(struct prog *prog); /* Returns the size of a CBFS file, or 0 on error. Avoid using this function to allocate space, and instead use cbfs_alloc() so the file only needs to be looked up once. */ @@ -185,15 +185,15 @@ const struct cbfs_boot_device *cbfs_get_boot_device(bool force_ro); * hash was still verified. Should be called once per *boot* (not once per stage) before the * first CBFS access. */ -cb_err_t cbfs_init_boot_device(const struct cbfs_boot_device *cbd, - struct vb2_hash *metadata_hash); +enum cb_err cbfs_init_boot_device(const struct cbfs_boot_device *cbd, + struct vb2_hash *metadata_hash); /********************************************************************************************** * INTERNAL HELPERS FOR INLINES, DO NOT USE. * **********************************************************************************************/ -cb_err_t _cbfs_boot_lookup(const char *name, bool force_ro, - union cbfs_mdata *mdata, struct region_device *rdev); +enum cb_err _cbfs_boot_lookup(const char *name, bool force_ro, + union cbfs_mdata *mdata, struct region_device *rdev); void *_cbfs_alloc(const char *name, cbfs_allocator_t allocator, void *arg, size_t *size_out, bool force_ro, enum cbfs_type *type); diff --git a/src/include/mipi/panel.h b/src/include/mipi/panel.h index 527af7e95c..ca06897c98 100644 --- a/src/include/mipi/panel.h +++ b/src/include/mipi/panel.h @@ -31,10 +31,10 @@ struct panel_serializable_data { u8 init[]; /* A packed array of panel_init_command */ }; -typedef cb_err_t (*mipi_cmd_func_t)(enum mipi_dsi_transaction type, const u8 *data, u8 len); +typedef enum cb_err (*mipi_cmd_func_t)(enum mipi_dsi_transaction type, const u8 *data, u8 len); /* Parse a command array and call cmd_func() for each entry. Delays get handled internally. */ -cb_err_t mipi_panel_parse_init_commands(const void *buf, mipi_cmd_func_t cmd_func); +enum cb_err mipi_panel_parse_init_commands(const void *buf, mipi_cmd_func_t cmd_func); #define PANEL_DCS(...) \ PANEL_CMD_DCS, \ diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 0f07a32edd..c8ca14caef 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -34,15 +34,15 @@ static void switch_to_postram_cache(int unused) } ROMSTAGE_CBMEM_INIT_HOOK(switch_to_postram_cache); -cb_err_t _cbfs_boot_lookup(const char *name, bool force_ro, - union cbfs_mdata *mdata, struct region_device *rdev) +enum cb_err _cbfs_boot_lookup(const char *name, bool force_ro, + union cbfs_mdata *mdata, struct region_device *rdev) { const struct cbfs_boot_device *cbd = cbfs_get_boot_device(force_ro); if (!cbd) return CB_ERR; size_t data_offset; - cb_err_t err = CB_CBFS_CACHE_FULL; + enum cb_err err = CB_CBFS_CACHE_FULL; if (!CONFIG(NO_CBFS_MCACHE) && !ENV_SMM && cbd->mcache_size) err = cbfs_mcache_lookup(cbd->mcache, cbd->mcache_size, name, mdata, &data_offset); @@ -520,11 +520,11 @@ void *_cbfs_cbmem_allocator(void *arg, size_t size, const union cbfs_mdata *unus return cbmem_add((uintptr_t)arg, size); } -cb_err_t cbfs_prog_stage_load(struct prog *pstage) +enum cb_err cbfs_prog_stage_load(struct prog *pstage) { union cbfs_mdata mdata; struct region_device rdev; - cb_err_t err; + enum cb_err err; prog_locate_hook(pstage); @@ -612,8 +612,8 @@ void cbfs_boot_device_find_mcache(struct cbfs_boot_device *cbd, uint32_t id) } } -cb_err_t cbfs_init_boot_device(const struct cbfs_boot_device *cbd, - struct vb2_hash *mdata_hash) +enum cb_err cbfs_init_boot_device(const struct cbfs_boot_device *cbd, + struct vb2_hash *mdata_hash) { /* If we have an mcache, mcache_build() will also check mdata hash. */ if (!CONFIG(NO_CBFS_MCACHE) && !ENV_SMM && cbd->mcache_size > 0) @@ -625,7 +625,7 @@ cb_err_t cbfs_init_boot_device(const struct cbfs_boot_device *cbd, /* Verification only: use cbfs_walk() without a walker() function to just run through the CBFS once, will return NOT_FOUND by default. */ - cb_err_t err = cbfs_walk(&cbd->rdev, NULL, NULL, mdata_hash, 0); + enum cb_err err = cbfs_walk(&cbd->rdev, NULL, NULL, mdata_hash, 0); if (err == CB_CBFS_NOT_FOUND) err = CB_SUCCESS; return err; @@ -660,7 +660,7 @@ const struct cbfs_boot_device *cbfs_get_boot_device(bool force_ro) die("Cannot locate primary CBFS"); if (ENV_INITIAL_STAGE) { - cb_err_t err = cbfs_init_boot_device(&ro, metadata_hash_get()); + enum cb_err err = cbfs_init_boot_device(&ro, metadata_hash_get()); if (err == CB_CBFS_HASH_MISMATCH) die("RO CBFS metadata hash verification failure"); else if (CONFIG(TOCTOU_SAFETY) && err == CB_CBFS_CACHE_FULL) diff --git a/src/security/vboot/vboot_loader.c b/src/security/vboot/vboot_loader.c index 1c4343bdc5..0acb349941 100644 --- a/src/security/vboot/vboot_loader.c +++ b/src/security/vboot/vboot_loader.c @@ -34,7 +34,7 @@ static void after_verstage(void) if (!cbd) /* Can't initialize RW CBFS in recovery mode. */ return; - cb_err_t err = cbfs_init_boot_device(cbd, NULL); /* TODO: RW hash */ + enum cb_err err = cbfs_init_boot_device(cbd, NULL); /* TODO: RW hash */ if (err && err != CB_CBFS_CACHE_FULL) /* TODO: -> recovery? */ die("RW CBFS initialization failure: %d", err); } diff --git a/src/soc/mediatek/common/dsi.c b/src/soc/mediatek/common/dsi.c index f16d8f2480..396d979c21 100644 --- a/src/soc/mediatek/common/dsi.c +++ b/src/soc/mediatek/common/dsi.c @@ -303,7 +303,7 @@ static bool mtk_dsi_is_read_command(enum mipi_dsi_transaction type) } } -static cb_err_t mtk_dsi_cmdq(enum mipi_dsi_transaction type, const u8 *data, u8 len) +static enum cb_err mtk_dsi_cmdq(enum mipi_dsi_transaction type, const u8 *data, u8 len) { const u8 *tx_buf = data; u32 config; diff --git a/src/soc/qualcomm/sc7180/display/dsi.c b/src/soc/qualcomm/sc7180/display/dsi.c index 48dc2b395d..9e6977ca7b 100644 --- a/src/soc/qualcomm/sc7180/display/dsi.c +++ b/src/soc/qualcomm/sc7180/display/dsi.c @@ -204,11 +204,12 @@ static int mdss_dsi_cmd_dma_trigger_for_panel(void) return status; } -static cb_err_t mdss_dsi_send_init_cmd(enum mipi_dsi_transaction type, const u8 *body, u8 len) +static enum cb_err mdss_dsi_send_init_cmd(enum mipi_dsi_transaction type, const u8 *body, + u8 len) { uint8_t *pload = _dma_coherent; uint32_t size; - cb_err_t ret = CB_SUCCESS; + enum cb_err ret = CB_SUCCESS; int data = 0; uint32_t *bp = NULL; @@ -276,7 +277,7 @@ static void mdss_dsi_clear_intr(void) write32(&dsi0->err_int_mask0, 0x13FF3BFF); } -cb_err_t mdss_dsi_panel_initialize(const u8 *init_cmds) +enum cb_err mdss_dsi_panel_initialize(const u8 *init_cmds) { uint32_t ctrl_mode = 0; @@ -286,7 +287,7 @@ cb_err_t mdss_dsi_panel_initialize(const u8 *init_cmds) /* Enable command mode before sending the commands */ write32(&dsi0->ctrl, ctrl_mode | 0x04); - cb_err_t ret = mipi_panel_parse_init_commands(init_cmds, mdss_dsi_send_init_cmd); + enum cb_err ret = mipi_panel_parse_init_commands(init_cmds, mdss_dsi_send_init_cmd); write32(&dsi0->ctrl, ctrl_mode); mdss_dsi_clear_intr(); diff --git a/src/soc/qualcomm/sc7180/include/soc/display/mipi_dsi.h b/src/soc/qualcomm/sc7180/include/soc/display/mipi_dsi.h index a7c9b6e4af..12e51491fb 100644 --- a/src/soc/qualcomm/sc7180/include/soc/display/mipi_dsi.h +++ b/src/soc/qualcomm/sc7180/include/soc/display/mipi_dsi.h @@ -22,6 +22,6 @@ enum { enum cb_err mdss_dsi_config(struct edid *edid, uint32_t num_of_lanes, uint32_t bpp); void mdss_dsi_clock_config(void); void mdss_dsi_video_mode_config(struct edid *edid, uint32_t bpp); -cb_err_t mdss_dsi_panel_initialize(const u8 *init_cmds); +enum cb_err mdss_dsi_panel_initialize(const u8 *init_cmds); #endif |