summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ab8500-debugfs.c
diff options
context:
space:
mode:
authorHimanshu Jha <himanshujha199640@gmail.com>2018-03-07 19:06:01 +0100
committerLee Jones <lee.jones@linaro.org>2018-05-16 10:21:48 +0200
commit3683e9e823643f892ee974ca7de28f5ec7f8a067 (patch)
treea042e3c211d29efedfec5e18a5764b056b91f3bd /drivers/mfd/ab8500-debugfs.c
parentmfd: syscon: Set name of regmap_config (diff)
downloadlinux-3683e9e823643f892ee974ca7de28f5ec7f8a067.tar.xz
linux-3683e9e823643f892ee974ca7de28f5ec7f8a067.zip
mfd: ab8500-debugfs: Use kasprintf
Use kasprintf instead of combination of kmalloc and sprintf. Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/ab8500-debugfs.c')
-rw-r--r--drivers/mfd/ab8500-debugfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 8ba41073dd89..831a1ceb2ed2 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -2519,11 +2519,10 @@ static ssize_t ab8500_subscribe_write(struct file *file,
if (!dev_attr[irq_index])
return -ENOMEM;
- event_name[irq_index] = kmalloc(count, GFP_KERNEL);
+ event_name[irq_index] = kasprintf(GFP_KERNEL, "%lu", user_val);
if (!event_name[irq_index])
return -ENOMEM;
- sprintf(event_name[irq_index], "%lu", user_val);
dev_attr[irq_index]->show = show_irq;
dev_attr[irq_index]->store = NULL;
dev_attr[irq_index]->attr.name = event_name[irq_index];