From: Nishanth Menon Date: Fri, 22 Mar 2013 16:33:21 -0500 Subject: [U-Boot] [PATCH V2 6/9] twl6035: make twl6030_i2c_[read|write]_u8 static inline In-Reply-To: <1363988004-25819-1-git-send-email-nm@ti.com> References: <1363988004-25819-1-git-send-email-nm@ti.com> Message-ID: <1363988004-25819-7-git-send-email-nm@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de twl6030_i2c_[read|write]_u8 can be used else where to access multi-function device such as twl6035, we dont need to incurr an function call overhead, so use static inline. Signed-off-by: Nishanth Menon --- drivers/power/twl6035.c | 11 ----------- include/twl6035.h | 13 +++++++++++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/power/twl6035.c b/drivers/power/twl6035.c index d3de698..0c2cdfe 100644 --- a/drivers/power/twl6035.c +++ b/drivers/power/twl6035.c @@ -23,17 +23,6 @@ #include #include -/* Functions to read and write from TWL6030 */ -int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg) -{ - return i2c_write(chip_no, reg, 1, &val, 1); -} - -int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) -{ - return i2c_read(chip_no, reg, 1, val, 1); -} - /* To align with i2c mw/mr address, reg, val command syntax */ static inline int palmas_write_u8(u8 chip_no, u8 reg, u8 val) { diff --git a/include/twl6035.h b/include/twl6035.h index ce74348..89c2ab5 100644 --- a/include/twl6035.h +++ b/include/twl6035.h @@ -36,7 +36,16 @@ #define LDO_MODE_SLEEP (1 << 2) #define LDO_MODE_ACTIVE (1 << 0) -int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg); -int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg); +/* Functions to read and write from TWL6030 */ +static inline int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg) +{ + return i2c_write(chip_no, reg, 1, &val, 1); +} + +static inline int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg) +{ + return i2c_read(chip_no, reg, 1, val, 1); +} + void twl6035_init_settings(void); int twl6035_mmc1_poweron_ldo(void); -- 1.7.9.5