All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shahar Avidar <ikobh7@gmail.com>
To: gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl,
	andriy.shevchenko@linux.intel.com, robh@kernel.org,
	felixkimbu1@gmail.com
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH v3 4/7] staging: pi433: Rename "pi433_dev" of type "dev_t" to "pi433_devt"
Date: Fri,  5 Apr 2024 10:39:57 +0300	[thread overview]
Message-ID: <20240405074000.3481217-5-ikobh7@gmail.com> (raw)
In-Reply-To: <20240405074000.3481217-1-ikobh7@gmail.com>

Distinguish struct device type instances from dev_t instances
to enhance readability.

Signed-off-by: Shahar Avidar <ikobh7@gmail.com>
---
 drivers/staging/pi433/pi433_if.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 208c0c6d3649..62ce75b07bf0 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -53,7 +53,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 */
@@ -1262,7 +1262,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,
@@ -1276,7 +1276,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);
 	}
 
@@ -1398,13 +1398,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;
 	}
@@ -1414,7 +1414,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);
 	}
 
@@ -1427,7 +1427,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);
-- 
2.34.1


  parent reply	other threads:[~2024-04-05  7:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  7:39 [PATCH v3 0/7] staging: pi433: Cleanup & fix potential resource leak Shahar Avidar
2024-04-05  7:39 ` [PATCH v3 1/7] staging: pi433: Rename struct pi433_device buffer field to tx_buffer Shahar Avidar
2024-04-05  7:39 ` [PATCH v3 2/7] staging: pi433: Rename struct pi433_device instances to pi433 Shahar Avidar
2024-04-05  7:39 ` [PATCH v3 3/7] staging: pi433: Replace pi433_receive param void type to struct pi433_device Shahar Avidar
2024-04-05  7:39 ` Shahar Avidar [this message]
2024-04-05  7:39 ` [PATCH v3 5/7] staging: pi433: Remove duplicated code using the "goto" error recovery scheme Shahar Avidar
2024-04-05 10:05   ` Markus Elfring
2024-04-05 10:09     ` Greg Kroah-Hartman
2024-04-05  7:39 ` [PATCH v3 6/7] staging: pi433: Add debugfs_remove in case of driver register fails Shahar Avidar
2024-04-05 10:42   ` Markus Elfring
2024-04-05 10:50     ` Greg Kroah-Hartman
2024-04-05  7:40 ` [PATCH v3 7/7] staging: pi433: Reorder pi433_exit cleanup calls Shahar Avidar
2024-04-05 10:34 ` [PATCH v3 0/7] staging: pi433: Cleanup & fix potential resource leak Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240405074000.3481217-5-ikobh7@gmail.com \
    --to=ikobh7@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=felixkimbu1@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.