diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2024-02-12 14:27:53 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-02-13 10:11:00 +0100 |
commit | 2c2bec416b2cd7c89e1d1ef703d694a4f72bc9de (patch) | |
tree | d3a58044f2904fde62d687709f162452ece585d5 | |
parent | 5f9093be28b4513ffaca923e4e4ab06eaab9da18 (diff) | |
download | barebox-2c2bec416b2c.tar.gz barebox-2c2bec416b2c.tar.xz |
nvmem: ocotp: mark data as const
Mark values obtained from "priv->data->ctrl" as const.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Link: https://lore.barebox.org/20240212132901.1641599-4-mkl@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/nvmem/ocotp.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c index 16d2a6be9f..c282efefa8 100644 --- a/drivers/nvmem/ocotp.c +++ b/drivers/nvmem/ocotp.c @@ -275,11 +275,11 @@ static int imx6_ocotp_prepare(struct ocotp_priv *priv) static int imx6_fuse_read_addr(struct ocotp_priv *priv, u32 addr, u32 *pdata) { + const u32 bm_ctrl_error = priv->data->ctrl->bm_error; + const u32 bm_ctrl_addr = priv->data->ctrl->bm_addr; + const u32 bm_ctrl_wr_unlock = priv->data->ctrl->bm_wr_unlock; u32 ctrl_reg; int ret; - u32 bm_ctrl_error = priv->data->ctrl->bm_error; - u32 bm_ctrl_addr = priv->data->ctrl->bm_addr; - u32 bm_ctrl_wr_unlock = priv->data->ctrl->bm_wr_unlock; writel(bm_ctrl_error, priv->base + OCOTP_CTRL_CLR); @@ -304,13 +304,13 @@ static int imx6_fuse_read_addr(struct ocotp_priv *priv, u32 addr, u32 *pdata) static int imx7_fuse_read_addr(struct ocotp_priv *priv, u32 index, u32 *pdata) { + const u32 bm_ctrl_error = priv->data->ctrl->bm_error; + const u32 bm_ctrl_addr = priv->data->ctrl->bm_addr; + const u32 bm_ctrl_wr_unlock = priv->data->ctrl->bm_wr_unlock; u32 ctrl_reg; u32 bank_addr; u16 word; int ret; - u32 bm_ctrl_error = priv->data->ctrl->bm_error; - u32 bm_ctrl_addr = priv->data->ctrl->bm_addr; - u32 bm_ctrl_wr_unlock = priv->data->ctrl->bm_wr_unlock; word = index & 0x3; bank_addr = index >> 2; @@ -391,10 +391,10 @@ static int imx_ocotp_reg_read(void *ctx, unsigned int reg, unsigned int *val) static void imx_ocotp_clear_unlock(struct ocotp_priv *priv, u32 index) { + const u32 bm_ctrl_error = priv->data->ctrl->bm_error; + const u32 bm_ctrl_addr = priv->data->ctrl->bm_addr; + const u32 bm_ctrl_wr_unlock = priv->data->ctrl->bm_wr_unlock; u32 ctrl_reg; - u32 bm_ctrl_error = priv->data->ctrl->bm_error; - u32 bm_ctrl_addr = priv->data->ctrl->bm_addr; - u32 bm_ctrl_wr_unlock = priv->data->ctrl->bm_wr_unlock; writel(bm_ctrl_error, priv->base + OCOTP_CTRL_CLR); @@ -408,8 +408,8 @@ static void imx_ocotp_clear_unlock(struct ocotp_priv *priv, u32 index) static int imx6_fuse_blow_addr(struct ocotp_priv *priv, u32 index, u32 value) { + const u32 bm_ctrl_error = priv->data->ctrl->bm_error; int ret; - u32 bm_ctrl_error = priv->data->ctrl->bm_error; imx_ocotp_clear_unlock(priv, index); @@ -474,7 +474,7 @@ static int imx7_fuse_blow_addr(struct ocotp_priv *priv, u32 index, u32 value) static int imx6_ocotp_reload_shadow(struct ocotp_priv *priv) { - u32 bm_ctrl_reload_shadows = priv->data->ctrl->bm_reload_shadows; + const u32 bm_ctrl_reload_shadows = priv->data->ctrl->bm_reload_shadows; dev_info(&priv->dev, "reloading shadow registers...\n"); writel(bm_ctrl_reload_shadows, priv->base + OCOTP_CTRL_SET); @@ -486,8 +486,8 @@ static int imx6_ocotp_reload_shadow(struct ocotp_priv *priv) static int imx6_ocotp_blow_one_u32(struct ocotp_priv *priv, u32 index, u32 data, u32 *pfused_value) { + const u32 bm_ctrl_error = priv->data->ctrl->bm_error; int ret; - u32 bm_ctrl_error = priv->data->ctrl->bm_error; ret = imx6_ocotp_prepare(priv); if (ret) { |