Skip to content

Commit cd2315d

Browse files
BenjaminFaircminyard
authored andcommitted
ipmi: kcs_bmc: don't change device name
kcs_bmc_alloc(...) calls dev_set_name(...) which is incorrect as most bus driver frameworks, platform_driver in particular, assume that they are able to set the device name themselves. Signed-off-by: Benjamin Fair <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 9f8f16c commit cd2315d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/char/ipmi/kcs_bmc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "kcs_bmc.h"
1818

19+
#define DEVICE_NAME "ipmi-kcs"
20+
1921
#define KCS_MSG_BUFSIZ 1000
2022

2123
#define KCS_ZERO_DATA 0
@@ -429,8 +431,6 @@ struct kcs_bmc *kcs_bmc_alloc(struct device *dev, int sizeof_priv, u32 channel)
429431
if (!kcs_bmc)
430432
return NULL;
431433

432-
dev_set_name(dev, "ipmi-kcs%u", channel);
433-
434434
spin_lock_init(&kcs_bmc->lock);
435435
kcs_bmc->channel = channel;
436436

@@ -444,7 +444,8 @@ struct kcs_bmc *kcs_bmc_alloc(struct device *dev, int sizeof_priv, u32 channel)
444444
return NULL;
445445

446446
kcs_bmc->miscdev.minor = MISC_DYNAMIC_MINOR;
447-
kcs_bmc->miscdev.name = dev_name(dev);
447+
kcs_bmc->miscdev.name = devm_kasprintf(dev, GFP_KERNEL, "%s%u",
448+
DEVICE_NAME, channel);
448449
kcs_bmc->miscdev.fops = &kcs_bmc_fops;
449450

450451
return kcs_bmc;

0 commit comments

Comments
 (0)