drivers/base: Mark (of|platform)_device_id data as constant
There should be no reason to ever change the data pointed to by id_table or of_compatible. So make this offical by adding some 'const's. In Linux the corresponding pointers are marked as const, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
f49f067bdd
commit
fd678c4973
|
@ -58,7 +58,7 @@ int device_match(struct device_d *dev, struct driver_d *drv)
|
|||
return 0;
|
||||
|
||||
if (drv->id_table) {
|
||||
struct platform_device_id *id = drv->id_table;
|
||||
const struct platform_device_id *id = drv->id_table;
|
||||
|
||||
while (id->name) {
|
||||
if (!strcmp(id->name, dev->name)) {
|
||||
|
@ -74,7 +74,7 @@ int device_match(struct device_d *dev, struct driver_d *drv)
|
|||
|
||||
int device_match_of_modalias(struct device_d *dev, struct driver_d *drv)
|
||||
{
|
||||
struct platform_device_id *id = drv->id_table;
|
||||
const struct platform_device_id *id = drv->id_table;
|
||||
const char *of_modalias = NULL, *p;
|
||||
int cplen;
|
||||
const char *compat;
|
||||
|
|
|
@ -77,7 +77,7 @@ struct device_d {
|
|||
|
||||
struct list_head cdevs;
|
||||
|
||||
struct platform_device_id *id_entry;
|
||||
const struct platform_device_id *id_entry;
|
||||
struct device_node *device_node;
|
||||
|
||||
const struct of_device_id *of_id_entry;
|
||||
|
@ -107,8 +107,8 @@ struct driver_d {
|
|||
|
||||
struct bus_type *bus;
|
||||
|
||||
struct platform_device_id *id_table;
|
||||
struct of_device_id *of_compatible;
|
||||
const struct platform_device_id *id_table;
|
||||
const struct of_device_id *of_compatible;
|
||||
};
|
||||
|
||||
/*@}*/ /* do not delete, doxygen relevant */
|
||||
|
|
Loading…
Reference in New Issue