linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: twl4030-usb: make driver DT only
@ 2016-11-12 10:39 Nicolae Rosia
  2016-11-15 13:20 ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolae Rosia @ 2016-11-12 10:39 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: linux-kernel, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-omap, Tony Lindgren, Nicolae Rosia

All users are DT-only and it makes no sense to keep
unused code

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
---
 drivers/phy/Kconfig           |  1 +
 drivers/phy/phy-twl4030-usb.c | 22 +++++++---------------
 2 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index fe00f91..265391e 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -196,6 +196,7 @@ config TWL4030_USB
 	depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS
 	depends on USB_SUPPORT
 	depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't 'y'
+	depends on OF
 	select GENERIC_PHY
 	select USB_PHY
 	help
diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 87e6334..a5e4927 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -656,7 +656,6 @@ static const struct dev_pm_ops twl4030_usb_pm_ops = {
 
 static int twl4030_usb_probe(struct platform_device *pdev)
 {
-	struct twl4030_usb_data *pdata = dev_get_platdata(&pdev->dev);
 	struct twl4030_usb	*twl;
 	struct phy		*phy;
 	int			status, err;
@@ -664,19 +663,17 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	struct device_node	*np = pdev->dev.of_node;
 	struct phy_provider	*phy_provider;
 
+	if (!np) {
+		dev_err(&pdev->dev, "no DT info\n");
+		return -EINVAL;
+	}
+
 	twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL);
 	if (!twl)
 		return -ENOMEM;
 
-	if (np)
-		of_property_read_u32(np, "usb_mode",
-				(enum twl4030_usb_mode *)&twl->usb_mode);
-	else if (pdata) {
-		twl->usb_mode = pdata->usb_mode;
-	} else {
-		dev_err(&pdev->dev, "twl4030 initialized without pdata\n");
-		return -EINVAL;
-	}
+	of_property_read_u32(np, "usb_mode",
+			(enum twl4030_usb_mode *)&twl->usb_mode);
 
 	otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL);
 	if (!otg)
@@ -750,11 +747,6 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 		return status;
 	}
 
-	if (pdata)
-		err = phy_create_lookup(phy, "usb", "musb-hdrc.0");
-	if (err)
-		return err;
-
 	pm_runtime_mark_last_busy(&pdev->dev);
 	pm_runtime_put_autosuspend(twl->dev);
 
-- 
2.5.5

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

* Re: [PATCH] phy: twl4030-usb: make driver DT only
  2016-11-12 10:39 [PATCH] phy: twl4030-usb: make driver DT only Nicolae Rosia
@ 2016-11-15 13:20 ` Kishon Vijay Abraham I
  2016-11-15 13:26   ` Nicolae Rosia
  0 siblings, 1 reply; 4+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-15 13:20 UTC (permalink / raw)
  To: Nicolae Rosia
  Cc: linux-kernel, Felipe Balbi, Greg Kroah-Hartman, linux-usb,
	linux-omap, Tony Lindgren

Hi,

On Saturday 12 November 2016 04:09 PM, Nicolae Rosia wrote:
> All users are DT-only and it makes no sense to keep
> unused code

Are you sure about this? I still see a bunch of board files in mach-omap2 using
twl4030.

Thanks
Kishon
> 
> Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
> ---
>  drivers/phy/Kconfig           |  1 +
>  drivers/phy/phy-twl4030-usb.c | 22 +++++++---------------
>  2 files changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> index fe00f91..265391e 100644
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -196,6 +196,7 @@ config TWL4030_USB
>  	depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS
>  	depends on USB_SUPPORT
>  	depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't 'y'
> +	depends on OF
>  	select GENERIC_PHY
>  	select USB_PHY
>  	help
> diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
> index 87e6334..a5e4927 100644
> --- a/drivers/phy/phy-twl4030-usb.c
> +++ b/drivers/phy/phy-twl4030-usb.c
> @@ -656,7 +656,6 @@ static const struct dev_pm_ops twl4030_usb_pm_ops = {
>  
>  static int twl4030_usb_probe(struct platform_device *pdev)
>  {
> -	struct twl4030_usb_data *pdata = dev_get_platdata(&pdev->dev);
>  	struct twl4030_usb	*twl;
>  	struct phy		*phy;
>  	int			status, err;
> @@ -664,19 +663,17 @@ static int twl4030_usb_probe(struct platform_device *pdev)
>  	struct device_node	*np = pdev->dev.of_node;
>  	struct phy_provider	*phy_provider;
>  
> +	if (!np) {
> +		dev_err(&pdev->dev, "no DT info\n");
> +		return -EINVAL;
> +	}
> +
>  	twl = devm_kzalloc(&pdev->dev, sizeof(*twl), GFP_KERNEL);
>  	if (!twl)
>  		return -ENOMEM;
>  
> -	if (np)
> -		of_property_read_u32(np, "usb_mode",
> -				(enum twl4030_usb_mode *)&twl->usb_mode);
> -	else if (pdata) {
> -		twl->usb_mode = pdata->usb_mode;
> -	} else {
> -		dev_err(&pdev->dev, "twl4030 initialized without pdata\n");
> -		return -EINVAL;
> -	}
> +	of_property_read_u32(np, "usb_mode",
> +			(enum twl4030_usb_mode *)&twl->usb_mode);
>  
>  	otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL);
>  	if (!otg)
> @@ -750,11 +747,6 @@ static int twl4030_usb_probe(struct platform_device *pdev)
>  		return status;
>  	}
>  
> -	if (pdata)
> -		err = phy_create_lookup(phy, "usb", "musb-hdrc.0");
> -	if (err)
> -		return err;
> -
>  	pm_runtime_mark_last_busy(&pdev->dev);
>  	pm_runtime_put_autosuspend(twl->dev);
>  
> 

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

