All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
@ 2015-03-05 10:18 Axel Lin
  2015-03-05 10:20 ` [PATCH 2/3] phy: omap-usb2: " Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Axel Lin @ 2015-03-05 10:18 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Vignesh R, Roger Quadros, George Cherian, Felipe Balbi, linux-kernel

if !CONFIG_OF, the probe fails.
This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are
not needed.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/phy/phy-omap-control.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c
index efe724f..a7653d9 100644
--- a/drivers/phy/phy-omap-control.c
+++ b/drivers/phy/phy-omap-control.c
@@ -216,7 +216,6 @@ void omap_control_usb_set_mode(struct device *dev,
 		return;
 
 	ctrl_phy = dev_get_drvdata(dev);
-
 	if (!ctrl_phy) {
 		dev_err(dev, "Invalid control phy device\n");
 		return;
@@ -241,8 +240,6 @@ void omap_control_usb_set_mode(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(omap_control_usb_set_mode);
 
-#ifdef CONFIG_OF
-
 static const enum omap_control_phy_type otghs_data = OMAP_CTRL_TYPE_OTGHS;
 static const enum omap_control_phy_type usb2_data = OMAP_CTRL_TYPE_USB2;
 static const enum omap_control_phy_type pipe3_data = OMAP_CTRL_TYPE_PIPE3;
@@ -278,8 +275,6 @@ static const struct of_device_id omap_control_phy_id_table[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, omap_control_phy_id_table);
-#endif
-
 
 static int omap_control_phy_probe(struct platform_device *pdev)
 {
@@ -287,8 +282,7 @@ static int omap_control_phy_probe(struct platform_device *pdev)
 	const struct of_device_id *of_id;
 	struct omap_control_phy *control_phy;
 
-	of_id = of_match_device(of_match_ptr(omap_control_phy_id_table),
-				&pdev->dev);
+	of_id = of_match_device(omap_control_phy_id_table, &pdev->dev);
 	if (!of_id)
 		return -EINVAL;
 
@@ -344,7 +338,7 @@ static struct platform_driver omap_control_phy_driver = {
 	.probe		= omap_control_phy_probe,
 	.driver		= {
 		.name	= "omap-control-phy",
-		.of_match_table = of_match_ptr(omap_control_phy_id_table),
+		.of_match_table = omap_control_phy_id_table,
 	},
 };
 
-- 
1.9.1




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

* [PATCH 2/3] phy: omap-usb2: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
  2015-03-05 10:18 [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr Axel Lin
@ 2015-03-05 10:20 ` Axel Lin
  2015-03-05 10:20 ` [PATCH 3/3] phy: ti-pipe3: " Axel Lin
  2015-03-05 10:48 ` [PATCH 1/3] phy: omap-control: " Roger Quadros
  2 siblings, 0 replies; 7+ messages in thread
From: Axel Lin @ 2015-03-05 10:20 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Vignesh R, Roger Quadros, Felipe Balbi, linux-kernel

if !CONFIG_OF, the probe fails.
This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are
not needed.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/phy/phy-omap-usb2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c
index 6f4aef3..18b33ce 100644
--- a/drivers/phy/phy-omap-usb2.c
+++ b/drivers/phy/phy-omap-usb2.c
@@ -144,7 +144,6 @@ static struct phy_ops ops = {
 	.owner		= THIS_MODULE,
 };
 
-#ifdef CONFIG_OF
 static const struct usb_phy_data omap_usb2_data = {
 	.label = "omap_usb2",
 	.flags = OMAP_USB2_HAS_START_SRP | OMAP_USB2_HAS_SET_VBUS,
@@ -185,7 +184,6 @@ static const struct of_device_id omap_usb2_id_table[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, omap_usb2_id_table);
-#endif
 
 static int omap_usb2_probe(struct platform_device *pdev)
 {
@@ -200,7 +198,7 @@ static int omap_usb2_probe(struct platform_device *pdev)
 	const struct of_device_id *of_id;
 	struct usb_phy_data *phy_data;
 
-	of_id = of_match_device(of_match_ptr(omap_usb2_id_table), &pdev->dev);
+	of_id = of_match_device(omap_usb2_id_table, &pdev->dev);
 
 	if (!of_id)
 		return -EINVAL;
@@ -377,7 +375,7 @@ static struct platform_driver omap_usb2_driver = {
 	.driver		= {
 		.name	= "omap-usb2",
 		.pm	= DEV_PM_OPS,
-		.of_match_table = of_match_ptr(omap_usb2_id_table),
+		.of_match_table = omap_usb2_id_table,
 	},
 };
 
-- 
1.9.1




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

* [PATCH 3/3] phy: ti-pipe3: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
  2015-03-05 10:18 [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr Axel Lin
  2015-03-05 10:20 ` [PATCH 2/3] phy: omap-usb2: " Axel Lin
@ 2015-03-05 10:20 ` Axel Lin
  2015-03-05 10:48 ` [PATCH 1/3] phy: omap-control: " Roger Quadros
  2 siblings, 0 replies; 7+ messages in thread
From: Axel Lin @ 2015-03-05 10:20 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Vignesh R, Roger Quadros, Felipe Balbi, linux-kernel

if !CONFIG_OF, the probe fails.
This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are
not needed.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/phy/phy-ti-pipe3.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c
index 95c88f9..ad3fbc8 100644
--- a/drivers/phy/phy-ti-pipe3.c
+++ b/drivers/phy/phy-ti-pipe3.c
@@ -291,9 +291,7 @@ static struct phy_ops ops = {
 	.owner		= THIS_MODULE,
 };
 
-#ifdef CONFIG_OF
 static const struct of_device_id ti_pipe3_id_table[];
-#endif
 
 static int ti_pipe3_probe(struct platform_device *pdev)
 {
@@ -315,8 +313,7 @@ static int ti_pipe3_probe(struct platform_device *pdev)
 	spin_lock_init(&phy->lock);
 
 	if (!of_device_is_compatible(node, "ti,phy-pipe3-pcie")) {
-		match = of_match_device(of_match_ptr(ti_pipe3_id_table),
-					&pdev->dev);
+		match = of_match_device(ti_pipe3_id_table, &pdev->dev);
 		if (!match)
 			return -EINVAL;
 
@@ -574,7 +571,6 @@ static const struct dev_pm_ops ti_pipe3_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(ti_pipe3_suspend, ti_pipe3_resume)
 };
 
-#ifdef CONFIG_OF
 static const struct of_device_id ti_pipe3_id_table[] = {
 	{
 		.compatible = "ti,phy-usb3",
@@ -594,7 +590,6 @@ static const struct of_device_id ti_pipe3_id_table[] = {
 	{}
 };
 MODULE_DEVICE_TABLE(of, ti_pipe3_id_table);
-#endif
 
 static struct platform_driver ti_pipe3_driver = {
 	.probe		= ti_pipe3_probe,
@@ -602,7 +597,7 @@ static struct platform_driver ti_pipe3_driver = {
 	.driver		= {
 		.name	= "ti-pipe3",
 		.pm	= &ti_pipe3_pm_ops,
-		.of_match_table = of_match_ptr(ti_pipe3_id_table),
+		.of_match_table = ti_pipe3_id_table,
 	},
 };
 
-- 
1.9.1




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

* Re: [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
  2015-03-05 10:18 [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr Axel Lin
  2015-03-05 10:20 ` [PATCH 2/3] phy: omap-usb2: " Axel Lin
  2015-03-05 10:20 ` [PATCH 3/3] phy: ti-pipe3: " Axel Lin
@ 2015-03-05 10:48 ` Roger Quadros
  2015-03-05 15:29   ` Axel Lin
  2 siblings, 1 reply; 7+ messages in thread
From: Roger Quadros @ 2015-03-05 10:48 UTC (permalink / raw)
  To: Axel Lin, Kishon Vijay Abraham I; +Cc: Vignesh R, Felipe Balbi, linux-kernel

Hi Alex,

On 05/03/15 12:18, Axel Lin wrote:
> if !CONFIG_OF, the probe fails.
> This is a dt-only driver, so the ifdef CONFIG_OF guard and of_match_ptr are
> not needed.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/phy/phy-omap-control.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/phy/phy-omap-control.c b/drivers/phy/phy-omap-control.c
> index efe724f..a7653d9 100644
> --- a/drivers/phy/phy-omap-control.c
> +++ b/drivers/phy/phy-omap-control.c
> @@ -216,7 +216,6 @@ void omap_control_usb_set_mode(struct device *dev,
>  		return;
>  
>  	ctrl_phy = dev_get_drvdata(dev);
> -
>  	if (!ctrl_phy) {
>  		dev_err(dev, "Invalid control phy device\n");
>  		return;
> @@ -241,8 +240,6 @@ void omap_control_usb_set_mode(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(omap_control_usb_set_mode);
>  
> -#ifdef CONFIG_OF
> -
>  static const enum omap_control_phy_type otghs_data = OMAP_CTRL_TYPE_OTGHS;
>  static const enum omap_control_phy_type usb2_data = OMAP_CTRL_TYPE_USB2;
>  static const enum omap_control_phy_type pipe3_data = OMAP_CTRL_TYPE_PIPE3;
> @@ -278,8 +275,6 @@ static const struct of_device_id omap_control_phy_id_table[] = {
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, omap_control_phy_id_table);
> -#endif
> -

Since we're anyways going to fail probe for !CONFIG_OF, why do you want to
add the unnecessary device table to the kernel?

what are you benefiting from this change?

>  
>  static int omap_control_phy_probe(struct platform_device *pdev)
>  {
> @@ -287,8 +282,7 @@ static int omap_control_phy_probe(struct platform_device *pdev)
>  	const struct of_device_id *of_id;
>  	struct omap_control_phy *control_phy;
>  
> -	of_id = of_match_device(of_match_ptr(omap_control_phy_id_table),
> -				&pdev->dev);
> +	of_id = of_match_device(omap_control_phy_id_table, &pdev->dev);
>  	if (!of_id)
>  		return -EINVAL;
>  
> @@ -344,7 +338,7 @@ static struct platform_driver omap_control_phy_driver = {
>  	.probe		= omap_control_phy_probe,
>  	.driver		= {
>  		.name	= "omap-control-phy",
> -		.of_match_table = of_match_ptr(omap_control_phy_id_table),
> +		.of_match_table = omap_control_phy_id_table,
>  	},
>  };
>  
> 

cheers,
-roger

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

* Re: [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
  2015-03-05 10:48 ` [PATCH 1/3] phy: omap-control: " Roger Quadros
@ 2015-03-05 15:29   ` Axel Lin
  2015-03-06 10:06     ` Roger Quadros
  0 siblings, 1 reply; 7+ messages in thread
From: Axel Lin @ 2015-03-05 15:29 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Kishon Vijay Abraham I, Vignesh R, Felipe Balbi, linux-kernel

2015-03-05 18:48 GMT+08:00 Roger Quadros <rogerq@ti.com>:
> Hi Alex,
It's Axel.

>
> Since we're anyways going to fail probe for !CONFIG_OF, why do you want to
> add the unnecessary device table to the kernel?
>
> what are you benefiting from this change?

If the driver works for both dt case and non-dt case, using the ifdef CONFIG_OF
guard can save a few memory for non-dt case.
For dt-only  driver it is not required because you cannot use the driver
if !CONFIG_OF. Which means you should not build this driver at all if !CONFIG_OF
unless you just want to do compile test.

Regards,
Axel

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

* Re: [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
  2015-03-05 15:29   ` Axel Lin
@ 2015-03-06 10:06     ` Roger Quadros
  2015-03-09  5:11       ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 7+ messages in thread
From: Roger Quadros @ 2015-03-06 10:06 UTC (permalink / raw)
  To: Axel Lin; +Cc: Kishon Vijay Abraham I, Vignesh R, Felipe Balbi, linux-kernel

On 05/03/15 17:29, Axel Lin wrote:
> 2015-03-05 18:48 GMT+08:00 Roger Quadros <rogerq@ti.com>:
>> Hi Alex,
> It's Axel.

My apologies Axel.

> 
>>
>> Since we're anyways going to fail probe for !CONFIG_OF, why do you want to
>> add the unnecessary device table to the kernel?
>>
>> what are you benefiting from this change?
> 
> If the driver works for both dt case and non-dt case, using the ifdef CONFIG_OF
> guard can save a few memory for non-dt case.
> For dt-only  driver it is not required because you cannot use the driver
> if !CONFIG_OF. Which means you should not build this driver at all if !CONFIG_OF
> unless you just want to do compile test.

I agree. Kishon do we really need to build these drivers if !CONFIG_OF?

cheers,
-roger

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

* Re: [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr
  2015-03-06 10:06     ` Roger Quadros
@ 2015-03-09  5:11       ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 7+ messages in thread
From: Kishon Vijay Abraham I @ 2015-03-09  5:11 UTC (permalink / raw)
  To: Roger Quadros, Axel Lin; +Cc: Vignesh R, Felipe Balbi, linux-kernel

Hi,

On Friday 06 March 2015 03:36 PM, Roger Quadros wrote:
> On 05/03/15 17:29, Axel Lin wrote:
>> 2015-03-05 18:48 GMT+08:00 Roger Quadros <rogerq@ti.com>:
>>> Hi Alex,
>> It's Axel.
>
> My apologies Axel.
>
>>
>>>
>>> Since we're anyways going to fail probe for !CONFIG_OF, why do you want to
>>> add the unnecessary device table to the kernel?
>>>
>>> what are you benefiting from this change?
>>
>> If the driver works for both dt case and non-dt case, using the ifdef CONFIG_OF
>> guard can save a few memory for non-dt case.
>> For dt-only  driver it is not required because you cannot use the driver
>> if !CONFIG_OF. Which means you should not build this driver at all if !CONFIG_OF
>> unless you just want to do compile test.
>
> I agree. Kishon do we really need to build these drivers if !CONFIG_OF?

We can stop building these drivers for !CONFIG_OF since none of the platforms
which uses these drivers support non-dt anyway.

Cheers
Kishon

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

end of thread, other threads:[~2015-03-09  5:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05 10:18 [PATCH 1/3] phy: omap-control: Remove unneeded ifdef CONFIG_OF guard and of_match_ptr Axel Lin
2015-03-05 10:20 ` [PATCH 2/3] phy: omap-usb2: " Axel Lin
2015-03-05 10:20 ` [PATCH 3/3] phy: ti-pipe3: " Axel Lin
2015-03-05 10:48 ` [PATCH 1/3] phy: omap-control: " Roger Quadros
2015-03-05 15:29   ` Axel Lin
2015-03-06 10:06     ` Roger Quadros
2015-03-09  5:11       ` Kishon Vijay Abraham I

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.