drivers: remove struct module * setting from struct class
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Mar 2023 18:18:33 +0000 (19:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 14:16:27 +0000 (15:16 +0100)
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.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
37 files changed:
arch/mips/kernel/vpe-mt.c
drivers/base/core.c
drivers/base/devcoredump.c
drivers/block/pktcdvd.c
drivers/block/zram/zram_drv.c
drivers/gpio/gpiolib-sysfs.c
drivers/hwmon/hwmon.c
drivers/isdn/mISDN/core.c
drivers/media/pci/ddbridge/ddbridge-core.c
drivers/mfd/cros_ec_dev.c
drivers/misc/enclosure.c
drivers/mtd/mtdcore.c
drivers/mtd/ubi/build.c
drivers/mux/core.c
drivers/net/ipvlan/ipvtap.c
drivers/net/macvtap.c
drivers/nvme/host/fc.c
drivers/platform/chrome/wilco_ec/event.c
drivers/platform/chrome/wilco_ec/telemetry.c
drivers/platform/x86/intel/pmt/class.c
drivers/platform/x86/intel_scu_ipc.c
drivers/ptp/ptp_ocp.c
drivers/pwm/sysfs.c
drivers/rapidio/rio-driver.c
drivers/scsi/sd.c
drivers/soc/qcom/rmtfs_mem.c
drivers/spi/spi.c
drivers/staging/fieldbus/dev_core.c
drivers/staging/greybus/loopback.c
drivers/staging/greybus/vibrator.c
drivers/usb/typec/class.c
drivers/usb/typec/mux.c
drivers/usb/typec/pd.c
drivers/usb/typec/retimer.c
drivers/watchdog/watchdog_dev.c
fs/ksmbd/server.c
net/wireless/sysfs.c

index 223d627..667bc75 100644 (file)
@@ -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,
 };
index fe74a78..5707683 100644 (file)
@@ -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,
 };
index 1c06781..59aaf2e 100644 (file)
@@ -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,
index 2f1a925..642e337 100644 (file)
@@ -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);
index aa490da..b7bb52f 100644 (file)
@@ -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,
 };
 
index cd27bf1..7747550 100644 (file)
@@ -523,8 +523,6 @@ ATTRIBUTE_GROUPS(gpio_class);
 
 static struct class gpio_class = {
        .name =         "gpio",
-       .owner =        THIS_MODULE,
-
        .class_groups = gpio_class_groups,
 };
 
index 33edb5c..d15ef89 100644 (file)
@@ -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,
 };
index 9120be5..f5989c9 100644 (file)
@@ -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,
index ee8087f..40e6c87 100644 (file)
@@ -3117,7 +3117,6 @@ static struct device_attribute ddb_attrs_fanspeed[] = {
 
 static struct class ddb_class = {
        .name           = "ddbridge",
-       .owner          = THIS_MODULE,
        .devnode        = ddb_devnode,
 };
 
index 02d4271..92f4dfc 100644 (file)
@@ -20,7 +20,6 @@
 #define DRV_NAME "cros-ec-dev"
 
 static struct class cros_class = {
-       .owner          = THIS_MODULE,
        .name           = "chromeos",
 };
 
index 4ba9665..76511d2 100644 (file)
@@ -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,
 };
index 0feacb9..63fca61 100644 (file)
@@ -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,
 };
 
index 0904eb4..ae6d35e 100644 (file)
@@ -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,
 };
 
index 49bedbe..990e7bc 100644 (file)
@@ -45,7 +45,6 @@ struct mux_state {
 
 static struct class mux_class = {
        .name = "mux",
-       .owner = THIS_MODULE,
 };
 
 static DEFINE_IDA(mux_ida);
index dde2725..60944a4 100644 (file)
@@ -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,
 };
index 0313442..bddcc12 100644 (file)
@@ -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,
 };
index 456ee42..2ed7592 100644 (file)
@@ -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)
index 69ceead..a40f60b 100644 (file)
@@ -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,
 };
 
index 60da7a2..54708aa 100644 (file)
@@ -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,
 };
 
index 46598dc..80292d2 100644 (file)
@@ -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,
 };
 
index e7a3e34..6851d10 100644 (file)
@@ -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,
 };
 
 /**
index 4bbaccd..93eba14 100644 (file)
@@ -34,7 +34,6 @@
 #define PCI_DEVICE_ID_OROLIA_ARTCARD           0xa000
 
 static struct class timecard_class = {
-       .owner          = THIS_MODULE,
        .name           = "timecard",
 };
 
index e7db8e4..1a106ec 100644 (file)
@@ -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),
 };
index e60e497..1b3b4c2 100644 (file)
@@ -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);
index 4f28dd6..f988787 100644 (file)
@@ -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,
 };
index 2d3ee22..5c321da 100644 (file)
@@ -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",
 };
 
index 44b85a8..4b9a17f 100644 (file)
@@ -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,
 };
index 5f54f26..bf1812d 100644 (file)
@@ -154,7 +154,6 @@ __ATTRIBUTE_GROUPS(fieldbus);
 
 static struct class fieldbus_class = {
        .name =         "fieldbus_dev",
-       .owner =        THIS_MODULE,
        .dev_groups =   fieldbus_groups,
 };
 
index 1a61fce..d7b39f3 100644 (file)
@@ -100,7 +100,6 @@ struct gb_loopback {
 
 static struct class loopback_class = {
        .name           = "gb_loopback",
-       .owner          = THIS_MODULE,
 };
 static DEFINE_IDA(loopback_ida);
 
index 0e2b188..227e18d 100644 (file)
@@ -107,7 +107,6 @@ ATTRIBUTE_GROUPS(vibrator);
 
 static struct class vibrator_class = {
        .name           = "vibrator",
-       .owner          = THIS_MODULE,
        .dev_groups     = vibrator_groups,
 };
 
index cc3182f..349cc20 100644 (file)
@@ -22,7 +22,6 @@ static DEFINE_IDA(typec_index_ida);
 
 struct class typec_class = {
        .name = "typec",
-       .owner = THIS_MODULE,
 };
 
 /* ------------------------------------------------------------------------- */
index c7177dd..d9eaf9a 100644 (file)
@@ -514,5 +514,4 @@ EXPORT_SYMBOL_GPL(typec_mux_get_drvdata);
 
 struct class typec_mux_class = {
        .name = "typec_mux",
-       .owner = THIS_MODULE,
 };
index 59c537a..0bcde1f 100644 (file)
@@ -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)
index 0481e82..4a7d1b5 100644 (file)
@@ -157,5 +157,4 @@ EXPORT_SYMBOL_GPL(typec_retimer_get_drvdata);
 
 struct class retimer_class = {
        .name = "retimer",
-       .owner = THIS_MODULE,
 };
index 0122e87..12a6f02 100644 (file)
@@ -1005,7 +1005,6 @@ static struct miscdevice watchdog_miscdev = {
 
 static struct class watchdog_class = {
        .name =         "watchdog",
-       .owner =        THIS_MODULE,
        .dev_groups =   wdt_groups,
 };
 
index 394b6ce..b5af3e4 100644 (file)
@@ -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,
 };
 
index cdb6386..268f670 100644 (file)
@@ -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,