driver core: make struct bus_type.uevent() take a const *
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Jan 2023 11:30:17 +0000 (12:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jan 2023 12:45:52 +0000 (13:45 +0100)
The uevent() callback in struct bus_type should not be modifying the
device that is passed into it, so mark it as a const * and propagate the
function signature changes out into all relevant subsystems that use
this callback.

Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230111113018.459199-16-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
81 files changed:
arch/mips/sgi-ip22/ip22-gio.c
arch/parisc/kernel/drivers.c
arch/powerpc/platforms/pseries/vio.c
arch/sparc/kernel/vio.c
drivers/acpi/bus.c
drivers/amba/bus.c
drivers/base/auxiliary.c
drivers/base/cpu.c
drivers/base/platform.c
drivers/bcma/main.c
drivers/bus/fsl-mc/fsl-mc-bus.c
drivers/bus/mhi/ep/main.c
drivers/bus/mhi/host/init.c
drivers/bus/mips_cdmm.c
drivers/bus/sunxi-rsb.c
drivers/cxl/core/memdev.c
drivers/cxl/core/port.c
drivers/cxl/cxl.h
drivers/cxl/cxlmem.h
drivers/dax/bus.c
drivers/eisa/eisa-bus.c
drivers/firmware/arm_ffa/bus.c
drivers/fpga/dfl.c
drivers/gpu/drm/drm_mipi_dsi.c
drivers/gpu/host1x/bus.c
drivers/greybus/core.c
drivers/hid/hid-core.c
drivers/hid/intel-ish-hid/ishtp/bus.c
drivers/hsi/hsi_core.c
drivers/hv/vmbus_drv.c
drivers/input/serio/serio.c
drivers/ipack/ipack.c
drivers/macintosh/macio_asic.c
drivers/mcb/mcb-core.c
drivers/memstick/core/memstick.c
drivers/misc/mei/bus.c
drivers/misc/tifm_core.c
drivers/mmc/core/bus.c
drivers/mmc/core/sdio_bus.c
drivers/net/phy/mdio_bus.c
drivers/net/xen-netback/xenbus.c
drivers/nvdimm/bus.c
drivers/nvdimm/dax_devs.c
drivers/nvdimm/dimm_devs.c
drivers/nvdimm/nd-core.h
drivers/nvdimm/nd.h
drivers/nvdimm/region_devs.c
drivers/pci/pci-driver.c
drivers/pcmcia/ds.c
drivers/platform/x86/wmi.c
drivers/rapidio/rio-driver.c
drivers/rpmsg/rpmsg_core.c
drivers/s390/cio/css.c
drivers/s390/cio/device.c
drivers/s390/cio/scm.c
drivers/s390/crypto/ap_bus.c
drivers/scsi/scsi_sysfs.c
drivers/slimbus/core.c
drivers/soc/qcom/apr.c
drivers/spi/spi.c
drivers/spmi/spmi.c
drivers/ssb/main.c
drivers/staging/greybus/gbphy.c
drivers/tee/tee_core.c
drivers/usb/common/ulpi.c
drivers/usb/core/driver.c
drivers/usb/typec/bus.c
drivers/virtio/virtio.c
drivers/w1/w1.c
drivers/xen/pvcalls-back.c
drivers/xen/xenbus/xenbus_probe_backend.c
drivers/xen/xenbus/xenbus_probe_frontend.c
drivers/zorro/zorro-driver.c
include/linux/device/bus.h
include/linux/spi/spi.h
include/linux/ssb/ssb.h
include/sound/hdaudio.h
include/xen/xenbus.h
sound/aoa/soundbus/core.c
sound/hda/hda_bus_type.c
sound/hda/hdac_device.c

index 8686e8c1c4e5ed159ac64d730415ba6caec83a27..81c9f0a8880b0e5ff5fbc605dd3eef9886f2e51e 100644 (file)
@@ -199,9 +199,9 @@ static struct attribute *gio_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(gio_dev);
 
-static int gio_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int gio_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct gio_device *gio_dev = to_gio_device(dev);
+       const struct gio_device *gio_dev = to_gio_device(dev);
 
        add_uevent_var(env, "MODALIAS=gio:%x", gio_dev->id.id);
        return 0;
index e7ee0c0c91d3558dff03df65910510bda71a2c58..28f47285d448c0ab5f8cb640d2ca4ebdc451eb0f 100644 (file)
@@ -552,7 +552,7 @@ static int parisc_generic_match(struct device *dev, struct device_driver *drv)
        return match_device(to_parisc_driver(drv), to_parisc_device(dev));
 }
 
-static ssize_t make_modalias(struct device *dev, char *buf)
+static ssize_t make_modalias(const struct device *dev, char *buf)
 {
        const struct parisc_device *padev = to_parisc_device(dev);
        const struct parisc_device_id *id = &padev->id;
@@ -562,7 +562,7 @@ static ssize_t make_modalias(struct device *dev, char *buf)
                (u32)id->sversion);
 }
 
-static int parisc_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int parisc_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        const struct parisc_device *padev;
        char modalias[40];
index 00ecac2c205b0d38f858601a6765765463fc141a..770df9351aaa98afaa6c333ae8a869cb84ffcf8b 100644 (file)
@@ -1609,10 +1609,10 @@ static int vio_bus_match(struct device *dev, struct device_driver *drv)
        return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL);
 }
 
-static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
+static int vio_hotplug(const struct device *dev, struct kobj_uevent_env *env)
 {
        const struct vio_dev *vio_dev = to_vio_dev(dev);
-       struct device_node *dn;
+       const struct device_node *dn;
        const char *cp;
 
        dn = dev->of_node;
index 01122a208f9475c2a0936e194c55bcd95483d62e..b78df3a15a72ed48e89bf39eff6aa77c19b60ef2 100644 (file)
@@ -46,7 +46,7 @@ static const struct vio_device_id *vio_match_device(
        return NULL;
 }
 
-static int vio_hotplug(struct device *dev, struct kobj_uevent_env *env)
+static int vio_hotplug(const struct device *dev, struct kobj_uevent_env *env)
 {
        const struct vio_dev *vio_dev = to_vio_dev(dev);
 
index 0c05ccde1f7a6cb1bcb8d1db7669b58b59fd6bc3..9531dd0fef5099715a594be4fa4e30f826ad1f8c 100644 (file)
@@ -1014,7 +1014,7 @@ static int acpi_bus_match(struct device *dev, struct device_driver *drv)
                && !acpi_match_device_ids(acpi_dev, acpi_drv->ids);
 }
 
-static int acpi_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int acpi_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        return __acpi_device_uevent_modalias(to_acpi_device(dev), env);
 }
index ff7454a380586336df289c18279be8060743e40c..ce88af9eb562fb82bf6406003c2e34bf2d1bd651 100644 (file)
@@ -235,9 +235,9 @@ static int amba_match(struct device *dev, struct device_driver *drv)
        return amba_lookup(pcdrv->id_table, pcdev) != NULL;
 }
 
-static int amba_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int amba_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct amba_device *pcdev = to_amba_device(dev);
+       const struct amba_device *pcdev = to_amba_device(dev);
        int retval = 0;
 
        retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid);
index 8c5e659306177ff4c3458a403493b64e188d8a35..4d4c2c8d26c4808aa61c13ef2c3357e2bebf8564 100644 (file)
@@ -185,7 +185,7 @@ static int auxiliary_match(struct device *dev, struct device_driver *drv)
        return !!auxiliary_match_id(auxdrv->id_table, auxdev);
 }
 
-static int auxiliary_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int auxiliary_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        const char *name, *p;
 
index 4c98849577d4ed262292db4ae29d21465e2944fc..441eb5bdec7d89da35956919a3d0885bb59adea1 100644 (file)
@@ -336,7 +336,7 @@ static ssize_t print_cpu_modalias(struct device *dev,
        return len;
 }
 
-static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int cpu_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        char *buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (buf) {
index b10a130cd433419e2d60b418db9a346db3e3e68c..262555b83beda3c46cb9f6e4080e304074cbb7cd 100644 (file)
@@ -1353,9 +1353,9 @@ static int platform_match(struct device *dev, struct device_driver *drv)
        return (strcmp(pdev->name, drv->name) == 0);
 }
 
-static int platform_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int platform_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct platform_device  *pdev = to_platform_device(dev);
+       const struct platform_device *pdev = to_platform_device(dev);
        int rc;
 
        /* Some devices have extra OF data and an OF-style MODALIAS */
index 0a8469e0b13adf56d6dc1a24df0635c04ebf4c27..7b39f010bbb371ee0794cab992883bb5e13082eb 100644 (file)
@@ -28,7 +28,7 @@ static DEFINE_MUTEX(bcma_buses_mutex);
 static int bcma_bus_match(struct device *dev, struct device_driver *drv);
 static int bcma_device_probe(struct device *dev);
 static void bcma_device_remove(struct device *dev);
-static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env);
+static int bcma_device_uevent(const struct device *dev, struct kobj_uevent_env *env);
 
 static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
@@ -627,9 +627,9 @@ static void bcma_device_remove(struct device *dev)
        put_device(dev);
 }
 
-static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int bcma_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct bcma_device *core = container_of(dev, struct bcma_device, dev);
+       const struct bcma_device *core = container_of_const(dev, struct bcma_device, dev);
 
        return add_uevent_var(env,
                              "MODALIAS=bcma:m%04Xid%04Xrev%02Xcl%02X",
index 774f307844b4e90af36e480f6472eb9745922099..36cb091a33b464e23ccd4b6130466127106caea1 100644 (file)
@@ -124,9 +124,9 @@ out:
 /*
  * fsl_mc_bus_uevent - callback invoked when a device is added
  */
-static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int fsl_mc_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
+       const struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
 
        if (add_uevent_var(env, "MODALIAS=fsl-mc:v%08Xd%s",
                           mc_dev->obj_desc.vendor,
index 1dc8a3557a46494f7d5e45509fc1be03abe52209..4819369faa8be19f4fc6b602f1212402d7f6c657 100644 (file)
@@ -1543,9 +1543,9 @@ void mhi_ep_driver_unregister(struct mhi_ep_driver *mhi_drv)
 }
 EXPORT_SYMBOL_GPL(mhi_ep_driver_unregister);
 
-static int mhi_ep_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int mhi_ep_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev);
+       const struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev);
 
        return add_uevent_var(env, "MODALIAS=" MHI_EP_DEVICE_MODALIAS_FMT,
                                        mhi_dev->name);
index bf672de3513155ad533655b04b5dae82d39ad20d..770fc81b7e960720d3641d664e62a78a569b9e10 100644 (file)
@@ -1395,9 +1395,9 @@ void mhi_driver_unregister(struct mhi_driver *mhi_drv)
 }
 EXPORT_SYMBOL_GPL(mhi_driver_unregister);
 
-static int mhi_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int mhi_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct mhi_device *mhi_dev = to_mhi_device(dev);
+       const struct mhi_device *mhi_dev = to_mhi_device(dev);
 
        return add_uevent_var(env, "MODALIAS=" MHI_DEVICE_MODALIAS_FMT,
                                        mhi_dev->name);
index fca0d0669aa97e78168b20aa503a60fa9cdf72d1..554e1992edd44ca0a41587d20bd7e02945da0a8f 100644 (file)
@@ -67,9 +67,9 @@ static int mips_cdmm_match(struct device *dev, struct device_driver *drv)
        return mips_cdmm_lookup(cdrv->id_table, cdev) != NULL;
 }
 
-static int mips_cdmm_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int mips_cdmm_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct mips_cdmm_device *cdev = to_mips_cdmm_device(dev);
+       const struct mips_cdmm_device *cdev = to_mips_cdmm_device(dev);
        int retval = 0;
 
        retval = add_uevent_var(env, "CDMM_CPU=%u", cdev->cpu);
index a180af11e03432f4f79718f4b323207327496f88..9aa99c369e48bc3269c542ff4ca52bebf5ae266c 100644 (file)
@@ -172,7 +172,7 @@ static void sunxi_rsb_device_remove(struct device *dev)
        drv->remove(to_sunxi_rsb_device(dev));
 }
 
-static int sunxi_rsb_device_modalias(struct device *dev, struct kobj_uevent_env *env)
+static int sunxi_rsb_device_modalias(const struct device *dev, struct kobj_uevent_env *env)
 {
        return of_device_uevent_modalias(dev, env);
 }
index a38a0cc20d477bbcab28f1c6991b9efed1e6ddef..b75dd77df7cef7cedcd6e58b433c62c5a36a0119 100644 (file)
@@ -162,7 +162,7 @@ static const struct device_type cxl_memdev_type = {
        .groups = cxl_memdev_attribute_groups,
 };
 
-bool is_cxl_memdev(struct device *dev)
+bool is_cxl_memdev(const struct device *dev)
 {
        return dev->type == &cxl_memdev_type;
 }
index b631a052045619d9301592da117caf142be71a63..3f02dc135a1200a38efa2c5db38df74f016ce48a 100644 (file)
@@ -38,7 +38,7 @@ static ssize_t devtype_show(struct device *dev, struct device_attribute *attr,
 }
 static DEVICE_ATTR_RO(devtype);
 
-static int cxl_device_id(struct device *dev)
+static int cxl_device_id(const struct device *dev)
 {
        if (dev->type == &cxl_nvdimm_bridge_type)
                return CXL_DEVICE_NVDIMM_BRIDGE;
@@ -523,13 +523,13 @@ static const struct device_type cxl_port_type = {
        .groups = cxl_port_attribute_groups,
 };
 
-bool is_cxl_port(struct device *dev)
+bool is_cxl_port(const struct device *dev)
 {
        return dev->type == &cxl_port_type;
 }
 EXPORT_SYMBOL_NS_GPL(is_cxl_port, CXL);
 
-struct cxl_port *to_cxl_port(struct device *dev)
+struct cxl_port *to_cxl_port(const struct device *dev)
 {
        if (dev_WARN_ONCE(dev, dev->type != &cxl_port_type,
                          "not a cxl_port device\n"))
@@ -1826,7 +1826,7 @@ void cxl_driver_unregister(struct cxl_driver *cxl_drv)
 }
 EXPORT_SYMBOL_NS_GPL(cxl_driver_unregister, CXL);
 
-static int cxl_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int cxl_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        return add_uevent_var(env, "MODALIAS=" CXL_MODALIAS_FMT,
                              cxl_device_id(dev));
index 1b1cf459ac779a20578f2a0b4f85861f7ad44e4b..c9e1b48a1a538252423dfc0060ef04ee224bd7c9 100644 (file)
@@ -588,8 +588,8 @@ static inline bool is_cxl_root(struct cxl_port *port)
        return port->uport == port->dev.parent;
 }
 
-bool is_cxl_port(struct device *dev);
-struct cxl_port *to_cxl_port(struct device *dev);
+bool is_cxl_port(const struct device *dev);
+struct cxl_port *to_cxl_port(const struct device *dev);
 struct pci_bus;
 int devm_cxl_register_pci_bus(struct device *host, struct device *uport,
                              struct pci_bus *bus);
index ab138004f644820e94c0b7d950e8c9d004288ddc..6749f2afb1b7c7e35472f13feefefa57586b6add 100644 (file)
@@ -72,7 +72,7 @@ cxled_to_memdev(struct cxl_endpoint_decoder *cxled)
        return to_cxl_memdev(port->uport);
 }
 
-bool is_cxl_memdev(struct device *dev);
+bool is_cxl_memdev(const struct device *dev);
 static inline bool is_cxl_endpoint(struct cxl_port *port)
 {
        return is_cxl_memdev(port->uport);
index 1dad813ee4a6907b2370ea2e6e861b3cbd9b6a85..e3a384182fe77f70e40e7d3d91ce6a8351a107e3 100644 (file)
@@ -18,7 +18,7 @@ struct dax_id {
        char dev_name[DAX_NAME_LEN];
 };
 
-static int dax_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int dax_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        /*
         * We only ever expect to handle device-dax instances, i.e. the
index 65bffde137e3f7066e38cd4b2ab0203588213585..713582cc27d1f3fd35d4af67327b97fe4adc64cb 100644 (file)
@@ -127,9 +127,9 @@ static int eisa_bus_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int eisa_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int eisa_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct eisa_device *edev = to_eisa_device(dev);
+       const struct eisa_device *edev = to_eisa_device(dev);
 
        add_uevent_var(env, "MODALIAS=" EISA_DEVICE_MODALIAS_FMT, edev->id.sig);
        return 0;
index 99d43948061260377130e43d0918ca19c5301557..f29d77ecf72db613724dc175cdba1a001fc0ac60 100644 (file)
@@ -56,9 +56,9 @@ static void ffa_device_remove(struct device *dev)
        ffa_drv->remove(to_ffa_dev(dev));
 }
 
-static int ffa_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ffa_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct ffa_device *ffa_dev = to_ffa_dev(dev);
+       const struct ffa_device *ffa_dev = to_ffa_dev(dev);
 
        return add_uevent_var(env, "MODALIAS=arm_ffa:%04x:%pUb",
                              ffa_dev->vm_id, &ffa_dev->uuid);
index b9aae85ba9308ea1969e69300ebaea1b27fabdc1..4d32c98c82fcf8f4d6b039151adb2e42a8aec2bf 100644 (file)
@@ -293,9 +293,9 @@ static void dfl_bus_remove(struct device *dev)
                ddrv->remove(ddev);
 }
 
-static int dfl_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int dfl_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct dfl_device *ddev = to_dfl_dev(dev);
+       const struct dfl_device *ddev = to_dfl_dev(dev);
 
        return add_uevent_var(env, "MODALIAS=dfl:t%04Xf%04X",
                              ddev->type, ddev->feature_id);
index 497ef4b6a90a4dbe724d60899774973022276eb0..36c24c2b0899f7a365730fad4b399433ee2ccf62 100644 (file)
@@ -62,9 +62,9 @@ static int mipi_dsi_device_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int mipi_dsi_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int mipi_dsi_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
+       const struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
        int err;
 
        err = of_device_uevent_modalias(dev, env);
index bdee16a0bb8e217a8f063ea5cfa3eccb5c9a3c70..bc7271a00a94b6f5e66ca9ad502b5d2f549b2984 100644 (file)
@@ -338,7 +338,7 @@ static int host1x_device_match(struct device *dev, struct device_driver *drv)
        return strcmp(dev_name(dev), drv->name) == 0;
 }
 
-static int host1x_device_uevent(struct device *dev,
+static int host1x_device_uevent(const struct device *dev,
                                struct kobj_uevent_env *env)
 {
        struct device_node *np = dev->parent->of_node;
index e546c6431877fce0ce71967ebe3b222de6d6f972..5714be7404707b767da8d7dc7b6ad19a57769410 100644 (file)
@@ -78,14 +78,14 @@ static int greybus_match_device(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int greybus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int greybus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct gb_host_device *hd;
-       struct gb_module *module = NULL;
-       struct gb_interface *intf = NULL;
-       struct gb_control *control = NULL;
-       struct gb_bundle *bundle = NULL;
-       struct gb_svc *svc = NULL;
+       const struct gb_host_device *hd;
+       const struct gb_module *module = NULL;
+       const struct gb_interface *intf = NULL;
+       const struct gb_control *control = NULL;
+       const struct gb_bundle *bundle = NULL;
+       const struct gb_svc *svc = NULL;
 
        if (is_gb_host_device(dev)) {
                hd = to_gb_host_device(dev);
index 3e1803592bd4a224facc6111634fd7e34226ada1..a45e7034f0852b638ef1632577c81c2d3ac04abe 100644 (file)
@@ -2664,9 +2664,9 @@ static const struct attribute_group hid_dev_group = {
 };
 __ATTRIBUTE_GROUPS(hid_dev);
 
-static int hid_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int hid_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct hid_device *hdev = to_hid_device(dev);
+       const struct hid_device *hdev = to_hid_device(dev);
 
        if (add_uevent_var(env, "HID_ID=%04X:%08X:%08X",
                        hdev->bus, hdev->vendor, hdev->product))
index f68aba8794fe50eaa6a4fd2948dd2b7fd65b4679..81385ab37fa9a0dc40a703e6a4594501aa12c236 100644 (file)
@@ -361,7 +361,7 @@ static struct attribute *ishtp_cl_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(ishtp_cl_dev);
 
-static int ishtp_cl_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ishtp_cl_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        if (add_uevent_var(env, "MODALIAS=" ISHTP_MODULE_PREFIX "%s", dev_name(dev)))
                return -ENOMEM;
index 884066109699cf972a1723862b8ff61f71cf0943..8fda8f1d064d3bf52dfdd0c2516ad4ec1f2371ac 100644 (file)
@@ -30,7 +30,7 @@ static struct attribute *hsi_bus_dev_attrs[] = {
 };
 ATTRIBUTE_GROUPS(hsi_bus_dev);
 
-static int hsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int hsi_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        add_uevent_var(env, "MODALIAS=hsi:%s", dev_name(dev));
 
index 3146710d4ac63c005093c0989616b574d28b2447..f50aaa189df66f4a4c177e3de314562c83283d81 100644 (file)
@@ -711,9 +711,9 @@ __ATTRIBUTE_GROUPS(vmbus_bus);
  * representation of the device guid (each byte of the guid will be
  * represented with two hex characters.
  */
-static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
+static int vmbus_uevent(const struct device *device, struct kobj_uevent_env *env)
 {
-       struct hv_device *dev = device_to_hv_device(device);
+       const struct hv_device *dev = device_to_hv_device(device);
        const char *format = "MODALIAS=vmbus:%*phN";
 
        return add_uevent_var(env, format, UUID_SIZE, &dev->dev_type);
index 15ce3202322f04e67558dce4ef93ec3fb7e5367f..767fc9efb4a863ce773354045470aab723159af6 100644 (file)
@@ -895,9 +895,9 @@ static int serio_bus_match(struct device *dev, struct device_driver *drv)
                        return err;                                     \
        } while (0)
 
-static int serio_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int serio_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct serio *serio;
+       const struct serio *serio;
 
        if (!dev)
                return -ENODEV;
index 74d449858a61b29d8023a5ba78a4e386d7e7ef75..cc1ecfd4992866c780cc57e68583eb9e4f415713 100644 (file)
@@ -76,9 +76,9 @@ static void ipack_bus_remove(struct device *device)
                drv->ops->remove(dev);
 }
 
-static int ipack_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ipack_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct ipack_device *idev;
+       const struct ipack_device *idev;
 
        if (!dev)
                return -ENODEV;
index 7f2b0107c73359cffe2a257d43deef1876314b58..211ed9aa9edcd229da94d70f486f690c9ec03fe5 100644 (file)
@@ -128,7 +128,7 @@ static int macio_device_resume(struct device * dev)
        return 0;
 }
 
-static int macio_device_modalias(struct device *dev, struct kobj_uevent_env *env)
+static int macio_device_modalias(const struct device *dev, struct kobj_uevent_env *env)
 {
        return of_device_uevent_modalias(dev, env);
 }
index b8ad4f16b4acdc516e3733903dcdd6f42c00b146..978fdfc19a06ae68827d55367b7f74184eee43eb 100644 (file)
@@ -41,9 +41,9 @@ static int mcb_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int mcb_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int mcb_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct mcb_device *mdev = to_mcb_device(dev);
+       const struct mcb_device *mdev = to_mcb_device(dev);
        int ret;
 
        ret = add_uevent_var(env, "MODALIAS=mcb:16z%03d", mdev->id);
index 660df7d269fac2375466392b53374b6bba3aace1..bf766784545916a6068932ed4ea925e94a240aef 100644 (file)
@@ -57,10 +57,10 @@ static int memstick_bus_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int memstick_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int memstick_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct memstick_dev *card = container_of(dev, struct memstick_dev,
-                                                 dev);
+       const struct memstick_dev *card = container_of_const(dev, struct memstick_dev,
+                                                            dev);
 
        if (add_uevent_var(env, "MEMSTICK_TYPE=%02X", card->id.type))
                return -ENOMEM;
index a81b890c7ee648255c099264bfccb214b2a56b1e..706ae85ca8f5c0158933378757d7ace8ffded30e 100644 (file)
@@ -1227,9 +1227,9 @@ ATTRIBUTE_GROUPS(mei_cldev);
  *
  * Return: 0 on success -ENOMEM on when add_uevent_var fails
  */
-static int mei_cl_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int mei_cl_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct mei_cl_device *cldev = to_mei_cl_device(dev);
+       const struct mei_cl_device *cldev = to_mei_cl_device(dev);
        const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
        u8 version = mei_me_cl_ver(cldev->me_cl);
 
index a3098fea3bf7e8edbb7c803e8f05f14d55038ad8..eee9b6581604ee8394c685a400e85392a06aa767 100644 (file)
@@ -55,9 +55,9 @@ static int tifm_bus_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int tifm_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int tifm_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev);
+       const struct tifm_dev *sock = container_of_const(dev, struct tifm_dev, dev);
 
        if (add_uevent_var(env, "TIFM_CARD_TYPE=%s", tifm_media_type_name(sock->type, 1)))
                return -ENOMEM;
index 36679f4e9acce2eaddba9e5d9639f42ff623d7b4..2c3074a605fc4a3756ce4718a7423647854f4b5e 100644 (file)
@@ -55,9 +55,9 @@ static struct attribute *mmc_dev_attrs[] = {
 ATTRIBUTE_GROUPS(mmc_dev);
 
 static int
-mmc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+mmc_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct mmc_card *card = mmc_dev_to_card(dev);
+       const struct mmc_card *card = mmc_dev_to_card(dev);
        const char *type;
        unsigned int i;
        int retval = 0;
index babf21a0adeb62793943367bf970a9a800ad7aee..5ec4e4ca52f08de0b0fe84f56344fabb0558911d 100644 (file)
@@ -120,9 +120,9 @@ static int sdio_bus_match(struct device *dev, struct device_driver *drv)
 }
 
 static int
-sdio_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+sdio_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct sdio_func *func = dev_to_sdio_func(dev);
+       const struct sdio_func *func = dev_to_sdio_func(dev);
        unsigned int i;
 
        if (add_uevent_var(env,
index 16e021b477f0636d630f8e342234e84bab0440cf..22b352c57ca2d5e549ea277545d43884a060f325 100644 (file)
@@ -1000,7 +1000,7 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int mdio_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int mdio_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        int rc;
 
index 001636901ddae2e8afededa02d6b9533c7912b79..a78a25b872409a1d23d9cabfe41ae65d6c5608be 100644 (file)
@@ -200,7 +200,7 @@ static void xenvif_debugfs_delif(struct xenvif *vif)
  * and vif variables to the environment, for the benefit of the vif-* hotplug
  * scripts.
  */
-static int netback_uevent(struct xenbus_device *xdev,
+static int netback_uevent(const struct xenbus_device *xdev,
                          struct kobj_uevent_env *env)
 {
        struct backend_info *be = dev_get_drvdata(&xdev->dev);
index b38d0355b0ac3b4e7b6c836d71f635e491e937ea..92ce92fc99324b9223050cb58bc41088114ce766 100644 (file)
@@ -28,7 +28,7 @@ static int nvdimm_bus_major;
 struct class *nd_class;
 static DEFINE_IDA(nd_ida);
 
-static int to_nd_device_type(struct device *dev)
+static int to_nd_device_type(const struct device *dev)
 {
        if (is_nvdimm(dev))
                return ND_DEVICE_DIMM;
@@ -42,7 +42,7 @@ static int to_nd_device_type(struct device *dev)
        return 0;
 }
 
-static int nvdimm_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int nvdimm_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        return add_uevent_var(env, "MODALIAS=" ND_DEVICE_MODALIAS_FMT,
                        to_nd_device_type(dev));
index 7f4a9d28b67023a401d7648d7917d101d4825785..3bd61f2457885a2b6d96aa34aae15b1f1d498250 100644 (file)
@@ -38,7 +38,7 @@ static const struct device_type nd_dax_device_type = {
        .groups = nd_pfn_attribute_groups,
 };
 
-bool is_nd_dax(struct device *dev)
+bool is_nd_dax(const struct device *dev)
 {
        return dev ? dev->type == &nd_dax_device_type : false;
 }
index 1fc081dcf631578373b6bebb0f293dd5e7917914..fb571666d33bdbd2f406b8ffe4bb440d0f275825 100644 (file)
@@ -572,7 +572,7 @@ static const struct device_type nvdimm_device_type = {
        .groups = nvdimm_attribute_groups,
 };
 
-bool is_nvdimm(struct device *dev)
+bool is_nvdimm(const struct device *dev)
 {
        return dev->type == &nvdimm_device_type;
 }
index cc86ee09d7c081172d1257363e51a301378de684..ca2bbc57e75511799d43a53bbad6b5f5117c4d0f 100644 (file)
@@ -82,14 +82,14 @@ static inline void nvdimm_security_overwrite_query(struct work_struct *work)
 }
 #endif
 
-bool is_nvdimm(struct device *dev);
-bool is_nd_pmem(struct device *dev);
-bool is_nd_volatile(struct device *dev);
-static inline bool is_nd_region(struct device *dev)
+bool is_nvdimm(const struct device *dev);
+bool is_nd_pmem(const struct device *dev);
+bool is_nd_volatile(const struct device *dev);
+static inline bool is_nd_region(const struct device *dev)
 {
        return is_nd_pmem(dev) || is_nd_volatile(dev);
 }
-static inline bool is_memory(struct device *dev)
+static inline bool is_memory(const struct device *dev)
 {
        return is_nd_pmem(dev) || is_nd_volatile(dev);
 }
index 85ca5b4da3cf3b71e51b7580273a6419f2a05ce6..cc166f99b0056b7d7b4975c74726d6e984aa405a 100644 (file)
@@ -599,7 +599,7 @@ static inline int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig)
 struct nd_dax *to_nd_dax(struct device *dev);
 #if IS_ENABLED(CONFIG_NVDIMM_DAX)
 int nd_dax_probe(struct device *dev, struct nd_namespace_common *ndns);
-bool is_nd_dax(struct device *dev);
+bool is_nd_dax(const struct device *dev);
 struct device *nd_dax_create(struct nd_region *nd_region);
 #else
 static inline int nd_dax_probe(struct device *dev,
@@ -608,7 +608,7 @@ static inline int nd_dax_probe(struct device *dev,
        return -ENODEV;
 }
 
-static inline bool is_nd_dax(struct device *dev)
+static inline bool is_nd_dax(const struct device *dev)
 {
        return false;
 }
index 83dbf398ea841a62b9239e7b2d57afe601a63d3f..8f134d63af131390c40146f2e9281590db19f8fe 100644 (file)
@@ -839,12 +839,12 @@ static const struct device_type nd_volatile_device_type = {
        .groups = nd_region_attribute_groups,
 };
 
-bool is_nd_pmem(struct device *dev)
+bool is_nd_pmem(const struct device *dev)
 {
        return dev ? dev->type == &nd_pmem_device_type : false;
 }
 
-bool is_nd_volatile(struct device *dev)
+bool is_nd_volatile(const struct device *dev)
 {
        return dev ? dev->type == &nd_volatile_device_type : false;
 }
index a2ceeacc33eb6e50bb5c6fd27a9019f2bb002ee2..d934c27491c4c61f584ba57c2a9af8aa9d6a7fb7 100644 (file)
@@ -1545,9 +1545,9 @@ void pci_dev_put(struct pci_dev *dev)
 }
 EXPORT_SYMBOL(pci_dev_put);
 
-static int pci_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int pci_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct pci_dev *pdev;
+       const struct pci_dev *pdev;
 
        if (!dev)
                return -ENODEV;
index ace133b9f7d45d7f695d9f727c74d639d6723392..c8087efa5e4aff532c713b0390b64365480f4e3d 100644 (file)
@@ -927,9 +927,9 @@ static int pcmcia_bus_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int pcmcia_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct pcmcia_device *p_dev;
+       const struct pcmcia_device *p_dev;
        int i;
        u32 hash[4] = { 0, 0, 0, 0};
 
index 46d1edc08f20a474d2f4aa3de0486d9b45afac2a..4fe7650dd01448309f61f3b0e68bdbf00c5a50fe 100644 (file)
@@ -797,9 +797,9 @@ static struct attribute *wmi_method_attrs[] = {
 };
 ATTRIBUTE_GROUPS(wmi_method);
 
-static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int wmi_dev_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct wmi_block *wblock = dev_to_wblock(dev);
+       const struct wmi_block *wblock = dev_to_wblock(dev);
 
        if (add_uevent_var(env, "MODALIAS=wmi:%pUL", &wblock->gblock.guid))
                return -ENOMEM;
index a72bb0a40fcfe4fd976178769f85e04d52cf5a74..e60e49769bed806c92cbf4c722b4935b8aef2890 100644 (file)
@@ -204,9 +204,9 @@ static int rio_match_bus(struct device *dev, struct device_driver *drv)
       out:return 0;
 }
 
-static int rio_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int rio_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct rio_dev *rdev;
+       const struct rio_dev *rdev;
 
        if (!dev)
                return -ENODEV;
index d6dde00efdae673252f10b86197aa09923417e19..a2207c0cf432178d0d942456a5a6de429d782411 100644 (file)
@@ -492,9 +492,9 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv)
        return of_driver_match_device(dev, drv);
 }
 
