driver core: make struct device_type.uevent() take a const *
The uevent() callback in struct device_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. Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Andreas Noever <andreas.noever@gmail.com> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Bard Liao <yung-chuan.liao@linux.intel.com> Cc: Chaitanya Kulkarni <kch@nvidia.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Frank Rowand <frowand.list@gmail.com> Cc: Ira Weiny <ira.weiny@intel.com> Cc: Jason Gunthorpe <jgg@ziepe.ca> Cc: Jens Axboe <axboe@kernel.dk> Cc: Jilin Yuan <yuanjilin@cdjrlc.com> Cc: Jiri Slaby <jirislaby@kernel.org> Cc: Len Brown <lenb@kernel.org> Cc: Mark Gross <markgross@kernel.org> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org> Cc: Maximilian Luz <luzmaximilian@gmail.com> Cc: Michael Jamet <michael.jamet@intel.com> Cc: Ming Lei <ming.lei@redhat.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Cc: Sanyog Kale <sanyog.r.kale@intel.com> Cc: Sean Young <sean@mess.org> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Won Chung <wonchung@google.com> Cc: Yehezkel Bernat <YehezkelShB@gmail.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> # for Thunderbolt Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Wolfram Sang <wsa@kernel.org> Acked-by: Vinod Koul <vkoul@kernel.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230111113018.459199-6-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -1372,7 +1372,7 @@ INPUT_DEV_STRING_ATTR_SHOW(phys);
|
||||
INPUT_DEV_STRING_ATTR_SHOW(uniq);
|
||||
|
||||
static int input_print_modalias_bits(char *buf, int size,
|
||||
char name, unsigned long *bm,
|
||||
char name, const unsigned long *bm,
|
||||
unsigned int min_bit, unsigned int max_bit)
|
||||
{
|
||||
int len = 0, i;
|
||||
@@ -1384,7 +1384,7 @@ static int input_print_modalias_bits(char *buf, int size,
|
||||
return len;
|
||||
}
|
||||
|
||||
static int input_print_modalias(char *buf, int size, struct input_dev *id,
|
||||
static int input_print_modalias(char *buf, int size, const struct input_dev *id,
|
||||
int add_cr)
|
||||
{
|
||||
int len;
|
||||
@@ -1432,7 +1432,7 @@ static ssize_t input_dev_show_modalias(struct device *dev,
|
||||
}
|
||||
static DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
|
||||
|
||||
static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap,
|
||||
static int input_print_bitmap(char *buf, int buf_size, const unsigned long *bitmap,
|
||||
int max, int add_cr);
|
||||
|
||||
static ssize_t input_dev_show_properties(struct device *dev,
|
||||
@@ -1524,7 +1524,7 @@ static const struct attribute_group input_dev_id_attr_group = {
|
||||
.attrs = input_dev_id_attrs,
|
||||
};
|
||||
|
||||
static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap,
|
||||
static int input_print_bitmap(char *buf, int buf_size, const unsigned long *bitmap,
|
||||
int max, int add_cr)
|
||||
{
|
||||
int i;
|
||||
@@ -1621,7 +1621,7 @@ static void input_dev_release(struct device *device)
|
||||
* device bitfields.
|
||||
*/
|
||||
static int input_add_uevent_bm_var(struct kobj_uevent_env *env,
|
||||
const char *name, unsigned long *bitmap, int max)
|
||||
const char *name, const unsigned long *bitmap, int max)
|
||||
{
|
||||
int len;
|
||||
|
||||
@@ -1639,7 +1639,7 @@ static int input_add_uevent_bm_var(struct kobj_uevent_env *env,
|
||||
}
|
||||
|
||||
static int input_add_uevent_modalias_var(struct kobj_uevent_env *env,
|
||||
struct input_dev *dev)
|
||||
const struct input_dev *dev)
|
||||
{
|
||||
int len;
|
||||
|
||||
@@ -1677,9 +1677,9 @@ static int input_add_uevent_modalias_var(struct kobj_uevent_env *env,
|
||||
return err; \
|
||||
} while (0)
|
||||
|
||||
static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env)
|
||||
static int input_dev_uevent(const struct device *device, struct kobj_uevent_env *env)
|
||||
{
|
||||
struct input_dev *dev = to_input_dev(device);
|
||||
const struct input_dev *dev = to_input_dev(device);
|
||||
|
||||
INPUT_ADD_HOTPLUG_VAR("PRODUCT=%x/%x/%x/%x",
|
||||
dev->id.bustype, dev->id.vendor,
|
||||
|
||||
Reference in New Issue
Block a user