* Re: [PATCH] phy: twl4030-usb: make driver DT only
  2016-11-15 13:20 ` Kishon Vijay Abraham I
@ 2016-11-15 13:26   ` Nicolae Rosia
  2016-11-15 15:45     ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolae Rosia @ 2016-11-15 13:26 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Nicolae Rosia, linux-kernel, Felipe Balbi, Greg Kroah-Hartman,
	linux-usb, linux-omap, Tony Lindgren

Hi,

On Tue, Nov 15, 2016 at 3:20 PM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> Are you sure about this? I still see a bunch of board files in mach-omap2 using
> twl4030.
>
> Thanks
> Kishon

You are right, on v4.9 it is still used in arch/arm/mach-omap2/twl-common.c.
I forgot to mention that I'm targeting v4.10 with this. On Tony's
for-next [0], there are no users:
git grep twl4030_usb_data
drivers/phy/phy-twl4030-usb.c:  struct twl4030_usb_data *pdata =
dev_get_platdata(&pdev->dev);
drivers/usb/phy/phy-twl6030-usb.c:      struct twl4030_usb_data *pdata
= dev_get_platdata(dev);
include/linux/i2c/twl.h:struct twl4030_usb_data {
include/linux/i2c/twl.h:        struct twl4030_usb_data                 *usb;

Thanks,
Nicolae

[0] https://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/log/?h=for-next

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

* Re: [PATCH] phy: twl4030-usb: make driver DT only
  2016-11-15 13:26   ` Nicolae Rosia
@ 2016-11-15 15:45     ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2016-11-15 15:45 UTC (permalink / raw)
  To: Nicolae Rosia
  Cc: Kishon Vijay Abraham I, Nicolae Rosia, linux-kernel,
	Felipe Balbi, Greg Kroah-Hartman, linux-usb, linux-omap

* Nicolae Rosia <nicolae.rosia.oss@gmail.com> [161115 05:26]:
> Hi,
> 
> On Tue, Nov 15, 2016 at 3:20 PM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
> > Are you sure about this? I still see a bunch of board files in mach-omap2 using
> > twl4030.
> >
> > Thanks
> > Kishon
> 
> You are right, on v4.9 it is still used in arch/arm/mach-omap2/twl-common.c.
> I forgot to mention that I'm targeting v4.10 with this. On Tony's
> for-next [0], there are no users:
> git grep twl4030_usb_data
> drivers/phy/phy-twl4030-usb.c:  struct twl4030_usb_data *pdata =
> dev_get_platdata(&pdev->dev);
> drivers/usb/phy/phy-twl6030-usb.c:      struct twl4030_usb_data *pdata
> = dev_get_platdata(dev);
> include/linux/i2c/twl.h:struct twl4030_usb_data {
> include/linux/i2c/twl.h:        struct twl4030_usb_data                 *usb;

Yeah might be worht waiting on the omap3 specific driver changes until
v4.11 merge window unless the changes are blocking twl core clean up work.

Regards,

Tony

> [0] https://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/log/?h=for-next

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

end of thread, other threads:[~2016-11-15 15:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-12 10:39 [PATCH] phy: twl4030-usb: make driver DT only Nicolae Rosia
2016-11-15 13:20 ` Kishon Vijay Abraham I
2016-11-15 13:26   ` Nicolae Rosia
2016-11-15 15:45     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).