Commit a65ecc40 authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Deucher

drm/amd: cleanup get_mfd_cell_dev()

It's simpler to just use snprintf() to print this to one buffer instead
of using strcpy() and strcat().  Also using snprintf() is slightly safer
than using sprintf().
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 70eacc72
...@@ -240,12 +240,10 @@ static int acp_poweron(struct generic_pm_domain *genpd) ...@@ -240,12 +240,10 @@ static int acp_poweron(struct generic_pm_domain *genpd)
static struct device *get_mfd_cell_dev(const char *device_name, int r) static struct device *get_mfd_cell_dev(const char *device_name, int r)
{ {
char auto_dev_name[25]; char auto_dev_name[25];
char buf[8];
struct device *dev; struct device *dev;
sprintf(buf, ".%d.auto", r); snprintf(auto_dev_name, sizeof(auto_dev_name),
strcpy(auto_dev_name, device_name); "%s.%d.auto", device_name, r);
strcat(auto_dev_name, buf);
dev = bus_find_device_by_name(&platform_bus_type, NULL, auto_dev_name); dev = bus_find_device_by_name(&platform_bus_type, NULL, auto_dev_name);
dev_info(dev, "device %s added to pm domain\n", auto_dev_name); dev_info(dev, "device %s added to pm domain\n", auto_dev_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment