Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [PATCH] usb: phy: fix twl4030 build regression
@ 2014-11-11  9:36 Arnd Bergmann
  2014-11-11 14:52 ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2014-11-11  9:36 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Antoine Tenart, Kishon Vijay Abraham I, Tony Lindgren,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Recent changes to the common OTG handling broke building the twl4030
OTG driver as found during an allmodconfig build of linux-next:

drivers/phy/phy-twl4030-usb.c: In function 'twl4030_set_peripheral':
drivers/phy/phy-twl4030-usb.c:609:11: error: 'struct phy' has no member named 'state'
drivers/phy/phy-twl4030-usb.c: In function 'twl4030_usb_probe':
drivers/phy/phy-twl4030-usb.c:679:12: warning: assignment from incompatible pointer type

This applies the same changes that were done to the other phy drivers
to get it to build cleanly.

Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Fixes: 19c1eac2685b6 ("usb: rename phy to usb_phy in OTG")
Fixes: e47d92545c297 ("usb: move the OTG state from the USB PHY to the OTG structure")
---

I have no idea if this is the correct fix, this is just a mechanical
conversion, so please review carefully.

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 7b04befd5271..e2698d29f436 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -606,7 +606,7 @@ static int twl4030_set_peripheral(struct usb_otg *otg,
 
 	otg->gadget = gadget;
 	if (!gadget)
-		otg->phy->state = OTG_STATE_UNDEFINED;
+		otg->state = OTG_STATE_UNDEFINED;
 
 	return 0;
 }
@@ -618,7 +618,7 @@ static int twl4030_set_host(struct usb_otg *otg, struct usb_bus *host)
 
 	otg->host = host;
 	if (!host)
-		otg->phy->state = OTG_STATE_UNDEFINED;
+		otg->state = OTG_STATE_UNDEFINED;
 
 	return 0;
 }
@@ -676,7 +676,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	twl->phy.otg		= otg;
 	twl->phy.type		= USB_PHY_TYPE_USB2;
 
-	otg->phy		= &twl->phy;
+	otg->usb_phy		= &twl->phy;
 	otg->set_host		= twl4030_set_host;
 	otg->set_peripheral	= twl4030_set_peripheral;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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] 3+ messages in thread

* Re: [PATCH] usb: phy: fix twl4030 build regression
  2014-11-11  9:36 [PATCH] usb: phy: fix twl4030 build regression Arnd Bergmann
@ 2014-11-11 14:52 ` Felipe Balbi
  2014-11-11 14:53   ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2014-11-11 14:52 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Felipe Balbi, Antoine Tenart, Kishon Vijay Abraham I,
	Tony Lindgren, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

[-- Attachment #1: Type: text/plain, Size: 2254 bytes --]

On Tue, Nov 11, 2014 at 10:36:09AM +0100, Arnd Bergmann wrote:
> Recent changes to the common OTG handling broke building the twl4030
> OTG driver as found during an allmodconfig build of linux-next:
> 
> drivers/phy/phy-twl4030-usb.c: In function 'twl4030_set_peripheral':
> drivers/phy/phy-twl4030-usb.c:609:11: error: 'struct phy' has no member named 'state'
> drivers/phy/phy-twl4030-usb.c: In function 'twl4030_usb_probe':
> drivers/phy/phy-twl4030-usb.c:679:12: warning: assignment from incompatible pointer type
> 
> This applies the same changes that were done to the other phy drivers
> to get it to build cleanly.
> 
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
> Fixes: 19c1eac2685b6 ("usb: rename phy to usb_phy in OTG")
> Fixes: e47d92545c297 ("usb: move the OTG state from the USB PHY to the OTG structure")

on my testing/next already:

commit 7e1bbeb4292783dcc079156b8fa08d66d17219e0
Author: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
Date:   Fri Nov 7 19:43:45 2014 -0600

    usb: host: ohci: omap: fix build breakage
    
    commit e47d925 (usb: move the OTG state
    from the USB PHY to the OTG structure) moved
    the OTG state field from struct usb_phy to
    struct usb_otg but, even though I fixed many
    other build breakages, I still missed one
    on ohci-omap.c.
    
    Fix the build breakage now.
    
    drivers/usb/host/ohci-omap.c: In function ‘start_hnp’:
    drivers/usb/host/ohci-omap.c:186:19: error: request for member ‘state’ in something not a structure or union
      hcd->usb_phy->otg.state = OTG_STATE_A_SUSPEND;
    
    Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>

diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index cf89b4b1..3e5df5a 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -183,7 +183,7 @@ static void start_hnp(struct ohci_hcd *ohci)
 	otg_start_hnp(hcd->usb_phy->otg);
 
 	local_irq_save(flags);
-	hcd->usb_phy->otg.state = OTG_STATE_A_SUSPEND;
+	hcd->usb_phy->otg->state = OTG_STATE_A_SUSPEND;
 	writel (RH_PS_PSS, &ohci->regs->roothub.portstatus [port]);
 	l = omap_readl(OTG_CTRL);
 	l &= ~OTG_A_BUSREQ;

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] usb: phy: fix twl4030 build regression
  2014-11-11 14:52 ` Felipe Balbi