-static int rpmsg_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int rpmsg_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct rpmsg_device *rpdev = to_rpmsg_device(dev);
+       const struct rpmsg_device *rpdev = to_rpmsg_device(dev);
        int ret;
 
        ret = of_device_uevent_modalias(dev, env);
index c7db953985002f622e37d588feb924d13e167ebe..0723921902da610e5d61944c0c8da69e53a2686d 100644 (file)
@@ -1402,9 +1402,9 @@ static void css_shutdown(struct device *dev)
                sch->driver->shutdown(sch);
 }
 
-static int css_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int css_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct subchannel *sch = to_subchannel(dev);
+       const struct subchannel *sch = to_subchannel(dev);
        int ret;
 
        ret = add_uevent_var(env, "ST=%01X", sch->st);
index 9e0cf44ff9d4b2abc2134d933e0b25883f78e765..b07ffd9ff117182bea74ec985d99545f12539298 100644 (file)
@@ -80,7 +80,7 @@ ccw_bus_match (struct device * dev, struct device_driver * drv)
  * specified size. Return length of resulting string (excluding trailing '\0')
  * even if string doesn't fit buffer (snprintf semantics). */
 static int snprint_alias(char *buf, size_t size,
-                        struct ccw_device_id *id, const char *suffix)
+                        const struct ccw_device_id *id, const char *suffix)
 {
        int len;
 
@@ -101,10 +101,10 @@ static int snprint_alias(char *buf, size_t size,
 
 /* Set up environment variables for ccw device uevent. Return 0 on success,
  * non-zero otherwise. */
-static int ccw_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ccw_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct ccw_device *cdev = to_ccwdev(dev);
-       struct ccw_device_id *id = &(cdev->id);
+       const struct ccw_device *cdev = to_ccwdev(dev);
+       const struct ccw_device_id *id = &(cdev->id);
        int ret;
        char modalias_buf[30];
 
index b6b4589c70bd71d3470c82151b87308c620d3cb0..6b21ba68c1fe62b3e24080dce36b8642cb94406b 100644 (file)
@@ -37,7 +37,7 @@ static void scmdev_remove(struct device *dev)
                scmdrv->remove(scmdev);
 }
 
-static int scmdev_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int scmdev_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        return add_uevent_var(env, "MODALIAS=scm:scmdev");
 }
index b02c631f3b71ac93bf9a4d18bfd056f87fb536df..f4cc1720156f2ab42d26623526ff8a52c2ffb130 100644 (file)
@@ -613,10 +613,10 @@ static int ap_bus_match(struct device *dev, struct device_driver *drv)
  * It sets up a single environment variable DEV_TYPE which contains the
  * hardware device type.
  */
-static int ap_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ap_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        int rc = 0;
-       struct ap_device *ap_dev = to_ap_dev(dev);
+       const struct ap_device *ap_dev = to_ap_dev(dev);
 
        /* Uevents from ap bus core don't need extensions to the env */
        if (dev == ap_root_device)
index 981d1bab21207166b97f0003830d069bb01ff615..a0dd711eb40827d9800d434dc565fa3b74634575 100644 (file)
@@ -534,9 +534,9 @@ static int scsi_bus_match(struct device *dev, struct device_driver *gendrv)
        return (sdp->inq_periph_qual == SCSI_INQ_PQ_CON)? 1: 0;
 }
 
-static int scsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int scsi_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct scsi_device *sdev;
+       const struct scsi_device *sdev;
 
        if (dev->type != &scsi_dev_type)
                return 0;
index 219483b79c09ced217d01e86f384cad51b8b4c20..d43873bb5fe6df58d212122abf3fa1d92121914f 100644 (file)
@@ -93,9 +93,9 @@ static void slim_device_remove(struct device *dev)
        }
 }
 
-static int slim_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int slim_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct slim_device *sbdev = to_slim_device(dev);
+       const struct slim_device *sbdev = to_slim_device(dev);
 
        return add_uevent_var(env, "MODALIAS=slim:%s", dev_name(&sbdev->dev));
 }
index d51abb462ae5d3481d26a0bdc6ababe603d7ca26..30f81d6d9d9da5c375cc8975f63e38eeea77e7a2 100644 (file)
@@ -387,9 +387,9 @@ static void apr_device_remove(struct device *dev)
        spin_unlock(&apr->svcs_lock);
 }
 
-static int apr_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int apr_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct apr_device *adev = to_apr_device(dev);
+       const struct apr_device *adev = to_apr_device(dev);
        int ret;
 
        ret = of_device_uevent_modalias(dev, env);
index 15f174f4e0561a686674162d6011c0c119cc278f..b85e41a9dc34ef6da6182104a7144a418ab17f29 100644 (file)
@@ -395,7 +395,7 @@ static int spi_match_device(struct device *dev, struct device_driver *drv)
        return strcmp(spi->modalias, drv->name) == 0;
 }
 
-static int spi_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int spi_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        const struct spi_device         *spi = to_spi_device(dev);
        int rc;
index 55381592bb5a698b8cf10cc6f54cfe21753b22ac..73551531ed437bb96fc39462a945cf8e1aa1d2b5 100644 (file)
@@ -366,7 +366,7 @@ static void spmi_drv_shutdown(struct device *dev)
                sdrv->shutdown(to_spmi_device(dev));
 }
 
