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

kobject: remove kset from struct kset_uevent_ops callbacks



There is no need to pass the pointer to the kset in the struct
kset_uevent_ops callbacks as no one uses it, so just remove that pointer
entirely.

Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarWedson Almeida Filho <wedsonaf@google.com>
Link: https://lore.kernel.org/r/20211227163924.3970661-1-gregkh@linuxfoundation.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ee6d3dd4
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -373,10 +373,9 @@ If a kset wishes to control the uevent operations of the kobjects
associated with it, it can use the struct kset_uevent_ops to handle it::

  struct kset_uevent_ops {
          int (* const filter)(struct kset *kset, struct kobject *kobj);
          const char *(* const name)(struct kset *kset, struct kobject *kobj);
          int (* const uevent)(struct kset *kset, struct kobject *kobj,
                        struct kobj_uevent_env *env);
          int (* const filter)(struct kobject *kobj);
          const char *(* const name)(struct kobject *kobj);
          int (* const uevent)(struct kobject *kobj, struct kobj_uevent_env *env);
  };


+3 −4
Original line number Diff line number Diff line
@@ -325,10 +325,9 @@ ksets
结构体kset_uevent_ops来处理它::

  struct kset_uevent_ops {
          int (* const filter)(struct kset *kset, struct kobject *kobj);
          const char *(* const name)(struct kset *kset, struct kobject *kobj);
          int (* const uevent)(struct kset *kset, struct kobject *kobj,
                        struct kobj_uevent_env *env);
          int (* const filter)(struct kobject *kobj);
          const char *(* const name)(struct kobject *kobj);
          int (* const uevent)(struct kobject *kobj, struct kobj_uevent_env *env);
  };


+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ static struct kobj_type bus_ktype = {
	.release	= bus_release,
};

static int bus_uevent_filter(struct kset *kset, struct kobject *kobj)
static int bus_uevent_filter(struct kobject *kobj)
{
	const struct kobj_type *ktype = get_ktype(kobj);

+5 −6
Original line number Diff line number Diff line
@@ -2261,7 +2261,7 @@ static struct kobj_type device_ktype = {
};


static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)
static int dev_uevent_filter(struct kobject *kobj)
{
	const struct kobj_type *ktype = get_ktype(kobj);

@@ -2275,7 +2275,7 @@ static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)
	return 0;
}

static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj)
static const char *dev_uevent_name(struct kobject *kobj)
{
	struct device *dev = kobj_to_dev(kobj);

@@ -2286,8 +2286,7 @@ static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj)
	return NULL;
}

static int dev_uevent(struct kset *kset, struct kobject *kobj,
		      struct kobj_uevent_env *env)
static int dev_uevent(struct kobject *kobj, struct kobj_uevent_env *env)
{
	struct device *dev = kobj_to_dev(kobj);
	int retval = 0;
@@ -2382,7 +2381,7 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr,

	/* respect filter */
	if (kset->uevent_ops && kset->uevent_ops->filter)
		if (!kset->uevent_ops->filter(kset, &dev->kobj))
		if (!kset->uevent_ops->filter(&dev->kobj))
			goto out;

	env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL);
@@ -2390,7 +2389,7 @@ static ssize_t uevent_show(struct device *dev, struct device_attribute *attr,
		return -ENOMEM;

	/* let the kset specific function add its keys */
	retval = kset->uevent_ops->uevent(kset, &dev->kobj, env);
	retval = kset->uevent_ops->uevent(&dev->kobj, env);
	if (retval)
		goto out;

+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ void dma_buf_stats_teardown(struct dma_buf *dmabuf)


/* Statistics files do not need to send uevents. */
static int dmabuf_sysfs_uevent_filter(struct kset *kset, struct kobject *kobj)
static int dmabuf_sysfs_uevent_filter(struct kobject *kobj)
{
	return 0;
}
Loading