diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-11 12:30:17 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-27 13:45:52 +0100 |
commit | 2a81ada32f0e584fc0c943e0d3a8c9f4fae411d6 (patch) | |
tree | eee82ee42e4aa7832dffd9f391f8d885e1d99f6c /drivers/w1 | |
parent | xen/xenbus: move to_xenbus_device() to use container_of_const() (diff) | |
download | linux-2a81ada32f0e584fc0c943e0d3a8c9f4fae411d6.tar.xz linux-2a81ada32f0e584fc0c943e0d3a8c9f4fae411d6.zip |
driver core: make struct bus_type.uevent() take a const *
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>
Diffstat (limited to '')
-rw-r--r-- | drivers/w1/w1.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 4a2ddf730a3a..9d199fed9628 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -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) { |