mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ricardo B. Marliere" <ricardo@marliere.net>
To: Lee Jones <lee@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 "Ricardo B. Marliere" <ricardo@marliere.net>
Subject: [PATCH] mfd: core: constify the struct device_type usage
Date: Mon, 19 Feb 2024 16:51:10 -0300	[thread overview]
Message-ID: <20240219-device_cleanup-mfd-v1-1-e4eef5ed2da8@marliere.net> (raw)

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the mfd_dev_type
variable to be a constant structure as well, placing it into read-only
memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 2b85509a90fc..6ad5c93027af 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -29,7 +29,7 @@ struct mfd_of_node_entry {
 	struct device_node *np;
 };
 
-static struct device_type mfd_dev_type = {
+static const struct device_type mfd_dev_type = {
 	.name	= "mfd_device",
 };
 

---
base-commit: d5132d176d6f21742ac67fd311ccc61fe830e999
change-id: 20240219-device_cleanup-mfd-885cbab2befe

Best regards,
-- 
Ricardo B. Marliere <ricardo@marliere.net>


             reply	other threads:[~2024-02-19 19:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 19:51 Ricardo B. Marliere [this message]
2024-02-23 16:27 ` (subset) " Lee Jones

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=20240219-device_cleanup-mfd-v1-1-e4eef5ed2da8@marliere.net \
    --to=ricardo@marliere.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®