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 8686e8c..81c9f0a 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 e7ee0c0..28f4728 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 00ecac2..770df93 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 01122a2..b78df3a 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 0c05ccd..9531dd0 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 ff7454a..ce88af9 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 8c5e659..4d4c2c8 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 4c98849..441eb5b 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 b10a130..262555b 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 0a8469e..7b39f01 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 774f307..36cb091 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 1dc8a35..4819369 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 bf672de..770fc81 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 fca0d06..554e199 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 a180af1..9aa99c3 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 a38a0cc..b75dd77 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 b631a05..3f02dc1 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 1b1cf45..c9e1b48 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 ab13800..6749f2a 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 1dad813..e3a3841 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 65bffde..713582c 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 99d4394..f29d77e 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 b9aae85..4d32c98 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 497ef4b..36c24c2 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 bdee16a..bc7271a 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 e546c64..5714be7 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 3e18035..a45e703 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 f68aba8..81385ab 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 8840661..8fda8f1 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 3146710..f50aaa1 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 15ce320..767fc9e 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 74d4498..cc1ecfd 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 7f2b010..211ed9a 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 b8ad4f1..978fdfc 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 660df7d..bf76678 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 a81b890..706ae85 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 a3098fe..eee9b65 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 36679f4..2c3074a 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 babf21a..5ec4e4c 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 16e021b..22b352c 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 0016369..a78a25b 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 b38d035..92ce92f 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 7f4a9d2..3bd61f2 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 1fc081d..fb57166 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 cc86ee0..ca2bbc5 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 85ca5b4..cc166f9 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 83dbf39..8f134d6 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 a2ceeac..d934c27 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 ace133b..c8087ef 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 46d1edc..4fe7650 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 a72bb0a..e60e497 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 d6dde00..a2207c0 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 c7db953..0723921 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 9e0cf44..b07ffd9 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 b6b4589..6b21ba6 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 b02c631..f4cc172 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 981d1ba..a0dd711 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 219483b..d43873b 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 d51abb4..30f81d6 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 15f174f..b85e41a 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 5538159..7355153 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 8a93c83..ab080cf 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 5a5c17a..6a7d8cf 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 98da206..452cbb8 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 d7c8461..67b780b 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 7e7e119..a0e076c 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 31c2a31..dbcb961 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 b9a80ae..3893dc2 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 4a2ddf7..9d199fe 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 0d4f8f4..8bf19bc 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 9c09f89..da96c26 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 f44d5a6..3f3836c 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 96f0688..025edfc 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 7b4a48b..87e4d02 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 9a32495..2edf7f0 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 f9b53ac..1f326da 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 a687253..1c45664 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 ef0505e..ac22cf0 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 c9579d9..39fb8fe 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 eea6b63..4cd9417 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 b7e5032..accc9d2 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);