Commit 494566f7 authored by Shahar Avidar's avatar Shahar Avidar Committed by Greg Kroah-Hartman

staging: pi433: Rename "pi433_dev" of type "dev_t" to "pi433_devt"

Distinguish struct device type instances from dev_t instances
to enhance readability.
Signed-off-by: default avatarShahar Avidar <ikobh7@gmail.com>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20240405074000.3481217-5-ikobh7@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cdcf3051
......@@ -52,7 +52,7 @@
#define FIFO_THRESHOLD 15 /* bytes */
#define NUM_DIO 2
static dev_t pi433_dev;
static dev_t pi433_devt;
static DEFINE_IDR(pi433_idr);
static DEFINE_MUTEX(minor_lock); /* Protect idr accesses */
static struct dentry *root_dir; /* debugfs root directory for the driver */
......@@ -1261,7 +1261,7 @@ static int pi433_probe(struct spi_device *spi)
}
/* create device */
pi433->devt = MKDEV(MAJOR(pi433_dev), pi433->minor);
pi433->devt = MKDEV(MAJOR(pi433_devt), pi433->minor);
pi433->dev = device_create(&pi433_class,
&spi->dev,
pi433->devt,
......@@ -1275,7 +1275,7 @@ static int pi433_probe(struct spi_device *spi)
} else {
dev_dbg(pi433->dev,
"created device for major %d, minor %d\n",
MAJOR(pi433_dev),
MAJOR(pi433_devt),
pi433->minor);
}
......@@ -1396,13 +1396,13 @@ static int __init pi433_init(void)
* that will key udev/mdev to add/remove /dev nodes.
* Last, register the driver which manages those device numbers.
*/
status = alloc_chrdev_region(&pi433_dev, 0, N_PI433_MINORS, "pi433");
status = alloc_chrdev_region(&pi433_devt, 0, N_PI433_MINORS, "pi433");
if (status < 0)
return status;
status = class_register(&pi433_class);
if (status) {
unregister_chrdev(MAJOR(pi433_dev),
unregister_chrdev(MAJOR(pi433_devt),
pi433_spi_driver.driver.name);
return status;
}
......@@ -1412,7 +1412,7 @@ static int __init pi433_init(void)
status = spi_register_driver(&pi433_spi_driver);
if (status < 0) {
class_unregister(&pi433_class);
unregister_chrdev(MAJOR(pi433_dev),
unregister_chrdev(MAJOR(pi433_devt),
pi433_spi_driver.driver.name);
}
......@@ -1425,7 +1425,7 @@ static void __exit pi433_exit(void)
{
spi_unregister_driver(&pi433_spi_driver);
class_unregister(&pi433_class);
unregister_chrdev(MAJOR(pi433_dev), pi433_spi_driver.driver.name);
unregister_chrdev(MAJOR(pi433_devt), pi433_spi_driver.driver.name);
debugfs_remove(root_dir);
}
module_exit(pi433_exit);
......
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