-static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int spmi_drv_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        int ret;
 
index 8a93c83cb6f8056e55b4a6dd8560862705db9c67..ab080cf26c9fff7dc19b738e326df160913c866d 100644 (file)
@@ -339,9 +339,9 @@ static int ssb_bus_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int ssb_device_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ssb_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);
+       const struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);
 
        if (!dev)
                return -ENODEV;
index 5a5c17a4519b3ffcb194a77c31c884ed12854784..6a7d8cf2a1ebc1f74f1f4575e4e7f438dc9513f6 100644 (file)
@@ -71,14 +71,14 @@ static const struct device_type greybus_gbphy_dev_type = {
        .pm     =       &gb_gbphy_pm_ops,
 };
 
-static int gbphy_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int gbphy_dev_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct gbphy_device *gbphy_dev = to_gbphy_dev(dev);
-       struct greybus_descriptor_cport *cport_desc = gbphy_dev->cport_desc;
-       struct gb_bundle *bundle = gbphy_dev->bundle;
-       struct gb_interface *intf = bundle->intf;
-       struct gb_module *module = intf->module;
-       struct gb_host_device *hd = intf->hd;
+       const struct gbphy_device *gbphy_dev = to_gbphy_dev(dev);
+       const struct greybus_descriptor_cport *cport_desc = gbphy_dev->cport_desc;
+       const struct gb_bundle *bundle = gbphy_dev->bundle;
+       const struct gb_interface *intf = bundle->intf;
+       const struct gb_module *module = intf->module;
+       const struct gb_host_device *hd = intf->hd;
 
        if (add_uevent_var(env, "BUS=%u", hd->bus_id))
                return -ENOMEM;
index 98da206cd7615ba8a9269e2e31420ce9a1542b7d..452cbb8ad48416022ae97c091f501e4993d1835f 100644 (file)
@@ -1207,7 +1207,7 @@ static int tee_client_device_match(struct device *dev,
        return 0;
 }
 
-static int tee_client_device_uevent(struct device *dev,
+static int tee_client_device_uevent(const struct device *dev,
                                    struct kobj_uevent_env *env)
 {
        uuid_t *dev_id = &to_tee_client_device(dev)->id.uuid;
index d7c8461976ce09133aeeaed474b826ce149738c2..67b780b256a9ec53c2c5126d9eeb75a57c113f31 100644 (file)
@@ -55,9 +55,9 @@ static int ulpi_match(struct device *dev, struct device_driver *driver)
        return 0;
 }
 
-static int ulpi_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int ulpi_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct ulpi *ulpi = to_ulpi_dev(dev);
+       const struct ulpi *ulpi = to_ulpi_dev(dev);
        int ret;
 
        ret = of_device_uevent_modalias(dev, env);
index 7e7e119c253fb1c76e556428e42b4fefb60a1bc6..a0e076c6f3a49525b53e80cbfe2816071e8012d7 100644 (file)
@@ -899,14 +899,14 @@ static int usb_device_match(struct device *dev, struct device_driver *drv)
        return 0;
 }
 
-static int usb_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int usb_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct usb_device *usb_dev;
+       const struct usb_device *usb_dev;
 
        if (is_usb_device(dev)) {
                usb_dev = to_usb_device(dev);
        } else if (is_usb_interface(dev)) {
-               struct usb_interface *intf = to_usb_interface(dev);
+               const struct usb_interface *intf = to_usb_interface(dev);
 
                usb_dev = interface_to_usbdev(intf);
        } else {
index 31c2a3130cadbbf48432b3d03b957b1be8762da4..dbcb96151558ccc662c9ae5ccad199393c3353a8 100644 (file)
@@ -321,9 +321,9 @@ static int typec_match(struct device *dev, struct device_driver *driver)
        return 0;
 }
 
-static int typec_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int typec_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct typec_altmode *altmode = to_typec_altmode(dev);
+       const struct typec_altmode *altmode = to_typec_altmode(dev);
 
        if (add_uevent_var(env, "SVID=%04X", altmode->svid))
                return -ENOMEM;
index b9a80aedee1b73fed28d7335081b95c75db73fcc..3893dc29eb26338f036379c5664e249ad18f1df6 100644 (file)
@@ -95,9 +95,9 @@ static int virtio_dev_match(struct device *_dv, struct device_driver *_dr)
        return 0;
 }
 
