diff options
| author | David Brownell <dbrownell@users.sourceforge.net> | 2009-06-24 13:06:31 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 12:50:47 -0400 |
| commit | a4dbd6740df0872cdf0a86841f75beec8381964d (patch) | |
| tree | 1093687845d89f8397d61e7df1ad8546a5a25225 | |
| parent | 5b2ea2f10dbb2fa91d8033993000f8664309395f (diff) | |
driver model: constify attribute groups
Let attribute group vectors be declared "const". We'd
like to let most attribute metadata live in read-only
sections... this is a start.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
30 files changed, 39 insertions, 39 deletions
diff --git a/block/genhd.c b/block/genhd.c index 5b76bf55d05..2ad91ddad8e 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
| @@ -903,7 +903,7 @@ static struct attribute_group disk_attr_group = { | |||
| 903 | .attrs = disk_attrs, | 903 | .attrs = disk_attrs, |
| 904 | }; | 904 | }; |
| 905 | 905 | ||
| 906 | static struct attribute_group *disk_attr_groups[] = { | 906 | static const struct attribute_group *disk_attr_groups[] = { |
| 907 | &disk_attr_group, | 907 | &disk_attr_group, |
| 908 | NULL | 908 | NULL |
| 909 | }; | 909 | }; |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 99dfe96fffc..a992985d1fa 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
| @@ -341,7 +341,7 @@ static void device_remove_attributes(struct device *dev, | |||
| 341 | } | 341 | } |
| 342 | 342 | ||
| 343 | static int device_add_groups(struct device *dev, | 343 | static int device_add_groups(struct device *dev, |
| 344 | struct attribute_group **groups) | 344 | const struct attribute_group **groups) |
| 345 | { | 345 | { |
| 346 | int error = 0; | 346 | int error = 0; |
| 347 | int i; | 347 | int i; |
| @@ -361,7 +361,7 @@ static int device_add_groups(struct device *dev, | |||
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | static void device_remove_groups(struct device *dev, | 363 | static void device_remove_groups(struct device *dev, |
| 364 | struct attribute_group **groups) | 364 | const struct attribute_group **groups) |
| 365 | { | 365 | { |
| 366 | int i; | 366 | int i; |
| 367 | 367 | ||
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 8ae0f63602e..ed2ebd3c287 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c | |||
| @@ -181,7 +181,7 @@ void put_driver(struct device_driver *drv) | |||
| 181 | EXPORT_SYMBOL_GPL(put_driver); | 181 | EXPORT_SYMBOL_GPL(put_driver); |
| 182 | 182 | ||
| 183 | static int driver_add_groups(struct device_driver *drv, | 183 | static int driver_add_groups(struct device_driver *drv, |
| 184 | struct attribute_group **groups) | 184 | const struct attribute_group **groups) |
| 185 | { | 185 | { |
| 186 | int error = 0; | 186 | int error = 0; |
| 187 | int i; | 187 | int i; |
| @@ -201,7 +201,7 @@ static int driver_add_groups(struct device_driver *drv, | |||
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | static void driver_remove_groups(struct device_driver *drv, | 203 | static void driver_remove_groups(struct device_driver *drv, |
| 204 | struct attribute_group **groups) | 204 | const struct attribute_group **groups) |
| 205 | { | 205 | { |
| 206 | int i; | 206 | int i; |
| 207 | 207 | ||
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 0589dfbbd7d..d8372b43282 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
| @@ -572,7 +572,7 @@ static struct attribute_group cciss_dev_attr_group = { | |||
| 572 | .attrs = cciss_dev_attrs, | 572 | .attrs = cciss_dev_attrs, |
| 573 | }; | 573 | }; |
| 574 | 574 | ||
| 575 | static struct attribute_group *cciss_dev_attr_groups[] = { | 575 | static const struct attribute_group *cciss_dev_attr_groups[] = { |
| 576 | &cciss_dev_attr_group, | 576 | &cciss_dev_attr_group, |
| 577 | NULL | 577 | NULL |
| 578 | }; | 578 | }; |
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c index 97e656af2d2..9d0dfcbe2c1 100644 --- a/drivers/firewire/core-device.c +++ b/drivers/firewire/core-device.c | |||
| @@ -312,7 +312,7 @@ static void init_fw_attribute_group(struct device *dev, | |||
| 312 | group->groups[0] = &group->group; | 312 | group->groups[0] = &group->group; |
| 313 | group->groups[1] = NULL; | 313 | group->groups[1] = NULL; |
| 314 | group->group.attrs = group->attrs; | 314 | group->group.attrs = group->attrs; |
| 315 | dev->groups = group->groups; | 315 | dev->groups = (const struct attribute_group **) group->groups; |
| 316 | } | 316 | } |
| 317 | 317 | ||
| 318 | static ssize_t modalias_show(struct device *dev, | 318 | static ssize_t modalias_show(struct device *dev, |
diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index 5a76d056b9d..dbdf6fadfc7 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c | |||
| @@ -139,7 +139,7 @@ static struct attribute_group sys_dmi_attribute_group = { | |||
| 139 | .attrs = sys_dmi_attributes, | 139 | .attrs = sys_dmi_attributes, |
| 140 | }; | 140 | }; |
| 141 | 141 | ||
| 142 | static struct attribute_group* sys_dmi_attribute_groups[] = { | 142 | static const struct attribute_group* sys_dmi_attribute_groups[] = { |
| 143 | &sys_dmi_attribute_group, | 143 | &sys_dmi_attribute_group, |
| 144 | NULL | 144 | NULL |
| 145 | }; | 145 | }; |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 5b635aa5947..fb2d83c5bf0 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
| @@ -623,7 +623,7 @@ static struct attribute_group ehca_drv_attr_grp = { | |||
| 623 | .attrs = ehca_drv_attrs | 623 | .attrs = ehca_drv_attrs |
| 624 | }; | 624 | }; |
| 625 | 625 | ||
| 626 | static struct attribute_group *ehca_drv_attr_groups[] = { | 626 | static const struct attribute_group *ehca_drv_attr_groups[] = { |
| 627 | &ehca_drv_attr_grp, | 627 | &ehca_drv_attr_grp, |
| 628 | NULL, | 628 | NULL, |
| 629 | }; | 629 | }; |
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index 6ba4861dd6a..b3d7efcdf02 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
| @@ -1286,7 +1286,7 @@ struct device_driver; | |||
| 1286 | 1286 | ||
| 1287 | extern const char ib_ipath_version[]; | 1287 | extern const char ib_ipath_version[]; |
| 1288 | 1288 | ||
| 1289 | extern struct attribute_group *ipath_driver_attr_groups[]; | 1289 | extern const struct attribute_group *ipath_driver_attr_groups[]; |
| 1290 | 1290 | ||
| 1291 | int ipath_device_create_group(struct device *, struct ipath_devdata *); | 1291 | int ipath_device_create_group(struct device *, struct ipath_devdata *); |
| 1292 | void ipath_device_remove_group(struct device *, struct ipath_devdata *); | 1292 | void ipath_device_remove_group(struct device *, struct ipath_devdata *); |
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c index a6c8efbdc0c..b8cb2f145ae 100644 --- a/drivers/infiniband/hw/ipath/ipath_sysfs.c +++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c | |||
| @@ -1069,7 +1069,7 @@ static ssize_t show_tempsense(struct device *dev, | |||
| 1069 | return ret; | 1069 | return ret; |
| 1070 | } | 1070 | } |
| 1071 | 1071 | ||
| 1072 | struct attribute_group *ipath_driver_attr_groups[] = { | 1072 | const struct attribute_group *ipath_driver_attr_groups[] = { |
| 1073 | &driver_attr_group, | 1073 | &driver_attr_group, |
| 1074 | NULL, | 1074 | NULL, |
| 1075 | }; | 1075 | }; |
diff --git a/drivers/input/input.c b/drivers/input/input.c index 7c237e6ac71..851791d955f 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -1144,7 +1144,7 @@ static struct attribute_group input_dev_caps_attr_group = { | |||
| 1144 | .attrs = input_dev_caps_attrs, | 1144 | .attrs = input_dev_caps_attrs, |
| 1145 | }; | 1145 | }; |
| 1146 | 1146 | ||
| 1147 | static struct attribute_group *input_dev_attr_groups[] = { | 1147 | static const struct attribute_group *input_dev_attr_groups[] = { |
| 1148 | &input_dev_attr_group, | 1148 | &input_dev_attr_group, |
| 1149 | &input_dev_id_attr_group, | 1149 | &input_dev_id_attr_group, |
| 1150 | &input_dev_caps_attr_group, | 1150 | &input_dev_caps_attr_group, |
diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index 7b039306037..e9eae4a7840 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c | |||
| @@ -238,7 +238,7 @@ static void enclosure_component_release(struct device *dev) | |||
| 238 | put_device(dev->parent); | 238 | put_device(dev->parent); |
| 239 | } | 239 | } |
| 240 | 240 | ||
