From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>,
Tero Kristo <t-kristo@ti.com>
Subject: [PATCH 02/10] mfd: twl-core: No need to check for invalid subchip ID
Date: Mon, 31 Dec 2012 12:09:23 +0100 [thread overview]
Message-ID: <1356952171-6109-3-git-send-email-peter.ujfalusi@ti.com> (raw)
In-Reply-To: <1356952171-6109-1-git-send-email-peter.ujfalusi@ti.com>
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>
---
drivers/mfd/twl-core.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index b781cdd..fa1a5a0 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -72,7 +72,6 @@
#define SUB_CHIP_ID1 1
#define SUB_CHIP_ID2 2
#define SUB_CHIP_ID3 3
-#define SUB_CHIP_ID_INVAL 0xff
/* Base Address defns for twl4030_map[] */
@@ -326,12 +325,8 @@ int twl_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes)
pr_err("%s: not initialized\n", DRIVER_NAME);
return -EPERM;
}
+
sid = twl_map[mod_no].sid;
- if (unlikely(sid == SUB_CHIP_ID_INVAL)) {
- pr_err("%s: module %d is not part of the pmic\n",
- DRIVER_NAME, mod_no);
- return -EINVAL;
- }
twl = &twl_modules[sid];
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)
pr_err("%s: not initialized\n", DRIVER_NAME);
return -EPERM;
}
+
sid = twl_map[mod_no].sid;
- if (unlikely(sid == SUB_CHIP_ID_INVAL)) {
- pr_err("%s: module %d is not part of the pmic\n",
- DRIVER_NAME, mod_no);
- return -EINVAL;
- }
twl = &twl_modules[sid];
ret = regmap_bulk_read(twl->regmap, twl_map[mod_no].base + reg,
--
1.8.0.2
next prev parent reply other threads:[~2012-12-31 11:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-31 11:09 [PATCH 00/10] MFD: twl-core: Cleanup part 2 for 3.9 Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 01/10] mfd: twl-core: Clean up module id lookup and definitions Peter Ujfalusi
2012-12-31 11:09 ` Peter Ujfalusi [this message]
2012-12-31 11:09 ` [PATCH 03/10] mfd: twl-core: Use the lookup table to find the correct subchip for the modules Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 04/10] mfd: twl-core: Allocate twl_modules dynamically Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 05/10] mfd: twl-core: Do not try to call legacy mfd add_children() when booted with DT Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 06/10] mfd: twl-core: Do not create dummy pdata " Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 07/10] mfd: twl-core: Move 'inuse' check early at probe time Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 08/10] mfd: twl-core: Collect global variables behind one private structure (global) Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 09/10] mfd: twl-core: Remove no longer valid comment regarding to write buffer size Peter Ujfalusi
2012-12-31 11:09 ` [PATCH 10/10] mfd: twl-core: Move twl_i2c_read/write_u8 to header as inline function Peter Ujfalusi
2013-01-15 8:20 ` [PATCH 00/10] MFD: twl-core: Cleanup part 2 for 3.9 Peter Ujfalusi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356952171-6109-3-git-send-email-peter.ujfalusi@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=t-kristo@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®