-static int virtio_uevent(struct device *_dv, struct kobj_uevent_env *env)
+static int virtio_uevent(const struct device *_dv, struct kobj_uevent_env *env)
 {
-       struct virtio_device *dev = dev_to_virtio(_dv);
+       const struct virtio_device *dev = dev_to_virtio(_dv);
 
        return add_uevent_var(env, "MODALIAS=virtio:d%08Xv%08X",
                              dev->id.device, dev->id.vendor);
index 4a2ddf730a3acd173caead38a733bda7c4e7f7be..9d199fed96287602868b2f925257250f1a3a6574 100644 (file)
@@ -170,7 +170,7 @@ static struct w1_family w1_default_family = {
        .fops = &w1_default_fops,
 };
 
-static int w1_uevent(struct device *dev, struct kobj_uevent_env *env);
+static int w1_uevent(const struct device *dev, struct kobj_uevent_env *env);
 
 static struct bus_type w1_bus_type = {
        .name = "w1",
@@ -577,11 +577,11 @@ void w1_destroy_master_attributes(struct w1_master *master)
        sysfs_remove_group(&master->dev.kobj, &w1_master_defattr_group);
 }
 
-static int w1_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int w1_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct w1_master *md = NULL;
-       struct w1_slave *sl = NULL;
-       char *event_owner, *name;
+       const struct w1_master *md = NULL;
+       const struct w1_slave *sl = NULL;
+       const char *event_owner, *name;
        int err = 0;
 
        if (dev->driver == &w1_master_driver) {
index 0d4f8f4f494888898c759d0f14ddc28f594cdabc..8bf19bca5d3d538f8552905a3bc8dc208396eb42 100644 (file)
@@ -1185,7 +1185,7 @@ static void pvcalls_back_remove(struct xenbus_device *dev)
 {
 }
 
-static int pvcalls_back_uevent(struct xenbus_device *xdev,
+static int pvcalls_back_uevent(const struct xenbus_device *xdev,
                               struct kobj_uevent_env *env)
 {
        return 0;
index 9c09f89d8278b3aa2978f21c14f0eb6b357eca3d..da96c260e26b455bbf20bb026a0cdb1f227281ec 100644 (file)
@@ -92,12 +92,12 @@ static int backend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename)
        return 0;
 }
 
-static int xenbus_uevent_backend(struct device *dev,
+static int xenbus_uevent_backend(const struct device *dev,
                                 struct kobj_uevent_env *env)
 {
-       struct xenbus_device *xdev;
-       struct xenbus_driver *drv;
-       struct xen_bus_type *bus;
+       const struct xenbus_device *xdev;
+       const struct xenbus_driver *drv;
+       const struct xen_bus_type *bus;
 
        DPRINTK("");
 
index f44d5a64351e4ab0d081234b94c7a288b2f4bd58..3f3836cb72799bc1d6b63f586246deda11e6030d 100644 (file)
@@ -73,10 +73,10 @@ static int xenbus_probe_frontend(struct xen_bus_type *bus, const char *type,
        return err;
 }
 
-static int xenbus_uevent_frontend(struct device *_dev,
+static int xenbus_uevent_frontend(const struct device *_dev,
                                  struct kobj_uevent_env *env)
 {
-       struct xenbus_device *dev = to_xenbus_device(_dev);
+       const struct xenbus_device *dev = to_xenbus_device(_dev);
 
        if (add_uevent_var(env, "MODALIAS=xen:%s", dev->devicetype))
                return -ENOMEM;
index 96f068830549e057d5988a9909432ee1ecafdc51..025edfccedcf71e443363000644de6e38056d24b 100644 (file)
@@ -130,9 +130,9 @@ static int zorro_bus_match(struct device *dev, struct device_driver *drv)
        return !!zorro_match_device(ids, z);
 }
 
-static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int zorro_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct zorro_dev *z;
+       const struct zorro_dev *z;
 
        if (!dev)
                return -ENODEV;
index 7b4a48b5159b6278ec1d0385164b618e2921846b..87e4d029c915943f3ee8b653619626f6b9b01748 100644 (file)
@@ -90,7 +90,7 @@ struct bus_type {
        const struct attribute_group **drv_groups;
 
        int (*match)(struct device *dev, struct device_driver *drv);
-       int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
+       int (*uevent)(const struct device *dev, struct kobj_uevent_env *env);
        int (*probe)(struct device *dev);
        void (*sync_state)(struct device *dev);
        void (*remove)(struct device *dev);
index 9a32495fbb1fd076dd61e55b1cf257fc9bd2f738..2edf7f09239eec02233f801f5b4b291801ade4fd 100644 (file)
@@ -223,7 +223,7 @@ struct spi_device {
 static_assert((SPI_MODE_KERNEL_MASK & SPI_MODE_USER_MASK) == 0,
              "SPI_MODE_USER_MASK & SPI_MODE_KERNEL_MASK must not overlap");
 
-static inline struct spi_device *to_spi_device(struct device *dev)
+static inline struct spi_device *to_spi_device(const struct device *dev)
 {
        return dev ? container_of(dev, struct spi_device, dev) : NULL;
 }
index f9b53acb4e025da0b7f73d88acd1933e0fda0e88..1f326da289d3a6323d496142ce5110e38dbd3d7e 100644 (file)
@@ -285,7 +285,7 @@ struct ssb_device {
 
 /* Go from struct device to struct ssb_device. */
 static inline
-struct ssb_device * dev_to_ssb_dev(struct device *dev)
+struct ssb_device * dev_to_ssb_dev(const struct device *dev)
 {
        struct __ssb_dev_wrapper *wrap;
        wrap = container_of(dev, struct __ssb_dev_wrapper, dev);
index a6872537724d3d2b4c9cd00e160fcea7d603e9a3..1c45664e0e5acf18aa433b1d404f33d6ca3138bc 100644 (file)
@@ -123,7 +123,7 @@ void snd_hdac_device_exit(struct hdac_device *dev);
 int snd_hdac_device_register(struct hdac_device *codec);
 void snd_hdac_device_unregister(struct hdac_device *codec);
 int snd_hdac_device_set_chip_name(struct hdac_device *codec, const char *name);
-int snd_hdac_codec_modalias(struct hdac_device *hdac, char *buf, size_t size);
+int snd_hdac_codec_modalias(const struct hdac_device *hdac, char *buf, size_t size);
 
 int snd_hdac_refresh_widgets(struct hdac_device *codec);
 
index ef0505e72c2738fb53cfbacdde17fe879ddbe455..ac22cf08c09f74d889312ca7b40fed21a392a117 100644 (file)
@@ -117,7 +117,7 @@ struct xenbus_driver {
        void (*remove)(struct xenbus_device *dev);
        int (*suspend)(struct xenbus_device *dev);
        int (*resume)(struct xenbus_device *dev);
-       int (*uevent)(struct xenbus_device *, struct kobj_uevent_env *);
+       int (*uevent)(const struct xenbus_device *, struct kobj_uevent_env *);
        struct device_driver driver;
        int (*read_otherend_details)(struct xenbus_device *dev);
        int (*is_ready)(struct xenbus_device *dev);
index c9579d97fbab19765be38c01b8b81b8dc188d343..39fb8fe4e6ab858a6533d521e796a5f315e006d7 100644 (file)
@@ -55,10 +55,10 @@ static int soundbus_probe(struct device *dev)
 }
 
 
-static int soundbus_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int soundbus_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
-       struct soundbus_dev * soundbus_dev;
-       struct platform_device * of;
+       const struct soundbus_dev * soundbus_dev;
+       const struct platform_device * of;
        const char *compat;
        int retval = 0;
        int cplen, seen = 0;
index eea6b63f8305589f8bfee1b23d4232172678b7dc..4cd94178df9fa9f33b2c1bfdea3052d11bd5e4a8 100644 (file)
@@ -65,7 +65,7 @@ static int hda_bus_match(struct device *dev, struct device_driver *drv)
        return 1;
 }
 
-static int hda_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int hda_uevent(const struct device *dev, struct kobj_uevent_env *env)
 {
        char modalias[32];
 
index b7e5032b61c97cf7f245a21461263efa6c596271..accc9d279ce5aa248689eb070975a0018b7e040d 100644 (file)
@@ -204,7 +204,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_set_chip_name);
  *
  * Returns the size of string, like snprintf(), or a negative error code.
  */
-int snd_hdac_codec_modalias(struct hdac_device *codec, char *buf, size_t size)
+int snd_hdac_codec_modalias(const struct hdac_device *codec, char *buf, size_t size)
 {
        return scnprintf(buf, size, "hdaudio:v%08Xr%08Xa%02X\n",
                        codec->vendor_id, codec->revision_id, codec->type);