aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShahar Avidar <ikobh7@gmail.com>2024-04-05 10:39:57 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-09 17:52:13 +0200
commit494566f7a544ae6813bc7b41ec4e03bd62740b7c (patch)
treeb80dd38b85853eb0e2c4d1103447f00e67a9cb88
parentcdcf3051f0c05dab75ba46d751adede00f77c54b (diff)
downloadstaging-494566f7a544ae6813bc7b41ec4e03bd62740b7c.tar.gz
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: Shahar Avidar <ikobh7@gmail.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240405074000.3481217-5-ikobh7@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/pi433/pi433_if.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 1e467693d5461a..ac4cbeb961e9e7 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -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);