@ 2014-11-11 14:53   ` Felipe Balbi
  0 siblings, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2014-11-11 14:53 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Arnd Bergmann, Antoine Tenart, Kishon Vijay Abraham I,
	Tony Lindgren, linux-usb, linux-omap, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2862 bytes --]

On Tue, Nov 11, 2014 at 08:52:17AM -0600, Felipe Balbi wrote:
> On Tue, Nov 11, 2014 at 10:36:09AM +0100, Arnd Bergmann wrote:
> > Recent changes to the common OTG handling broke building the twl4030
> > OTG driver as found during an allmodconfig build of linux-next:
> > 
> > drivers/phy/phy-twl4030-usb.c: In function 'twl4030_set_peripheral':
> > drivers/phy/phy-twl4030-usb.c:609:11: error: 'struct phy' has no member named 'state'
> > drivers/phy/phy-twl4030-usb.c: In function 'twl4030_usb_probe':
> > drivers/phy/phy-twl4030-usb.c:679:12: warning: assignment from incompatible pointer type
> > 
> > This applies the same changes that were done to the other phy drivers
> > to get it to build cleanly.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Fixes: 19c1eac2685b6 ("usb: rename phy to usb_phy in OTG")
> > Fixes: e47d92545c297 ("usb: move the OTG state from the USB PHY to the OTG structure")
> 
> on my testing/next already:
> 
> commit 7e1bbeb4292783dcc079156b8fa08d66d17219e0
> Author: Felipe Balbi <balbi@ti.com>
> Date:   Fri Nov 7 19:43:45 2014 -0600
> 
>     usb: host: ohci: omap: fix build breakage

wrong commit, here's the correct one:

commit 8b9ca2767b2d1ea405287e530da3a7b234120b95
Author: Felipe Balbi <balbi@ti.com>
Date:   Fri Nov 7 09:06:04 2014 -0600

    phy: twl4030: Fix build breakage
    
    commit e47d925 (usb: move the OTG state
    from the USB PHY to the OTG structure) moved
    the OTG state field from struct usb_phy to
    struct usb_otg but, even though I fixed many
    other build breakages, I still missed one
    on phy-twl4030-usb.c.
    
    Fix the build breakage now.
    
    While at that, also a build warning introduced
    by the same commit.
    
    Cc: Kishon Vijay Abraham I <kishon@ti.com>
    Cc: Antoine Tenart <antoine.tenart@free-electrons.com>
    Signed-off-by: Felipe Balbi <balbi@ti.com>

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 7b04bef..e2698d29 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -606,7 +606,7 @@ static int twl4030_set_peripheral(struct usb_otg *otg,
 
 	otg->gadget = gadget;
 	if (!gadget)
-		otg->phy->state = OTG_STATE_UNDEFINED;
+		otg->state = OTG_STATE_UNDEFINED;
 
 	return 0;
 }
@@ -618,7 +618,7 @@ static int twl4030_set_host(struct usb_otg *otg, struct usb_bus *host)
 
 	otg->host = host;
 	if (!host)
-		otg->phy->state = OTG_STATE_UNDEFINED;
+		otg->state = OTG_STATE_UNDEFINED;
 
 	return 0;
 }
@@ -676,7 +676,7 @@ static int twl4030_usb_probe(struct platform_device *pdev)
 	twl->phy.otg		= otg;
 	twl->phy.type		= USB_PHY_TYPE_USB2;
 
-	otg->phy		= &twl->phy;
+	otg->usb_phy		= &twl->phy;
 	otg->set_host		= twl4030_set_host;
 	otg->set_peripheral	= twl4030_set_peripheral;
 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2014-11-11 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-11  9:36 [PATCH] usb: phy: fix twl4030 build regression Arnd Bergmann
2014-11-11 14:52 ` Felipe Balbi
2014-11-11 14:53   ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox