include/linux/property.h: fix build issues with gcc-4.4.4
[deliverable/linux.git] / include / linux / property.h
index e4f29d8b9ceb15e540562d765754d1b34df0cad9..b8c4e420fe87c2b06d1a18b1ef62466c10824367 100644 (file)
@@ -73,8 +73,8 @@ int fwnode_property_match_string(struct fwnode_handle *fwnode,
 struct fwnode_handle *device_get_next_child_node(struct device *dev,
                                                 struct fwnode_handle *child);
 
-#define device_for_each_child_node(dev, child) \
-       for (child = device_get_next_child_node(dev, NULL); child; \
+#define device_for_each_child_node(dev, child)                         \
+       for (child = device_get_next_child_node(dev, NULL); child;      \
             child = device_get_next_child_node(dev, child))
 
 void fwnode_handle_put(struct fwnode_handle *fwnode);
@@ -175,12 +175,19 @@ struct property_entry {
        };
 };
 
+/*
+ * Note: the below four initializers for the anonymous union are carefully
+ * crafted to avoid gcc-4.4.4's problems with initialization of anon unions
+ * and structs.
+ */
+
 #define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_)    \
 {                                                              \
        .name = _name_,                                         \
        .length = ARRAY_SIZE(_val_) * sizeof(_type_),           \
        .is_array = true,                                       \
-       .pointer._type_##_data = _val_,                         \
+       .is_string = false,                                     \
+       { .pointer = { _type_##_data = _val_ } },               \
 }
 
 #define PROPERTY_ENTRY_U8_ARRAY(_name_, _val_)                 \
@@ -198,14 +205,15 @@ struct property_entry {
        .length = ARRAY_SIZE(_val_) * sizeof(const char *),     \
        .is_array = true,                                       \
        .is_string = true,                                      \
-       .pointer.str = _val_,                                   \
+       { .pointer = { .str = _val_ } },                        \
 }
 
 #define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_)  \
 {                                                      \
        .name = _name_,                                 \
        .length = sizeof(_type_),                       \
-       .value._type_##_data = _val_,                   \
+       .is_string = false,                             \
+       { .value = { ._type_##_data = _val_ } },        \
 }
 
 #define PROPERTY_ENTRY_U8(_name_, _val_)               \
@@ -222,7 +230,7 @@ struct property_entry {
        .name = _name_,                                 \
        .length = sizeof(_val_),                        \
        .is_string = true,                              \
-       .value.str = _val_,                             \
+       { .value = {.str = _val_} },                    \
 }
 
 #define PROPERTY_ENTRY_BOOL(_name_)            \
@@ -240,7 +248,8 @@ struct property_set {
        struct property_entry *properties;
 };
 
-void device_add_property_set(struct device *dev, struct property_set *pset);
+int device_add_property_set(struct device *dev, const struct property_set *pset);
+void device_remove_property_set(struct device *dev);
 
 bool device_dma_supported(struct device *dev);
 
This page took 0.026003 seconds and 5 git commands to generate.