aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/regmap/regmap-mmio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/regmap/regmap-mmio.c')
-rw-r--r--drivers/base/regmap/regmap-mmio.c16
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
73static int regmap_mmio_write(void *context, const void *data, size_t count) 73static 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;