All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
@ 2017-10-28 10:26 ` Viresh Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Viresh Kumar @ 2017-10-28 10:26 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand
  Cc: Viresh Kumar, Vincent Guittot, devicetree, linux-kernel

Few routines don't have their dummy counterparts which results in build
failures where these routines are used without CONFIG_OF_ADDRESS
enabled.

Fix those by defining the dummy versions.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V2:
- Rebased again latest rc and resolved conflicts.
- No comments received on V1.

 include/linux/of_platform.h | 39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index fb908e598348..8a561e08bc9e 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -52,11 +52,6 @@ struct of_dev_auxdata {
 	  .platform_data = _pdata }
 
 extern const struct of_device_id of_default_bus_match_table[];
-
-/* Platform drivers register/unregister */
-extern struct platform_device *of_device_alloc(struct device_node *np,
-					 const char *bus_id,
-					 struct device *parent);
 #ifdef CONFIG_OF
 extern struct platform_device *of_find_device_by_node(struct device_node *np);
 #else
@@ -66,6 +61,12 @@ static inline struct platform_device *of_find_device_by_node(struct device_node
 }
 #endif
 
+#ifdef CONFIG_OF_ADDRESS
+/* Platform drivers register/unregister */
+extern struct platform_device *of_device_alloc(struct device_node *np,
+					 const char *bus_id,
+					 struct device *parent);
+
 /* Platform devices and busses creation */
 extern struct platform_device *of_platform_device_create(struct device_node *np,
 						   const char *bus_id,
@@ -75,7 +76,6 @@ extern int of_platform_device_destroy(struct device *dev, void *data);
 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,
@@ -89,6 +89,33 @@ extern int devm_of_platform_populate(struct device *dev);
 
 extern void devm_of_platform_depopulate(struct device *dev);
 #else
+static inline struct platform_device *
+of_device_alloc(struct device_node *np, const char *bus_id,
+		struct device *parent)
+{
+	return NULL;
+}
+
+/* Platform devices and busses creation */
+static inline struct platform_device *
+of_platform_device_create(struct device_node *np, const char *bus_id,
+			  struct device *parent)
+{
+	return NULL;
+}
+
+static inline int of_platform_device_destroy(struct device *dev, void *data)
+{
+	return -ENODEV;
+}
+
+static inline int of_platform_bus_probe(struct device_node *root,
+					const struct of_device_id *matches,
+					struct device *parent)
+{
+	return -ENODEV;
+}
+
 static inline int of_platform_populate(struct device_node *root,
 					const struct of_device_id *matches,
 					const struct of_dev_auxdata *lookup,
-- 
2.15.0.rc1.236.g92ea95045093

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
@ 2017-10-28 10:26 ` Viresh Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Viresh Kumar @ 2017-10-28 10:26 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand
  Cc: Viresh Kumar, Vincent Guittot, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Few routines don't have their dummy counterparts which results in build
failures where these routines are used without CONFIG_OF_ADDRESS
enabled.

Fix those by defining the dummy versions.

Signed-off-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
V2:
- Rebased again latest rc and resolved conflicts.
- No comments received on V1.

 include/linux/of_platform.h | 39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index fb908e598348..8a561e08bc9e 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -52,11 +52,6 @@ struct of_dev_auxdata {
 	  .platform_data = _pdata }
 
 extern const struct of_device_id of_default_bus_match_table[];
-
-/* Platform drivers register/unregister */
-extern struct platform_device *of_device_alloc(struct device_node *np,
-					 const char *bus_id,
-					 struct device *parent);
 #ifdef CONFIG_OF
 extern struct platform_device *of_find_device_by_node(struct device_node *np);
 #else
@@ -66,6 +61,12 @@ static inline struct platform_device *of_find_device_by_node(struct device_node
 }
 #endif
 
+#ifdef CONFIG_OF_ADDRESS
+/* Platform drivers register/unregister */
+extern struct platform_device *of_device_alloc(struct device_node *np,
+					 const char *bus_id,
+					 struct device *parent);
+
 /* Platform devices and busses creation */
 extern struct platform_device *of_platform_device_create(struct device_node *np,
 						   const char *bus_id,
@@ -75,7 +76,6 @@ extern int of_platform_device_destroy(struct device *dev, void *data);
 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,
@@ -89,6 +89,33 @@ extern int devm_of_platform_populate(struct device *dev);
 
 extern void devm_of_platform_depopulate(struct device *dev);
 #else
+static inline struct platform_device *
+of_device_alloc(struct device_node *np, const char *bus_id,
+		struct device *parent)
+{
+	return NULL;
+}
+
+/* Platform devices and busses creation */
+static inline struct platform_device *
+of_platform_device_create(struct device_node *np, const char *bus_id,
+			  struct device *parent)
+{
+	return NULL;
+}
+
+static inline int of_platform_device_destroy(struct device *dev, void *data)
+{
+	return -ENODEV;
+}
+
+static inline int of_platform_bus_probe(struct device_node *root,
+					const struct of_device_id *matches,
+					struct device *parent)
+{
+	return -ENODEV;
+}
+
 static inline int of_platform_populate(struct device_node *root,
 					const struct of_device_id *matches,
 					const struct of_dev_auxdata *lookup,
-- 
2.15.0.rc1.236.g92ea95045093

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
  2017-10-28 10:26 ` Viresh Kumar
  (?)
@ 2017-11-01 21:14 ` Rob Herring
  2017-11-02  4:48     ` Viresh Kumar
  -1 siblings, 1 reply; 9+ messages in thread
From: Rob Herring @ 2017-11-01 21:14 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: Frank Rowand, Vincent Guittot, devicetree, linux-kernel

On Sat, Oct 28, 2017 at 03:56:46PM +0530, Viresh Kumar wrote:
> Few routines don't have their dummy counterparts which results in build
> failures where these routines are used without CONFIG_OF_ADDRESS
> enabled.
> 
> Fix those by defining the dummy versions.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> V2:
> - Rebased again latest rc and resolved conflicts.
> - No comments received on V1.

What's your user?

>  include/linux/of_platform.h | 39 +++++++++++++++++++++++++++++++++------
>  1 file changed, 33 insertions(+), 6 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
  2017-11-01 21:14 ` Rob Herring
@ 2017-11-02  4:48     ` Viresh Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Viresh Kumar @ 2017-11-02  4:48 UTC (permalink / raw)
  To: Rob Herring; +Cc: Frank Rowand, Vincent Guittot, devicetree, linux-kernel

On 01-11-17, 16:14, Rob Herring wrote:
> On Sat, Oct 28, 2017 at 03:56:46PM +0530, Viresh Kumar wrote:
> > Few routines don't have their dummy counterparts which results in build
> > failures where these routines are used without CONFIG_OF_ADDRESS
> > enabled.
> > 
> > Fix those by defining the dummy versions.
> > 
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> > V2:
> > - Rebased again latest rc and resolved conflicts.
> > - No comments received on V1.
> 
> What's your user?

It was the previous version of boot constraint core, though I have
moved to another helper now.

https://marc.info/?l=linux-kernel&m=150157976217258&w=2

Wouldn't it be better to define them anyway?

-- 
viresh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
@ 2017-11-02  4:48     ` Viresh Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Viresh Kumar @ 2017-11-02  4:48 UTC (permalink / raw)
  To: Rob Herring
  Cc: Frank Rowand, Vincent Guittot, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 01-11-17, 16:14, Rob Herring wrote:
> On Sat, Oct 28, 2017 at 03:56:46PM +0530, Viresh Kumar wrote:
> > Few routines don't have their dummy counterparts which results in build
> > failures where these routines are used without CONFIG_OF_ADDRESS
> > enabled.
> > 
> > Fix those by defining the dummy versions.
> > 
> > Signed-off-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > ---
> > V2:
> > - Rebased again latest rc and resolved conflicts.
> > - No comments received on V1.
> 
> What's your user?

It was the previous version of boot constraint core, though I have
moved to another helper now.

https://marc.info/?l=linux-kernel&m=150157976217258&w=2

Wouldn't it be better to define them anyway?

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
  2017-11-02  4:48     ` Viresh Kumar
@ 2017-11-02 12:40       ` Rob Herring
  -1 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2017-11-02 12:40 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: Frank Rowand, Vincent Guittot, devicetree, linux-kernel

On Wed, Nov 1, 2017 at 11:48 PM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> On 01-11-17, 16:14, Rob Herring wrote:
>> On Sat, Oct 28, 2017 at 03:56:46PM +0530, Viresh Kumar wrote:
>> > Few routines don't have their dummy counterparts which results in build
>> > failures where these routines are used without CONFIG_OF_ADDRESS
>> > enabled.
>> >
>> > Fix those by defining the dummy versions.
>> >
>> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>> > ---
>> > V2:
>> > - Rebased again latest rc and resolved conflicts.
>> > - No comments received on V1.
>>
>> What's your user?
>
> It was the previous version of boot constraint core, though I have
> moved to another helper now.
>
> https://marc.info/?l=linux-kernel&m=150157976217258&w=2
>
> Wouldn't it be better to define them anyway?

No. As an example, ideally of_device_alloc would be an internal
function. But we have one user in ibmebus.

Rob

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
@ 2017-11-02 12:40       ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2017-11-02 12:40 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Frank Rowand, Vincent Guittot, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Wed, Nov 1, 2017 at 11:48 PM, Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On 01-11-17, 16:14, Rob Herring wrote:
>> On Sat, Oct 28, 2017 at 03:56:46PM +0530, Viresh Kumar wrote:
>> > Few routines don't have their dummy counterparts which results in build
>> > failures where these routines are used without CONFIG_OF_ADDRESS
>> > enabled.
>> >
>> > Fix those by defining the dummy versions.
>> >
>> > Signed-off-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>> > ---
>> > V2:
>> > - Rebased again latest rc and resolved conflicts.
>> > - No comments received on V1.
>>
>> What's your user?
>
> It was the previous version of boot constraint core, though I have
> moved to another helper now.
>
> https://marc.info/?l=linux-kernel&m=150157976217258&w=2
>
> Wouldn't it be better to define them anyway?

No. As an example, ideally of_device_alloc would be an internal
function. But we have one user in ibmebus.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
@ 2017-11-03  3:43         ` Viresh Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Viresh Kumar @ 2017-11-03  3:43 UTC (permalink / raw)
  To: Rob Herring; +Cc: Frank Rowand, Vincent Guittot, devicetree, linux-kernel

On 02-11-17, 07:40, Rob Herring wrote:
> No. As an example, ideally of_device_alloc would be an internal
> function. But we have one user in ibmebus.

Okay. Lets abandon this change then.

-- 
viresh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS
@ 2017-11-03  3:43         ` Viresh Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Viresh Kumar @ 2017-11-03  3:43 UTC (permalink / raw)
  To: Rob Herring
  Cc: Frank Rowand, Vincent Guittot, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 02-11-17, 07:40, Rob Herring wrote:
> No. As an example, ideally of_device_alloc would be an internal
> function. But we have one user in ibmebus.

Okay. Lets abandon this change then.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-11-03  3:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-28 10:26 [PATCH V2] of: platform: Create dummy routines for !CONFIG_OF_ADDRESS Viresh Kumar
2017-10-28 10:26 ` Viresh Kumar
2017-11-01 21:14 ` Rob Herring
2017-11-02  4:48   ` Viresh Kumar
2017-11-02  4:48     ` Viresh Kumar
2017-11-02 12:40     ` Rob Herring
2017-11-02 12:40       ` Rob Herring
2017-11-03  3:43       ` Viresh Kumar
2017-11-03  3:43         ` Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.