public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	devicetree@vger.kernel.org
Subject: [PATCH 5/5] driver core: pass a const * into of_device_uevent()
Date: Mon, 21 Nov 2022 10:46:49 +0100	[thread overview]
Message-ID: <20221121094649.1556002-5-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20221121094649.1556002-1-gregkh@linuxfoundation.org>

of_device_uevent() does not modify the struct device * passed into it,
so make it a const * to enforce this.  Also the documentation for the
function was really wrong so fix that up at the same time.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/of/device.c       | 6 +++---
 include/linux/of_device.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/of/device.c b/drivers/of/device.c
index 8cefe5a7d04e..c674a13c3055 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -332,10 +332,10 @@ EXPORT_SYMBOL_GPL(of_device_modalias);
 
 /**
  * of_device_uevent - Display OF related uevent information
- * @dev:	Device to apply DMA configuration
- * @env:	Kernel object's userspace event reference
+ * @dev:	Device to display the uevent information for
+ * @env:	Kernel object's userspace event reference to fill up
  */
-void of_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+void of_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
 	const char *compat, *type;
 	struct alias_prop *app;
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 1a803e4335d3..ab7d557d541d 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -35,7 +35,7 @@ extern const void *of_device_get_match_data(const struct device *dev);
 extern ssize_t of_device_modalias(struct device *dev, char *str, ssize_t len);
 extern int of_device_request_module(struct device *dev);
 
-extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
+extern void of_device_uevent(const struct device *dev, struct kobj_uevent_env *env);
 extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env);
 
 static inline struct device_node *of_cpu_device_node_get(int cpu)
@@ -64,7 +64,7 @@ static inline int of_driver_match_device(struct device *dev,
 	return 0;
 }
 
-static inline void of_device_uevent(struct device *dev,
+static inline void of_device_uevent(const struct device *dev,
 			struct kobj_uevent_env *env) { }
 
 static inline const void *of_device_get_match_data(const struct device *dev)
-- 
2.38.1


  parent reply	other threads:[~2022-11-21  9:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  9:46 [PATCH 1/5] kobject: make kobject_get_ownership() take a constant kobject * Greg Kroah-Hartman
2022-11-21  9:46 ` [PATCH 2/5] kobject: make kobject_namespace take a const * Greg Kroah-Hartman
2022-11-21 11:49   ` Rafael J. Wysocki
2022-11-21  9:46 ` [PATCH 3/5] kobject: kset_uevent_ops: make filter() callback " Greg Kroah-Hartman
2022-11-21  9:51   ` [Linaro-mm-sig] " Christian König
2022-11-21 11:49   ` Rafael J. Wysocki
2022-11-21  9:46 ` [PATCH 4/5] kobject: kset_uevent_ops: make name() " Greg Kroah-Hartman
2022-11-21 11:50   ` Rafael J. Wysocki
2022-11-21  9:46 ` Greg Kroah-Hartman [this message]
2022-11-22 21:22   ` [PATCH 5/5] driver core: pass a const * into of_device_uevent() Rob Herring
2022-11-23  9:57     ` Greg Kroah-Hartman
2022-11-21 10:53 ` [PATCH 1/5] kobject: make kobject_get_ownership() take a constant kobject * Nikolay Aleksandrov
2022-11-21 11:48 ` Rafael J. Wysocki
2022-11-21 20:18 ` Jakub Kicinski

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=20221121094649.1556002-5-gregkh@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox