Browse Source

HACK: of/platform: Export of_platform_device_create_pdata()

Export of_platform_device_create_pdata() to be used by drivers to
create child devices with the given platform data. This can be used
by platform specific driver to send platform data core driver. For e.g.,
this will be used by TI's J721E SoC specific PCIe driver to send
->start_link() ops and ->is_link_up() ops to Cadence core PCIe driver.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Kishon Vijay Abraham I 6 years ago
parent
commit
5497de9820
2 changed files with 7 additions and 5 deletions
  1. 4 5
      drivers/of/platform.c
  2. 3 0
      include/linux/of_platform.h

+ 4 - 5
drivers/of/platform.c

@@ -169,11 +169,9 @@ EXPORT_SYMBOL(of_device_alloc);
  * Returns pointer to created platform device, or NULL if a device was not
  * Returns pointer to created platform device, or NULL if a device was not
  * registered.  Unavailable devices will not get registered.
  * registered.  Unavailable devices will not get registered.
  */
  */
-static struct platform_device *of_platform_device_create_pdata(
-					struct device_node *np,
-					const char *bus_id,
-					void *platform_data,
-					struct device *parent)
+struct platform_device *
+of_platform_device_create_pdata(struct device_node *np, const char *bus_id,
+				void *platform_data, struct device *parent)
 {
 {
 	struct platform_device *dev;
 	struct platform_device *dev;
 
 
@@ -203,6 +201,7 @@ err_clear_flag:
 	of_node_clear_flag(np, OF_POPULATED);
 	of_node_clear_flag(np, OF_POPULATED);
 	return NULL;
 	return NULL;
 }
 }
+EXPORT_SYMBOL(of_platform_device_create_pdata);
 
 
 /**
 /**
  * of_platform_device_create - Alloc, initialize and register an of_device
  * of_platform_device_create - Alloc, initialize and register an of_device

+ 3 - 0
include/linux/of_platform.h

@@ -70,6 +70,9 @@ extern int of_platform_device_destroy(struct device *dev, void *data);
 extern int of_platform_bus_probe(struct device_node *root,
 extern int of_platform_bus_probe(struct device_node *root,
 				 const struct of_device_id *matches,
 				 const struct of_device_id *matches,
 				 struct device *parent);
 				 struct device *parent);
+extern struct platform_device *
+of_platform_device_create_pdata(struct device_node *np, const char *bus_id,
+				void *platform_data, struct device *parent);
 #ifdef CONFIG_OF_ADDRESS
 #ifdef CONFIG_OF_ADDRESS
 extern int of_platform_populate(struct device_node *root,
 extern int of_platform_populate(struct device_node *root,
 				const struct of_device_id *matches,
 				const struct of_device_id *matches,