mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
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 <swarren@nvidia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
45f5ff8107
commit
40606dba45
1 changed files with 8 additions and 8 deletions
|
@ -35,8 +35,8 @@ static int regmap_mmio_gather_write(void *context,
|
||||||
struct regmap_mmio_context *ctx = context;
|
struct regmap_mmio_context *ctx = context;
|
||||||
u32 offset;
|
u32 offset;
|
||||||
|
|
||||||
if (reg_size != 4)
|
BUG_ON(reg_size != 4);
|
||||||
return -EIO;
|
|
||||||
if (val_size % ctx->val_bytes)
|
if (val_size % ctx->val_bytes)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ static int regmap_mmio_gather_write(void *context,
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
/* Should be caught by regmap_mmio_check_config */
|
/* Should be caught by regmap_mmio_check_config */
|
||||||
return -EIO;
|
BUG();
|
||||||
}
|
}
|
||||||
val_size -= ctx->val_bytes;
|
val_size -= ctx->val_bytes;
|
||||||
val += ctx->val_bytes;
|
val += ctx->val_bytes;
|
||||||
|
@ -72,8 +72,8 @@ static int regmap_mmio_gather_write(void *context,
|
||||||
|
|
||||||
static int regmap_mmio_write(void *context, const void *data, size_t count)
|
static int regmap_mmio_write(void *context, const void *data, size_t count)
|
||||||
{
|
{
|
||||||
if (count < 4)
|
BUG_ON(count < 4);
|
||||||
return -EIO;
|
|
||||||
return regmap_mmio_gather_write(context, data, 4, data + 4, count - 4);
|
return regmap_mmio_gather_write(context, data, 4, data + 4, count - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ static int regmap_mmio_read(void *context,
|
||||||
struct regmap_mmio_context *ctx = context;
|
struct regmap_mmio_context *ctx = context;
|
||||||
u32 offset;
|
u32 offset;
|
||||||
|
|
||||||
if (reg_size != 4)
|
BUG_ON(reg_size != 4);
|
||||||
return -EIO;
|
|
||||||
if (val_size % ctx->val_bytes)
|
if (val_size % ctx->val_bytes)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ static int regmap_mmio_read(void *context,
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
/* Should be caught by regmap_mmio_check_config */
|
/* Should be caught by regmap_mmio_check_config */
|
||||||
return -EIO;
|
BUG();
|
||||||
}
|
}
|
||||||
val_size -= ctx->val_bytes;
|
val_size -= ctx->val_bytes;
|
||||||
val += ctx->val_bytes;
|
val += ctx->val_bytes;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue