From 11b27f9d90f1ed872c5711da8c9d359dbe3e19c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Tigeot?= Date: Thu, 27 Oct 2016 20:22:06 +0200 Subject: [PATCH] kernel: Rename the struct behind device_t to bsd_device Thus making it not clash with the Linux struct device anymore Inspired-by: proposed FreeBSD changes --- sys/dev/drm/include/linux/i2c.h | 2 +- sys/kern/subr_bus.c | 4 ++-- sys/sys/bus.h | 2 +- sys/sys/bus_private.h | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/drm/include/linux/i2c.h b/sys/dev/drm/include/linux/i2c.h index 88aca08ee9..61f80895de 100644 --- a/sys/dev/drm/include/linux/i2c.h +++ b/sys/dev/drm/include/linux/i2c.h @@ -41,6 +41,6 @@ #define I2C_M_RD IIC_M_RD #define I2C_M_NOSTART IIC_M_NOSTART -#define i2c_adapter device +#define i2c_adapter bsd_device #endif /* _LINUX_I2C_H_ */ diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 0d53ca2a84..6565a744dd 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -693,7 +693,7 @@ sysctl_devctl_disable(SYSCTL_HANDLER_ARGS) /* End of /dev/devctl code */ -TAILQ_HEAD(,device) bus_data_devices; +TAILQ_HEAD(,bsd_device) bus_data_devices; static int bus_data_generation = 1; kobj_method_t null_methods[] = { @@ -1146,7 +1146,7 @@ make_device(device_t parent, const char *name, int unit) } else dc = NULL; - dev = kmalloc(sizeof(struct device), M_BUS, M_INTWAIT | M_ZERO); + dev = kmalloc(sizeof(struct bsd_device), M_BUS, M_INTWAIT | M_ZERO); if (!dev) return(0); diff --git a/sys/sys/bus.h b/sys/sys/bus.h index d5652a671c..7f09ebb78d 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -53,7 +53,7 @@ /* * Forward declarations */ -typedef struct device *device_t; +typedef struct bsd_device *device_t; typedef struct kobj_class driver_t; typedef struct devclass *devclass_t; #define device_method_t kobj_method_t diff --git a/sys/sys/bus_private.h b/sys/sys/bus_private.h index 3176053bcd..c93879d7b1 100644 --- a/sys/sys/bus_private.h +++ b/sys/sys/bus_private.h @@ -56,7 +56,7 @@ struct driverlink { */ typedef TAILQ_HEAD(devclass_list, devclass) devclass_list_t; typedef TAILQ_HEAD(driver_list, driverlink) driver_list_t; -typedef TAILQ_HEAD(device_list, device) device_list_t; +typedef TAILQ_HEAD(device_list, bsd_device) device_list_t; struct devclass { TAILQ_ENTRY(devclass) link; @@ -97,7 +97,7 @@ struct config_device { /* * Implementation of device. */ -struct device { +struct bsd_device { /* * A device is a kernel object. The first field must be the * current ops table for the object. @@ -107,8 +107,8 @@ struct device { /* * Device hierarchy. */ - TAILQ_ENTRY(device) link; /* list of devices in parent */ - TAILQ_ENTRY(device) devlink; /* global device list membership */ + TAILQ_ENTRY(bsd_device) link; /* list of devices in parent */ + TAILQ_ENTRY(bsd_device) devlink; /* global device list membership */ device_t parent; device_list_t children; /* list of subordinate devices */ -- 2.41.0