rk: gcc-wrapper.py ignore memcontrol.c:5355
[firefly-linux-kernel-4.4.55.git] / include / linux / of_platform.h
index 30ebd762063a07e8bfc4f75d41e79b4040456fce..956a1006aefc24053c643d4ad6bf653dbd2d012a 100644 (file)
@@ -13,8 +13,6 @@
 
 #include <linux/device.h>
 #include <linux/mod_devicetable.h>
-
-#ifdef CONFIG_OF_DEVICE
 #include <linux/pm.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
@@ -39,7 +37,7 @@
  * Note: Using an auxdata lookup table should be considered a last resort when
  * converting a platform to use the DT.  Normally the automatically generated
  * device name will not matter, and drivers should obtain data from the device
- * node instead of from an anonymouns platform_data pointer.
+ * node instead of from an anonymous platform_data pointer.
  */
 struct of_dev_auxdata {
        char *compatible;
@@ -53,27 +51,6 @@ struct of_dev_auxdata {
        { .compatible = _compat, .phys_addr = _phys, .name = _name, \
          .platform_data = _pdata }
 
-/**
- * of_platform_driver - Legacy of-aware driver for platform devices.
- *
- * An of_platform_driver driver is attached to a basic platform_device on
- * the ibm ebus (ibmebus_bus_type).
- */
-struct of_platform_driver
-{
-       int     (*probe)(struct platform_device* dev,
-                        const struct of_device_id *match);
-       int     (*remove)(struct platform_device* dev);
-
-       int     (*suspend)(struct platform_device* dev, pm_message_t state);
-       int     (*resume)(struct platform_device* dev);
-       int     (*shutdown)(struct platform_device* dev);
-
-       struct device_driver    driver;
-};
-#define        to_of_platform_driver(drv) \
-       container_of(drv,struct of_platform_driver, driver)
-
 extern const struct of_device_id of_default_bus_match_table[];
 
 /* Platform drivers register/unregister */
@@ -82,7 +59,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np,
                                         struct device *parent);
 extern struct platform_device *of_find_device_by_node(struct device_node *np);
 
-#ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */
 /* Platform devices and busses creation */
 extern struct platform_device *of_platform_device_create(struct device_node *np,
                                                   const char *bus_id,
@@ -91,18 +67,16 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
 extern int of_platform_bus_probe(struct device_node *root,
                                 const struct of_device_id *matches,
                                 struct device *parent);
+#ifdef CONFIG_OF_ADDRESS
 extern int of_platform_populate(struct device_node *root,
                                const struct of_device_id *matches,
                                const struct of_dev_auxdata *lookup,
                                struct device *parent);
+extern int of_platform_default_populate(struct device_node *root,
+                                       const struct of_dev_auxdata *lookup,
+                                       struct device *parent);
 extern void of_platform_depopulate(struct device *parent);
-#endif /* CONFIG_OF_ADDRESS */
-
-#endif /* CONFIG_OF_DEVICE */
-
-#if !defined(CONFIG_OF_ADDRESS)
-struct of_dev_auxdata;
-struct device_node;
+#else
 static inline int of_platform_populate(struct device_node *root,
                                        const struct of_device_id *matches,
                                        const struct of_dev_auxdata *lookup,
@@ -110,10 +84,16 @@ static inline int of_platform_populate(struct device_node *root,
 {
        return -ENODEV;
 }
+static inline int of_platform_default_populate(struct device_node *root,
+                                              const struct of_dev_auxdata *lookup,
+                                              struct device *parent)
+{
+       return -ENODEV;
+}
 static inline void of_platform_depopulate(struct device *parent) { }
 #endif
 
-#ifdef CONFIG_OF_DYNAMIC
+#if defined(CONFIG_OF_DYNAMIC) && defined(CONFIG_OF_ADDRESS)
 extern void of_platform_register_reconfig_notifier(void);
 #else
 static inline void of_platform_register_reconfig_notifier(void) { }