diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-04-06 17:17:32 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-13 06:29:17 -0400 |
commit | ae5d8af579354fb8e984735de9b4b6e9ad6fecb8 (patch) | |
tree | 4059f9e0fe9a6f1a0e7abae665eb264e3506f6a6 | |
parent | ecb44aec86f0a5e37142a971815f91e065645986 (diff) |
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>
-rw-r--r-- | drivers/base/regmap/regmap-mmio.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c index 1a7b5ee11ab..ffa0e850839 100644 --- a/drivers/base/regmap/regmap-mmio.c +++ b/drivers/base/regmap/regmap-mmio.c | |||
@@ -35,8 +35,8 @@ static int regmap_mmio_gather_write(void *context, | |||
35 | struct regmap_mmio_context *ctx = context; | 35 | struct regmap_mmio_context *ctx = context; |
36 | u32 offset; | 36 | u32 offset; |
37 | 37 | ||
38 | if (reg_size != 4) | 38 | BUG_ON(reg_size != 4); |
39 | return -EIO; | 39 | |
40 | if (val_size % ctx->val_bytes) | 40 | if (val_size % ctx->val_bytes) |
41 | return -EIO; | 41 | return -EIO; |
42 | 42 | ||
@@ -60,7 +60,7 @@ static int regmap_mmio_gather_write(void *context, | |||
60 | #endif | 60 | #endif |
61 | default: | 61 | default: |
62 | /* Should be caught by regmap_mmio_check_config */ | 62 | /* Should be caught by regmap_mmio_check_config */ |
63 | return -EIO; | 63 | BUG(); |
64 | } | 64 | } |
65 | val_size -= ctx->val_bytes; | 65 | val_size -= ctx->val_bytes; |
66 | val += ctx->val_bytes; | 66 | val += ctx->val_bytes; |
@@ -72,8 +72,8 @@ static int regmap_mmio_gather_write(void *context, | |||
72 | 72 | ||
73 | static int regmap_mmio_write(void *context, const void *data, size_t count) | 73 | static int regmap_mmio_write(void *context, const void *data, size_t count) |
74 | { | 74 | { |
75 | if (count < 4) | 75 | BUG_ON(count < 4); |
76 | return -EIO; | 76 | |
77 | return regmap_mmio_gather_write(context, data, 4, data + 4, count - 4); | 77 | return regmap_mmio_gather_write(context, data, 4, data + 4, count - 4); |
78 | } | 78 | } |
79 | 79 | ||
@@ -84,8 +84,8 @@ static int regmap_mmio_read(void *context, | |||
84 | struct regmap_mmio_context *ctx = context; | 84 | struct regmap_mmio_context *ctx = context; |
85 | u32 offset; | 85 | u32 offset; |
86 | 86 | ||
87 | if (reg_size != 4) | 87 | BUG_ON(reg_size != 4); |
88 | return -EIO; | 88 | |
89 | if (val_size % ctx->val_bytes) | 89 | if (val_size % ctx->val_bytes) |
90 | return -EIO; | 90 | return -EIO; |
91 | 91 | ||
@@ -109,7 +109,7 @@ static int regmap_mmio_read(void *context, | |||
109 | #endif | 109 | #endif |
110 | default: | 110 | default: |
111 | /* Should be caught by regmap_mmio_check_config */ | 111 | /* Should be caught by regmap_mmio_check_config */ |
112 | return -EIO; | 112 | BUG(); |
113 | } | 113 | } |
114 | val_size -= ctx->val_bytes; | 114 | val_size -= ctx->val_bytes; |
115 | val += ctx->val_bytes; | 115 | val += ctx->val_bytes; |