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>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Subject: [PATCH 3/7] driver core: class: remove subsystem private pointer from struct class
Date: Fri, 31 Mar 2023 11:33:14 +0200	[thread overview]
Message-ID: <20230331093318.82288-3-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20230331093318.82288-1-gregkh@linuxfoundation.org>

Now that the last users of the subsystem private pointer in struct class
are gone, the pointer can be removed, as no one is using it.  One step
closer to allowing struct class to be const and moved into read-only
memory.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/class.c         | 4 ----
 include/linux/device/class.h | 2 --
 2 files changed, 6 deletions(-)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index a8a1bf976290..fcfb295363cc 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -97,8 +97,6 @@ static void class_release(struct kobject *kobj)
 
 	pr_debug("class '%s': release.\n", class->name);
 
-	class->p = NULL;
-
 	if (class->class_release)
 		class->class_release(class);
 	else
@@ -206,7 +204,6 @@ int class_register(struct class *cls)
 	cp->subsys.kobj.kset = class_kset;
 	cp->subsys.kobj.ktype = &class_ktype;
 	cp->class = cls;
-	cls->p = cp;
 
 	error = kset_register(&cp->subsys);
 	if (error)
@@ -222,7 +219,6 @@ int class_register(struct class *cls)
 
 err_out:
 	kfree(cp);
-	cls->p = NULL;
 	return error;
 }
 EXPORT_SYMBOL_GPL(class_register);
diff --git a/include/linux/device/class.h b/include/linux/device/class.h
index 9cb5db0588c8..f7aad64e256a 100644
--- a/include/linux/device/class.h
+++ b/include/linux/device/class.h
@@ -71,8 +71,6 @@ struct class {
 	void (*get_ownership)(const struct device *dev, kuid_t *uid, kgid_t *gid);
 
 	const struct dev_pm_ops *pm;
-
-	struct subsys_private *p;
 };
 
 struct class_dev_iter {
-- 
2.40.0


  parent reply	other threads:[~2023-03-31  9:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  9:33 [PATCH 1/7] driver core: core: move to use class_to_subsys() Greg Kroah-Hartman
2023-03-31  9:33 ` [PATCH 2/7] driver core: create class_is_registered() Greg Kroah-Hartman
2023-03-31 10:16   ` Rafael J. Wysocki
2023-03-31 12:44   ` Linus Walleij
2023-03-31  9:33 ` Greg Kroah-Hartman [this message]
2023-03-31 14:48   ` [PATCH 3/7] driver core: class: remove subsystem private pointer from struct class Rafael J. Wysocki
2023-03-31  9:33 ` [PATCH 4/7] driver core: clean up the logic to determine which /sys/dev/ directory to use Greg Kroah-Hartman
2023-03-31 14:49   ` Rafael J. Wysocki
2023-03-31  9:33 ` [PATCH 5/7] driver core: class: remove dev_kobj from struct class Greg Kroah-Hartman
2023-03-31 14:50   ` Rafael J. Wysocki
2023-03-31  9:33 ` [PATCH 6/7] driver core: make sysfs_dev_block_kobj static Greg Kroah-Hartman
2023-03-31 14:50   ` Rafael J. Wysocki
2023-03-31  9:33 ` [PATCH 7/7] driver core: make sysfs_dev_char_kobj static Greg Kroah-Hartman
2023-03-31 14:50   ` Rafael J. Wysocki
2023-03-31 10:26 ` [PATCH 1/7] driver core: core: move to use class_to_subsys() Rafael J. Wysocki
2023-03-31 15:44   ` Greg Kroah-Hartman

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=20230331093318.82288-3-gregkh@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@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