diff options
| author | Grant Likely <grant.likely@secretlab.ca> | 2011-01-21 11:24:48 -0500 |
|---|---|---|
| committer | Grant Likely <grant.likely@secretlab.ca> | 2011-01-21 11:24:48 -0500 |
| commit | c9e358dfc4a8cb2227172ef77908c2e0ee17bcb9 (patch) | |
| tree | 0bba0d79151fc7fab5feb6f9507ec9748b2ba587 /include | |
| parent | c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470 (diff) | |
driver-core: remove conditionals around devicetree pointers
Having conditional around the of_match_table and the of_node pointers
turns out to make driver code use ugly #ifdef blocks. Drop the
conditionals and remove the #ifdef blocks from the affected drivers.
Also tidy up minor whitespace issues within the same hunks.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/device.h | 7 | ||||
| -rw-r--r-- | include/linux/i2c.h | 2 | ||||
| -rw-r--r-- | include/linux/of.h | 4 |
3 files changed, 4 insertions, 9 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 1bf5cf0b4513..ca5d25225aab 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -128,9 +128,7 @@ struct device_driver { | |||
| 128 | 128 | ||
| 129 | bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ | 129 | bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ |
| 130 | 130 | ||
| 131 | #if defined(CONFIG_OF) | ||
| 132 | const struct of_device_id *of_match_table; | 131 | const struct of_device_id *of_match_table; |
| 133 | #endif | ||
| 134 | 132 | ||
| 135 | int (*probe) (struct device *dev); | 133 | int (*probe) (struct device *dev); |
| 136 | int (*remove) (struct device *dev); | 134 | int (*remove) (struct device *dev); |
| @@ -441,9 +439,8 @@ struct device { | |||
| 441 | override */ | 439 | override */ |
| 442 | /* arch specific additions */ | 440 | /* arch specific additions */ |
| 443 | struct dev_archdata archdata; | 441 | struct dev_archdata archdata; |
| 444 | #ifdef CONFIG_OF | 442 | |
| 445 | struct device_node *of_node; | 443 | struct device_node *of_node; /* associated device tree node */ |
| 446 | #endif | ||
| 447 | 444 | ||
| 448 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 445 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
| 449 | 446 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 903576df88dc..06a8d9c7de98 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -258,9 +258,7 @@ struct i2c_board_info { | |||
| 258 | unsigned short addr; | 258 | unsigned short addr; |
| 259 | void *platform_data; | 259 | void *platform_data; |
| 260 | struct dev_archdata *archdata; | 260 | struct dev_archdata *archdata; |
| 261 | #ifdef CONFIG_OF | ||
| 262 | struct device_node *of_node; | 261 | struct device_node *of_node; |
| 263 | #endif | ||
| 264 | int irq; | 262 | int irq; |
| 265 | }; | 263 | }; |
| 266 | 264 | ||
diff --git a/include/linux/of.h b/include/linux/of.h index cad7cf0ab278..d9dd664a6a9c 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -23,8 +23,6 @@ | |||
| 23 | 23 | ||
| 24 | #include <asm/byteorder.h> | 24 | #include <asm/byteorder.h> |
| 25 | 25 | ||
| 26 | #ifdef CONFIG_OF | ||
| 27 | |||
| 28 | typedef u32 phandle; | 26 | typedef u32 phandle; |
| 29 | typedef u32 ihandle; | 27 | typedef u32 ihandle; |
| 30 | 28 | ||
| @@ -65,6 +63,8 @@ struct device_node { | |||
| 65 | #endif | 63 | #endif |
| 66 | }; | 64 | }; |
| 67 | 65 | ||
| 66 | #ifdef CONFIG_OF | ||
| 67 | |||
| 68 | /* Pointer for first entry in chain of all nodes. */ | 68 | /* Pointer for first entry in chain of all nodes. */ |
| 69 | extern struct device_node *allnodes; | 69 | extern struct device_node *allnodes; |
| 70 | extern struct device_node *of_chosen; | 70 | extern struct device_node *of_chosen; |
