Skip to content

Commit 40606db

Browse files
nvswarrenbroonie
authored andcommitted
regmap: mmio: convert some error returns to BUG()
Some of the error conditions detected by regmap_mmio_*() are pure internal errors, rather than user-/client-triggerable conditions. Convert these to BUG(). Signed-off-by: Stephen Warren <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 45f5ff8 commit 40606db

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/base/regmap/regmap-mmio.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ static int regmap_mmio_gather_write(void *context,
3535
struct regmap_mmio_context *ctx = context;
3636
u32 offset;
3737

38-
if (reg_size != 4)
39-
return -EIO;
38+
BUG_ON(reg_size != 4);
39+
4040
if (val_size % ctx->val_bytes)
4141
return -EIO;
4242

@@ -60,7 +60,7 @@ static int regmap_mmio_gather_write(void *context,
6060
#endif
6161
default:
6262
/* Should be caught by regmap_mmio_check_config */
63-
return -EIO;
63+
BUG();
6464
}
6565
val_size -= ctx->val_bytes;
6666
val += ctx->val_bytes;
@@ -72,8 +72,8 @@ static int regmap_mmio_gather_write(void *context,
7272

7373
static int regmap_mmio_write(void *context, const void *data, size_t count)
7474
{
75-
if (count < 4)
76-
return -EIO;
75+
BUG_ON(count < 4);
76+
7777
return regmap_mmio_gather_write(context, data, 4, data + 4, count - 4);
7878
}
7979

@@ -84,8 +84,8 @@ static int regmap_mmio_read(void *context,
8484
struct regmap_mmio_context *ctx = context;
8585
u32 offset;
8686

87-
if (reg_size != 4)
88-
return -EIO;
87+
BUG_ON(reg_size != 4);
88+
8989
if (val_size % ctx->val_bytes)
9090
return -EIO;
9191

@@ -109,7 +109,7 @@ static int regmap_mmio_read(void *context,
109109
#endif
110110
default:
111111
/* Should be caught by regmap_mmio_check_config */
112-
return -EIO;
112+
BUG();
113113
}
114114
val_size -= ctx->val_bytes;
115115
val += ctx->val_bytes;

0 commit comments

Comments
 (0)