summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/regulator/core.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8c2fd20edd50..80bb95750a20 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1965,8 +1965,6 @@ static const struct file_operations constraint_flags_fops = {
#endif
};
-#define REG_STR_SIZE 64
-
static void link_and_create_debugfs(struct regulator *regulator, struct regulator_dev *rdev,
struct device *dev)
{
@@ -2014,15 +2012,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
lockdep_assert_held_once(&rdev->mutex.base);
if (dev) {
- char buf[REG_STR_SIZE];
- int size;
-
- size = snprintf(buf, REG_STR_SIZE, "%s-%s",
- dev->kobj.name, supply_name);
- if (size >= REG_STR_SIZE)
- return NULL;
-
- supply_name = kstrdup(buf, GFP_KERNEL);
+ supply_name = kasprintf(GFP_KERNEL, "%s-%s", dev->kobj.name, supply_name);
if (supply_name == NULL)
return NULL;
} else {