summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/twl-common.c
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-01-30 19:46:49 +0800
committerTony Lindgren <tony@atomide.com>2013-02-04 10:17:37 -0800
commitc8d4bafe503ca767bbc8f3c54e4acd344ef26346 (patch)
treebaed6cff1c10a8cdde6f411106ca44e6c21c1107 /arch/arm/mach-omap2/twl-common.c
parent61338d598eec1477455294f006793ee54eead795 (diff)
ARM: OMAP2+: using strlcpy instead of strncpy
the fields must be null-terminated: the caller may use it as null-terminted string, next. Signed-off-by: Chen Gang <gang.chen@asianux.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/twl-common.c')
-rw-r--r--arch/arm/mach-omap2/twl-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index e49b40b4c90a..6a7aec6d1174 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -23,6 +23,7 @@
#include <linux/i2c.h>
#include <linux/i2c/twl.h>
#include <linux/gpio.h>
+#include <linux/string.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>
@@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate,
struct twl4030_platform_data *pmic_data)
{
omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
- strncpy(pmic_i2c_board_info.type, pmic_type,
+ strlcpy(pmic_i2c_board_info.type, pmic_type,
sizeof(pmic_i2c_board_info.type));
pmic_i2c_board_info.irq = pmic_irq;
pmic_i2c_board_info.platform_data = pmic_data;