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 223d6274f2e5b25c750d87da0b080d573f9a713c..667bc75f6420315cc3933a6533c9fccf6be88304 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 fe74a786e2c3cf019542f7920cdfb0cef76c64c4..57076837b33e9bde5b7c4e3d43d12ac6840118d4 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 1c06781f711484f0a195ead7de754cdcf3bdff25..59aaf2e1375a6903d79b61e87816598287dd4a46 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 2f1a92509271c406f59fd2bb4325737574285be6..642e3377441af02a7f60999ec4bfcf451ffc28c6 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 aa490da3cef233409e2b85db33a7f8c88d3cba29..b7bb52f8dfbdf314a4254e6ae109e8105f920ac2 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 cd27bf173dec8005c29767014fc01dfdcc0ea815..774755052618aa882b6dad1f7778e11edb1bf541 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 33edb5c02f7d79d4e8ff7a75fe7ae03c84a83579..d15ef89e5191651e4e8da490f2ba6f52aac969b4 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 9120be5903258ba8d328287dbf9328f384ad15d3..f5989c9907eed494554fbc5a44c578c7cfae5c02 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 ee8087f29b2c4af379bf4ab60f0103c6f177c8ad..40e6c873c36d2a65e1d1e765ac0307443650d7cb 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 02d4271dfe06bb0f4f111f021e8fbe0b4a189e34..92f4dfccc3cc22e013b3326b19caa6575a1cab49 100644 (file)
@@ -20,7 +20,6 @@
 #define DRV_NAME "cros-ec-dev"
 
 static struct class cros_class = {
-       .owner          = THIS_MODULE,
        .name           = "chromeos",
 };
 
index 4ba966529458a0e9886881bbcf1a6d1144b706f9..76511d279aff8e9cc6e166723d45837ba9b944d7 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 0feacb9fbdac52e25cc174f910ade82c351cab0b..63fca6141973b922e1d70337b21770fa581fc5a7 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 0904eb40c95fa133c1cdc4454beb6d4d3d90fc6a..ae6d35e3da9c00b45b4642e4009d5ca5db1b61d4 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 49bedbe6316c8ad3ef89f6fbd3f950a0d96fdfc3..990e7bc17c85fef3fc0497c4b37b5f13b82be665 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 dde272586e80b5b2b7b0068a782af9cf6d96d8e0..60944a4beadae611b2c2dd012683cb30052d0f6b 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 031344239f27143506998685f2c01162d87b10f4..bddcc127812edfa6de4d8fa50ea693157af1f445 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 456ee42a6133431bbe4637f1d4641268fab10580..2ed75923507dab39e6e1aef5404c8c425bc9261b 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 69ceead8cdaa1c6f243b690b957c35af28fc8d86..a40f60bcefb619cf1c6aebcce39b8e5c59dc8d3e 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 60da7a29f2ff2dd6ee5d18cba69949a00278afd5..54708aa6c70011f6925bd1f6d0b8ac26057c4557 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 46598dcb634aac7e8485d98e5082a47255723248..80292d21a0b4c604f3a06ddbf87380c53e063447 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 e7a3e34028178a61fea9b15c8d7ed71511e7dd63..6851d10d6582525509c2a3f05163abfbeb7a3802 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 4bbaccd543ad6c6f146f50a61b4135e62d842eef..93eba143088330897d0b0a93186b15d18e371ee2 100644 (file)
@@ -34,7 +34,6 @@
 #define PCI_DEVICE_ID_OROLIA_ARTCARD           0xa000
 
 static struct class timecard_class = {
-       .owner          = THIS_MODULE,
        .name           = "timecard",
 };
 
index e7db8e45001cf3347d8f0688805672df338c3746..1a106ec3293929444896e8bdd5dc0063711285a4 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 e60e49769bed806c92cbf4c722b4935b8aef2890..1b3b4c2e015d34f240d3a6fde7a433f03df4a0e3 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 4f28dd617ecadaa5636adde4b892834df7cfb1a1..f98878776204095767318b47247cda41e16b0f94 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 2d3ee22b924943c33d41cc6b11f9a79ed0206512..5c321da7bb9dc33b51d30e45da6c7b32978a9936 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 44b85a8d47f112f795fb0a8a46397daff7999bcf..4b9a17f024c03c16a74aa59538de9cd0afb3a366 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 5f54f2674bd19b11c7f0765ad79010868c281be1..bf1812d8924fa5c5a5b885373da569fd9bc92412 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 1a61fce9805634f216e0887f31f8a9baa277ac08..d7b39f3bb6525f6d0ffe864f34f0b74ee550a569 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 0e2b188e5ca3f590c27cc743a627c1cc49ddb9e9..227e18d92a958a094ae81c8fc3df6414e24f01ae 100644 (file)
@@ -107,7 +107,6 @@ ATTRIBUTE_GROUPS(vibrator);
 
 static struct class vibrator_class = {
        .name           = "vibrator",
-       .owner          = THIS_MODULE,
        .dev_groups     = vibrator_groups,
 };
 
index cc3182f706730430c4aebf3601043692d18e3b0b..349cc2030c903792f28466e156128e5424060397 100644 (file)
@@ -22,7 +22,6 @@ static DEFINE_IDA(typec_index_ida);
 
 struct class typec_class = {
        .name = "typec",
-       .owner = THIS_MODULE,
 };
 
 /* ------------------------------------------------------------------------- */
index c7177ddd4f127c9149e290005989731eff9910db..d9eaf9a0b0bfd7b960f6936b11632ad770b37a0e 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 59c537a5e6000715191031535ca29ab7ecab479d..0bcde1ff4d39b9a212f061448035e53819924fcb 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 0481e82f6bbc8ed9d89d50d6404d62c40d091b96..4a7d1b5c4d866b13ffcc97a0cd4b2eb63207d0c2 100644 (file)
@@ -157,5 +157,4 @@ EXPORT_SYMBOL_GPL(typec_retimer_get_drvdata);
 
 struct class retimer_class = {
        .name = "retimer",
-       .owner = THIS_MODULE,
 };
index 0122e8796879752bfa18c6039fe84f698529534a..12a6f020b6b595d118d60b4fa02b5933a4b90374 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 394b6ceac4312685ebbd57a6087de345b0c4111b..b5af3e43e6770eaf8ce60c44edabc061c27d84f6 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 cdb638647e0b655fbf27fee45c1a531593972408..268f670835e952227f00fa09bdc0df49260a9f40 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,