Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: phy: fsl: Fix build errors

commit e47d925 (usb: move the OTG state from
the USB PHY to the OTG structure) moved the
OTG state from struct usb_phy to struct usb_otg.

Unfortunately, even though I fixed quite a few
build regressions with that patch already, this
one was still missing.

Note that this driver still has other randconfig
build problems which I'll leave for driver author
to fix, as that's less trivial.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

+8 -8
+7 -7
drivers/usb/phy/phy-fsl-usb.c
··· 274 274 fsl_otg_dischrg_vbus(0); 275 275 srp_wait_done = 1; 276 276 277 - if ((fsl_otg_dev->phy.state == OTG_STATE_B_SRP_INIT) && 277 + if ((fsl_otg_dev->phy.otg->state == OTG_STATE_B_SRP_INIT) && 278 278 fsl_otg_dev->fsm.b_sess_vld) 279 279 fsl_otg_dev->fsm.b_srp_done = 1; 280 280 } ··· 624 624 /* Mini-A cable connected */ 625 625 struct otg_fsm *fsm = &otg_dev->fsm; 626 626 627 - otg.state = OTG_STATE_UNDEFINED; 627 + otg->state = OTG_STATE_UNDEFINED; 628 628 fsm->protocol = PROTO_UNDEF; 629 629 } 630 630 } ··· 682 682 { 683 683 if (!fsl_otg_dev) 684 684 return -ENODEV; 685 - if (phy->otg.state == OTG_STATE_B_PERIPHERAL) 685 + if (phy->otg->state == OTG_STATE_B_PERIPHERAL) 686 686 pr_info("FSL OTG: Draw %d mA\n", mA); 687 687 688 688 return 0; ··· 715 715 { 716 716 struct fsl_otg *otg_dev; 717 717 718 - if (!otg || otg.state != OTG_STATE_B_IDLE) 718 + if (!otg || otg->state != OTG_STATE_B_IDLE) 719 719 return -ENODEV; 720 720 721 721 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy); ··· 990 990 * Also: record initial state of ID pin 991 991 */ 992 992 if (fsl_readl(&p_otg->dr_mem_map->otgsc) & OTGSC_STS_USB_ID) { 993 - p_otg->phy->otg.state = OTG_STATE_UNDEFINED; 993 + p_otg->phy.otg->state = OTG_STATE_UNDEFINED; 994 994 p_otg->fsm.id = 1; 995 995 } else { 996 - p_otg->phy->otg.state = OTG_STATE_A_IDLE; 996 + p_otg->phy.otg->state = OTG_STATE_A_IDLE; 997 997 p_otg->fsm.id = 0; 998 998 } 999 999 ··· 1048 1048 /* State */ 1049 1049 t = scnprintf(next, size, 1050 1050 "OTG state: %s\n\n", 1051 - usb_otg_state_string(fsl_otg_dev->phy.state)); 1051 + usb_otg_state_string(fsl_otg_dev->phy.otg->state)); 1052 1052 size -= t; 1053 1053 next += t; 1054 1054
+1 -1
drivers/usb/phy/phy-fsl-usb.h
··· 298 298 /* SE0 Time Before SRP */ 299 299 #define TB_SE0_SRP (2) /* b_idle,minimum 2 ms, section:5.3.2 */ 300 300 301 - #define SET_OTG_STATE(otg_ptr, newstate) ((otg_ptr)->state = newstate) 301 + #define SET_OTG_STATE(phy, newstate) ((phy)->otg->state = newstate) 302 302 303 303 struct usb_dr_mmap { 304 304 /* Capability register */