Commit 10a03c36 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

drivers: remove struct module * setting from struct class

There is no need to manually set the owner of a struct class, as the
registering function does it automatically, so remove all of the
explicit settings from various drivers that did so as it is unneeded.

This allows us to remove this pointer entirely from this structure going
forward.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230313181843.1207845-2-gregkh@linuxfoundation.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a46ac9d
......@@ -316,7 +316,6 @@ static void vpe_device_release(struct device *cd)
static struct class vpe_class = {
.name = "vpe",
.owner = THIS_MODULE,
.dev_release = vpe_device_release,
.dev_groups = vpe_groups,
};
......
......@@ -537,7 +537,6 @@ static void devlink_dev_release(struct device *dev)
static struct class devlink_class = {
.name = "devlink",
.owner = THIS_MODULE,
.dev_groups = devlink_groups,
.dev_release = devlink_dev_release,
};
......
......@@ -226,7 +226,6 @@ ATTRIBUTE_GROUPS(devcd_class);
static struct class devcd_class = {
.name = "devcoredump",
.owner = THIS_MODULE,
.dev_release = devcd_dev_release,
.dev_groups = devcd_dev_groups,
.class_groups = devcd_class_groups,
......
......@@ -417,7 +417,6 @@ static int pkt_sysfs_init(void)
if (!class_pktcdvd)
return -ENOMEM;
class_pktcdvd->name = DRIVER_NAME;
class_pktcdvd->owner = THIS_MODULE;
class_pktcdvd->class_release = class_pktcdvd_release;
class_pktcdvd->class_groups = class_pktcdvd_groups;
ret = class_register(class_pktcdvd);
......
......@@ -2481,7 +2481,6 @@ ATTRIBUTE_GROUPS(zram_control_class);
static struct class zram_control_class = {
.name = "zram-control",
.owner = THIS_MODULE,
.class_groups = zram_control_class_groups,
};
......
......@@ -523,8 +523,6 @@ ATTRIBUTE_GROUPS(gpio_class);
static struct class gpio_class = {
.name = "gpio",
.owner = THIS_MODULE,
.class_groups = gpio_class_groups,
};
......
......@@ -138,7 +138,6 @@ static void hwmon_dev_release(struct device *dev)
static struct class hwmon_class = {
.name = "hwmon",
.owner = THIS_MODULE,
.dev_groups = hwmon_dev_attr_groups,
.dev_release = hwmon_dev_release,
};
......
......@@ -159,7 +159,6 @@ static void mISDN_class_release(struct class *cls)
static struct class mISDN_class = {
.name = "mISDN",
.owner = THIS_MODULE,
.dev_uevent = mISDN_uevent,
.dev_groups = mISDN_groups,
.dev_release = mISDN_dev_release,
......
......@@ -3117,7 +3117,6 @@ static struct device_attribute ddb_attrs_fanspeed[] = {
static struct class ddb_class = {
.name = "ddbridge",
.owner = THIS_MODULE,
.devnode = ddb_devnode,
};
......
......@@ -20,7 +20,6 @@
#define DRV_NAME "cros-ec-dev"
static struct class cros_class = {
.owner = THIS_MODULE,
.name = "chromeos",
};
......
......@@ -451,7 +451,6 @@ ATTRIBUTE_GROUPS(enclosure_class);
static struct class enclosure_class = {
.name = "enclosure",
.owner = THIS_MODULE,
.dev_release = enclosure_release,
.dev_groups = enclosure_class_groups,
};
......
......@@ -63,7 +63,6 @@ static SIMPLE_DEV_PM_OPS(mtd_cls_pm_ops, mtd_cls_suspend, mtd_cls_resume);
static struct class mtd_class = {
.name = "mtd",
.owner = THIS_MODULE,
.pm = MTD_CLS_PM_OPS,
};
......
......@@ -111,7 +111,6 @@ ATTRIBUTE_GROUPS(ubi_class);
/* Root UBI "class" object (corresponds to '/<sysfs>/class/ubi/') */
struct class ubi_class = {
.name = UBI_NAME_STR,
.owner = THIS_MODULE,
.class_groups = ubi_class_groups,
};
......
......@@ -45,7 +45,6 @@ struct mux_state {
static struct class mux_class = {
.name = "mux",
.owner = THIS_MODULE,
};
static DEFINE_IDA(mux_ida);
......
......@@ -38,7 +38,6 @@ static const void *ipvtap_net_namespace(const struct device *d)
static struct class ipvtap_class = {
.name = "ipvtap",
.owner = THIS_MODULE,
.ns_type = &net_ns_type_operations,
.namespace = ipvtap_net_namespace,
};
......
......@@ -43,7 +43,6 @@ static const void *macvtap_net_namespace(const struct device *d)
static struct class macvtap_class = {
.name = "macvtap",
.owner = THIS_MODULE,
.ns_type = &net_ns_type_operations,
.namespace = macvtap_net_namespace,
};
......
......@@ -3875,7 +3875,6 @@ static const struct attribute_group *nvme_fc_attr_groups[] = {
static struct class fc_class = {
.name = "fc",
.dev_groups = nvme_fc_attr_groups,
.owner = THIS_MODULE,
};
static int __init nvme_fc_init_module(void)
......
......@@ -58,7 +58,6 @@
#define DRV_NAME EVENT_DEV_NAME
#define EVENT_DEV_NAME_FMT (EVENT_DEV_NAME "%d")
static struct class event_class = {
.owner = THIS_MODULE,
.name = EVENT_CLASS_NAME,
};
......
......@@ -42,7 +42,6 @@
#define DRV_NAME TELEM_DEV_NAME
#define TELEM_DEV_NAME_FMT (TELEM_DEV_NAME "%d")
static struct class telem_class = {
.owner = THIS_MODULE,
.name = TELEM_CLASS_NAME,
};
......
......@@ -155,7 +155,6 @@ ATTRIBUTE_GROUPS(intel_pmt);
static struct class intel_pmt_class = {
.name = "intel_pmt",
.owner = THIS_MODULE,
.dev_groups = intel_pmt_groups,
};
......
......@@ -82,7 +82,6 @@ static DEFINE_MUTEX(ipclock); /* lock used to prevent multiple call to SCU */
static struct class intel_scu_ipc_class = {
.name = "intel_scu_ipc",
.owner = THIS_MODULE,
};
/**
......
......@@ -34,7 +34,6 @@
#define PCI_DEVICE_ID_OROLIA_ARTCARD 0xa000
static struct class timecard_class = {
.owner = THIS_MODULE,
.name = "timecard",
};
......
......@@ -475,7 +475,6 @@ static DEFINE_SIMPLE_DEV_PM_OPS(pwm_class_pm_ops, pwm_class_suspend, pwm_class_r
static struct class pwm_class = {
.name = "pwm",
.owner = THIS_MODULE,
.dev_groups = pwm_chip_groups,
.pm = pm_sleep_ptr(&pwm_class_pm_ops),
};
......
......@@ -223,7 +223,6 @@ static int rio_uevent(const struct device *dev, struct kobj_uevent_env *env)
struct class rio_mport_class = {
.name = "rapidio_port",
.owner = THIS_MODULE,
.dev_groups = rio_mport_groups,
};
EXPORT_SYMBOL_GPL(rio_mport_class);
......
......@@ -587,7 +587,6 @@ ATTRIBUTE_GROUPS(sd_disk);
static struct class sd_disk_class = {
.name = "scsi_disk",
.owner = THIS_MODULE,
.dev_release = scsi_disk_release,
.dev_groups = sd_disk_groups,
};
......
......@@ -126,7 +126,6 @@ static int qcom_rmtfs_mem_release(struct inode *inode, struct file *filp)
}
static struct class rmtfs_class = {
.owner = THIS_MODULE,
.name = "rmtfs",
};
......
......@@ -2776,7 +2776,6 @@ static void spi_controller_release(struct device *dev)
static struct class spi_master_class = {
.name = "spi_master",
.owner = THIS_MODULE,
.dev_release = spi_controller_release,
.dev_groups = spi_master_groups,
};
......@@ -2879,7 +2878,6 @@ static const struct attribute_group *spi_slave_groups[] = {
static struct class spi_slave_class = {
.name = "spi_slave",
.owner = THIS_MODULE,
.dev_release = spi_controller_release,
.dev_groups = spi_slave_groups,
};
......
......@@ -154,7 +154,6 @@ __ATTRIBUTE_GROUPS(fieldbus);
static struct class fieldbus_class = {
.name = "fieldbus_dev",
.owner = THIS_MODULE,
.dev_groups = fieldbus_groups,
};
......
......@@ -100,7 +100,6 @@ struct gb_loopback {
static struct class loopback_class = {
.name = "gb_loopback",
.owner = THIS_MODULE,
};
static DEFINE_IDA(loopback_ida);
......
......@@ -107,7 +107,6 @@ ATTRIBUTE_GROUPS(vibrator);
static struct class vibrator_class = {
.name = "vibrator",
.owner = THIS_MODULE,
.dev_groups = vibrator_groups,
};
......
......@@ -22,7 +22,6 @@ static DEFINE_IDA(typec_index_ida);
struct class typec_class = {
.name = "typec",
.owner = THIS_MODULE,
};
/* ------------------------------------------------------------------------- */
......
......@@ -514,5 +514,4 @@ EXPORT_SYMBOL_GPL(typec_mux_get_drvdata);
struct class typec_mux_class = {
.name = "typec_mux",
.owner = THIS_MODULE,
};
......@@ -15,7 +15,6 @@ static DEFINE_IDA(pd_ida);
static struct class pd_class = {
.name = "usb_power_delivery",
.owner = THIS_MODULE,
};
#define to_pdo(o) container_of(o, struct pdo, dev)
......
......@@ -157,5 +157,4 @@ EXPORT_SYMBOL_GPL(typec_retimer_get_drvdata);
struct class retimer_class = {
.name = "retimer",
.owner = THIS_MODULE,
};
......@@ -1005,7 +1005,6 @@ static struct miscdevice watchdog_miscdev = {
static struct class watchdog_class = {
.name = "watchdog",
.owner = THIS_MODULE,
.dev_groups = wdt_groups,
};
......
......@@ -516,7 +516,6 @@ ATTRIBUTE_GROUPS(ksmbd_control_class);
static struct class ksmbd_control_class = {
.name = "ksmbd-control",
.owner = THIS_MODULE,
.class_groups = ksmbd_control_class_groups,
};
......
......@@ -157,7 +157,6 @@ static const void *wiphy_namespace(const struct device *d)
struct class ieee80211_class = {
.name = "ieee80211",
.owner = THIS_MODULE,
.dev_release = wiphy_dev_release,
.dev_groups = ieee80211_groups,
.pm = WIPHY_PM_OPS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment