After merging the usb-gadget tree, today's linux-next build (arm multi_v7_defconfig) failed like this: drivers/usb/dwc3/drd.c: In function 'dwc3_setup_role_switch': drivers/usb/dwc3/drd.c:551:23: error: assignment to 'usb_role_switch_set_t' {aka 'int (*)(struct usb_role_switch *, enum usb_role)'} from incompatible pointer type 'int (*)(struct device *, enum usb_role)' [-Werror=incompatible-pointer-types] 551 | dwc3_role_switch.set = dwc3_usb_role_switch_set; | ^ drivers/usb/dwc3/drd.c:552:23: error: assignment to 'usb_role_switch_get_t' {aka 'enum usb_role (*)(struct usb_role_switch *)'} from incompatible pointer type 'enum usb_role (*)(struct device *)' [-Werror=incompatible-pointer-types] 552 | dwc3_role_switch.get = dwc3_usb_role_switch_get; | ^ Caused by commit 8a0a13799744 ("usb: dwc3: Registering a role switch in the DRD code.") interacting with commit bce3052f0c16 ("usb: roles: Provide the switch drivers handle to the switch in the API") from the usb tree.
Unified · Split
| @@ -478,9 +478,10 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc) · 477 unmodified lines | ||
| 478 | 478 | |
| 479 | 479 | #if IS_ENABLED(CONFIG_USB_ROLE_SWITCH) |
| 480 | 480 | #define ROLE_SWITCH 1 |
| 481 | −static int dwc3_usb_role_switch_set(struct device *dev, enum usb_role role) | |
| 481 | +static int dwc3_usb_role_switch_set(struct usb_role_switch *sw, | |
| 482 | + enum usb_role role) | |
| 482 | 483 | { |
| 483 | − struct dwc3 *dwc = dev_get_drvdata(dev); | |
| 484 | + struct dwc3 *dwc = usb_role_switch_get_drvdata(sw); | |
| 484 | 485 | u32 mode; |
| 485 | 486 | |
| 486 | 487 | switch (role) { |
| @@ -502,9 +503,9 @@ static int dwc3_usb_role_switch_set(struct device *dev, enum usb_role role) · 15 unmodified lines | ||
| 502 | 503 | return 0; |
| 503 | 504 | } |
| 504 | 505 | |
| 505 | −static enum usb_role dwc3_usb_role_switch_get(struct device *dev) | |
| 506 | +static enum usb_role dwc3_usb_role_switch_get(struct usb_role_switch *sw) | |
| 506 | 507 | { |
| 507 | − struct dwc3 *dwc = dev_get_drvdata(dev); | |
| 508 | + struct dwc3 *dwc = usb_role_switch_get_drvdata(sw); | |
| 508 | 509 | unsigned long flags; |
| 509 | 510 | enum usb_role role; |
| 510 | 511 | |
| @@ -550,6 +551,7 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc) · 39 unmodified lines | ||
| 550 | 551 | dwc3_role_switch.fwnode = dev_fwnode(dwc->dev); |
| 551 | 552 | dwc3_role_switch.set = dwc3_usb_role_switch_set; |
| 552 | 553 | dwc3_role_switch.get = dwc3_usb_role_switch_get; |
| 554 | + dwc3_role_switch.driver_data = dwc; | |
| 553 | 555 | dwc->role_sw = usb_role_switch_register(dwc->dev, &dwc3_role_switch); |
| 554 | 556 | if (IS_ERR(dwc->role_sw)) |
| 555 | 557 | return PTR_ERR(dwc->role_sw); |