summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIwona Winiarska <iwona.winiarska@intel.com>2022-05-27 03:11:36 +0300
committerIwona Winiarska <iwona.winiarska@intel.com>2022-05-27 16:21:19 +0300
commit1dbcc6ae7d8642d7835bf6a411060e0b9677c905 (patch)
tree539ad415fa2d9554f362a37f2bfd024b6e0a6ed0
parent5e91917634738a1e1c404dfb7bf6f41f8874a457 (diff)
downloadlinux-1dbcc6ae7d8642d7835bf6a411060e0b9677c905.tar.xz
Revert "i3c: mctp: Replace redundant MKDEV calls"
This reverts commit 825fd72c22d729a4ad0d4d3ee488525710fe9877. Minor was passed as one of the arguments - it was not redundant and removing it introduces a regression. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
-rw-r--r--drivers/i3c/mctp/i3c-mctp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i3c/mctp/i3c-mctp.c b/drivers/i3c/mctp/i3c-mctp.c
index 0fa8f65b3587..560884ccc51a 100644
--- a/drivers/i3c/mctp/i3c-mctp.c
+++ b/drivers/i3c/mctp/i3c-mctp.c
@@ -290,12 +290,13 @@ static int i3c_mctp_probe(struct i3c_device *i3cdev)
cdev_init(&priv->cdev, &i3c_mctp_fops);
priv->cdev.owner = THIS_MODULE;
- ret = cdev_add(&priv->cdev, i3c_mctp_devt, 1);
+ ret = cdev_add(&priv->cdev, MKDEV(MAJOR(i3c_mctp_devt), priv->id), 1);
if (ret)
goto error_cdev;
/* register this i3c device with the driver core */
- priv->dev = device_create(i3c_mctp_class, dev, i3c_mctp_devt,
+ priv->dev = device_create(i3c_mctp_class, dev,
+ MKDEV(MAJOR(i3c_mctp_devt), priv->id),
NULL, "i3c-mctp-%d", priv->id);
if (IS_ERR(priv->dev)) {
ret = PTR_ERR(priv->dev);
@@ -329,7 +330,7 @@ static void i3c_mctp_remove(struct i3c_device *i3cdev)
i3c_device_disable_ibi(i3cdev);
i3c_device_free_ibi(i3cdev);
- device_destroy(i3c_mctp_class, i3c_mctp_devt);
+ device_destroy(i3c_mctp_class, MKDEV(MAJOR(i3c_mctp_devt), priv->id));
cdev_del(&priv->cdev);
ida_free(&i3c_mctp_ida, priv->id);
}