aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2013-01-16 08:53:51 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-02-13 18:22:49 -0500
commit050cde1363a3fc59f2a2f1cac6ef050393a00c99 (patch)
treedeffc2b4e2a057f3cd25135f4dfe724e8fb467f1 /drivers/mfd
parent5d4e9bd79a5ab5bd4695d3becaa71da447a76a94 (diff)
mfd: twl-core: No need to check for invalid subchip ID
The module id table no longer can have invalid/unused entries. No need for checking the ID for validity. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/twl-core.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index b781cdd0629d..fa1a5a0fa759 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -72,7 +72,6 @@
72#define SUB_CHIP_ID1 1 72#define SUB_CHIP_ID1 1
73#define SUB_CHIP_ID2 2 73#define SUB_CHIP_ID2 2
74#define SUB_CHIP_ID3 3 74#define SUB_CHIP_ID3 3
75#define SUB_CHIP_ID_INVAL 0xff
76 75
77/* Base Address defns for twl4030_map[] */ 76/* Base Address defns for twl4030_map[] */
78 77
@@ -326,12 +325,8 @@ int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
326 pr_err("%s: not initialized\n", DRIVER_NAME); 325 pr_err("%s: not initialized\n", DRIVER_NAME);
327 return -EPERM; 326 return -EPERM;
328 } 327 }
328
329 sid = twl_map[mod_no].sid; 329 sid = twl_map[mod_no].sid;
330 if (unlikely(sid == SUB_CHIP_ID_INVAL)) {
331 pr_err("%s: module %d is not part of the pmic\n",
332 DRIVER_NAME, mod_no);
333 return -EINVAL;
334 }
335 twl = &twl_modules[sid]; 330 twl = &twl_modules[sid];
336 331
337 ret = regmap_bulk_write(twl->regmap, twl_map[mod_no].base + reg, 332 ret = regmap_bulk_write(twl->regmap, twl_map[mod_no].base + reg,
@@ -368,12 +363,8 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
368 pr_err("%s: not initialized\n", DRIVER_NAME); 363 pr_err("%s: not initialized\n", DRIVER_NAME);
369 return -EPERM; 364 return -EPERM;
370 } 365 }
366
371 sid = twl_map[mod_no].sid; 367 sid = twl_map[mod_no].sid;
372 if (unlikely(sid == SUB_CHIP_ID_INVAL)) {
373 pr_err("%s: module %d is not part of the pmic\n",
374 DRIVER_NAME, mod_no);
375 return -EINVAL;
376 }
377 twl = &twl_modules[sid]; 368 twl = &twl_modules[sid];
378 369
379 ret = regmap_bulk_read(twl->regmap, twl_map[mod_no].base + reg, 370 ret = regmap_bulk_read(twl->regmap, twl_map[mod_no].base + reg,