summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIwona Winiarska <iwona.winiarska@intel.com>2022-05-03 20:43:02 +0300
committerIwona Winiarska <iwona.winiarska@intel.com>2022-05-25 14:23:21 +0300
commit825fd72c22d729a4ad0d4d3ee488525710fe9877 (patch)
tree202b2069c38da57b28138f80deda70cc0138f16b
parent52ac8c5e80f2406265fd09cbfe0599b56fe5bb27 (diff)
downloadlinux-825fd72c22d729a4ad0d4d3ee488525710fe9877.tar.xz
i3c: mctp: Replace redundant MKDEV calls
Since alloc_chrdev_region() returns devt as an output parameter, calling MKDEV() on it is a no-op. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
-rw-r--r--drivers/i3c/mctp/i3c-mctp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/i3c/mctp/i3c-mctp.c b/drivers/i3c/mctp/i3c-mctp.c
index 560884ccc51a..0fa8f65b3587 100644
--- a/drivers/i3c/mctp/i3c-mctp.c
+++ b/drivers/i3c/mctp/i3c-mctp.c
@@ -290,13 +290,12 @@ 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, MKDEV(MAJOR(i3c_mctp_devt), priv->id), 1);
+ ret = cdev_add(&priv->cdev, i3c_mctp_devt, 1);
if (ret)
goto error_cdev;
/* register this i3c device with the driver core */
- priv->dev = device_create(i3c_mctp_class, dev,
- MKDEV(MAJOR(i3c_mctp_devt), priv->id),
+ priv->dev = device_create(i3c_mctp_class, dev, i3c_mctp_devt,
NULL, "i3c-mctp-%d", priv->id);
if (IS_ERR(priv->dev)) {
ret = PTR_ERR(priv->dev);
@@ -330,7 +329,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, MKDEV(MAJOR(i3c_mctp_devt), priv->id));
+ device_destroy(i3c_mctp_class, i3c_mctp_devt);
cdev_del(&priv->cdev);
ida_free(&i3c_mctp_ida, priv->id);
}