linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Felipe Balbi <balbi@kernel.org>, Greg KH <greg@kroah.com>
Cc: Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Yu Chen <chenyu56@huawei.com>,
	John Stultz <john.stultz@linaro.org>
Subject: linux-next: build failure after merge of the usb-gadget tree
Date: Mon, 16 Mar 2020 14:37:52 +1100	[thread overview]
Message-ID: <20200316143752.473f1073@canb.auug.org.au> (raw)

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

Hi all,

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.

I have added the following merge fix patch (which may need more work):

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 16 Mar 2020 14:34:31 +1100
Subject: [PATCH] usb: dwc3: fix up for role switch API change

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/usb/dwc3/drd.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
index db68d48c2267..7db1ffc92bbd 100644
--- a/drivers/usb/dwc3/drd.c
+++ b/drivers/usb/dwc3/drd.c
@@ -478,9 +478,10 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
 
 #if IS_ENABLED(CONFIG_USB_ROLE_SWITCH)
 #define ROLE_SWITCH 1
-static int dwc3_usb_role_switch_set(struct device *dev, enum usb_role role)
+static int dwc3_usb_role_switch_set(struct usb_role_switch *sw,
+				    enum usb_role role)
 {
-	struct dwc3 *dwc = dev_get_drvdata(dev);
+	struct dwc3 *dwc = usb_role_switch_get_drvdata(sw);
 	u32 mode;
 
 	switch (role) {
@@ -502,9 +503,9 @@ static int dwc3_usb_role_switch_set(struct device *dev, enum usb_role role)
 	return 0;
 }
 
-static enum usb_role dwc3_usb_role_switch_get(struct device *dev)
+static enum usb_role dwc3_usb_role_switch_get(struct usb_role_switch *sw)
 {
-	struct dwc3 *dwc = dev_get_drvdata(dev);
+	struct dwc3 *dwc = usb_role_switch_get_drvdata(sw);
 	unsigned long flags;
 	enum usb_role role;
 
@@ -550,6 +551,7 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc)
 	dwc3_role_switch.fwnode = dev_fwnode(dwc->dev);
 	dwc3_role_switch.set = dwc3_usb_role_switch_set;
 	dwc3_role_switch.get = dwc3_usb_role_switch_get;
+	dwc3_role_switch.driver_data = dwc;
 	dwc->role_sw = usb_role_switch_register(dwc->dev, &dwc3_role_switch);
 	if (IS_ERR(dwc->role_sw))
 		return PTR_ERR(dwc->role_sw);
-- 
2.25.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2020-03-16  3:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16  3:37 Stephen Rothwell [this message]
2020-03-16 17:42 ` linux-next: build failure after merge of the usb-gadget tree John Stultz
2020-03-16 18:11   ` John Stultz
2020-03-16 19:46     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2015-05-29  8:32 Stephen Rothwell
2015-05-29 15:19 ` Felipe Balbi
2013-12-16  4:40 Stephen Rothwell
2013-12-16 19:41 ` Felipe Balbi
2013-12-16 23:10   ` Stephen Rothwell
2013-12-16 23:38     ` Felipe Balbi
2013-12-17  4:27       ` Stephen Rothwell
2013-12-09  3:58 Stephen Rothwell
2013-12-09  4:11 ` Felipe Balbi
2013-12-09 19:40   ` Felipe Balbi
2013-12-09 20:43     ` Stephen Rothwell
2013-12-09 21:01       ` Felipe Balbi
2013-12-09 21:42         ` Felipe Balbi
2013-12-17  4:36   ` Stephen Rothwell
2013-12-17  5:08     ` Felipe Balbi
2013-12-17  5:13       ` Felipe Balbi
2013-07-30  4:34 Stephen Rothwell
2013-07-30  5:49 ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200316143752.473f1073@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=balbi@kernel.org \
    --cc=chenyu56@huawei.com \
    --cc=greg@kroah.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).