From 1dbcc6ae7d8642d7835bf6a411060e0b9677c905 Mon Sep 17 00:00:00 2001 From: Iwona Winiarska Date: Fri, 27 May 2022 02:11:36 +0200 Subject: 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 --- drivers/i3c/mctp/i3c-mctp.c | 7 ++++--- 1 file 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); } -- cgit v1.2.3