Commit aed65af1 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Greg Kroah-Hartman

drivers: make device_type const

The device_type structure does not contain data that changes
during usage and should be const. This allows devices to declare
the struct const.

I have patches to change all the subsystems, but need the infra
structure change first.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 695cca87
...@@ -400,7 +400,7 @@ static void device_remove_groups(struct device *dev, ...@@ -400,7 +400,7 @@ static void device_remove_groups(struct device *dev,
static int device_add_attrs(struct device *dev) static int device_add_attrs(struct device *dev)
{ {
struct class *class = dev->class; struct class *class = dev->class;
struct device_type *type = dev->type; const struct device_type *type = dev->type;
int error; int error;
if (class) { if (class) {
...@@ -440,7 +440,7 @@ static int device_add_attrs(struct device *dev) ...@@ -440,7 +440,7 @@ static int device_add_attrs(struct device *dev)
static void device_remove_attrs(struct device *dev) static void device_remove_attrs(struct device *dev)
{ {
struct class *class = dev->class; struct class *class = dev->class;
struct device_type *type = dev->type; const struct device_type *type = dev->type;
device_remove_groups(dev, dev->groups); device_remove_groups(dev, dev->groups);
......
...@@ -408,7 +408,7 @@ struct device { ...@@ -408,7 +408,7 @@ struct device {
struct kobject kobj; struct kobject kobj;
const char *init_name; /* initial name of the device */ const char *init_name; /* initial name of the device */
struct device_type *type; const struct device_type *type;
struct mutex mutex; /* mutex to synchronize calls to struct mutex mutex; /* mutex to synchronize calls to
* its driver. * its driver.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment