Commit 6b0d49be authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

driver core: class: mark the struct class in struct class_interface constant



The struct class pointer in struct class_interface is never modified, so
mark it as const so that no one accidentally tries to modify it in the
future.

Acked-by: default avatarRafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/2023040249-handball-gruffly-5da7@gregkh


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 43a7206b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -498,7 +498,7 @@ EXPORT_SYMBOL_GPL(class_interface_register);
void class_interface_unregister(struct class_interface *class_intf)
{
	struct subsys_private *sp;
	struct class *parent = class_intf->class;
	const struct class *parent = class_intf->class;
	struct class_dev_iter iter;
	struct device *dev;

+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ ssize_t show_class_attr_string(const struct class *class, const struct class_att

struct class_interface {
	struct list_head	node;
	struct class		*class;
	const struct class	*class;

	int (*add_dev)		(struct device *, struct class_interface *);
	void (*remove_dev)	(struct device *, struct class_interface *);