const-ify struct evdev_methods

Submitted by:	Vladimir Kondratiev <wulf@cicgroup.ru>
Suggested by:	hselasky
This commit is contained in:
Oleksandr Tymoshenko 2016-10-03 17:20:34 +00:00
parent 18f555023a
commit 5163e77fad
5 changed files with 6 additions and 5 deletions

View File

@ -302,7 +302,7 @@ evdev_set_serial(struct evdev_dev *evdev, const char *serial)
inline void
evdev_set_methods(struct evdev_dev *evdev, void *softc,
struct evdev_methods *methods)
const struct evdev_methods *methods)
{
evdev->ev_methods = methods;

View File

@ -89,7 +89,8 @@ void evdev_set_name(struct evdev_dev *, const char *);
void evdev_set_id(struct evdev_dev *, uint16_t, uint16_t, uint16_t, uint16_t);
void evdev_set_phys(struct evdev_dev *, const char *);
void evdev_set_serial(struct evdev_dev *, const char *);
void evdev_set_methods(struct evdev_dev *, void *, struct evdev_methods *);
void evdev_set_methods(struct evdev_dev *, void *,
const struct evdev_methods *);
int evdev_register(struct evdev_dev *);
int evdev_unregister(struct evdev_dev *);
int evdev_push_event(struct evdev_dev *, uint16_t, uint16_t, int32_t);

View File

@ -116,7 +116,7 @@ struct evdev_dev
uint64_t ev_report_count;
/* Parent driver callbacks: */
struct evdev_methods * ev_methods;
const struct evdev_methods * ev_methods;
void * ev_softc;
LIST_ENTRY(evdev_dev) ev_link;

View File

@ -364,7 +364,7 @@ static device_detach_t ukbd_detach;
static device_resume_t ukbd_resume;
#ifdef EVDEV_SUPPORT
static struct evdev_methods ukbd_evdev_methods = {
static const struct evdev_methods ukbd_evdev_methods = {
.ev_event = evdev_ev_kbd_event,
};
#endif

View File

@ -191,7 +191,7 @@ static struct usb_fifo_methods ums_fifo_methods = {
};
#ifdef EVDEV_SUPPORT
static struct evdev_methods ums_evdev_methods = {
static const struct evdev_methods ums_evdev_methods = {
.ev_open = &ums_ev_open,
.ev_close = &ums_ev_close,
};