From: Marek Vasut <marek.vasut@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGET
Date: Wed, 29 May 2019 01:27:42 +0200 [thread overview]
Message-ID: <c20b44b1-bfa1-9d71-b6b5-e3ea20d8e579@gmail.com> (raw)
In-Reply-To: <CA+CtpRgmP6HGPp43mZREu-N=_CSHq-_0Tj7=ERpfw01g0CZWMQ@mail.gmail.com>
On 5/29/19 1:16 AM, Derald Woods wrote:
> On Tue, May 28, 2019 at 4:16 PM Marek Vasut <marek.vasut@gmail.com> wrote:
>>
>> On 5/28/19 4:22 AM, Derald D. Woods wrote:
>>> This commit addresses the following warning, when _NOT_ USB_MUSB_HOST:
>>>
>>> [...]
>>> CC drivers/usb/gadget/f_mass_storage.o
>>> CC drivers/usb/musb-new/omap2430.o
>>> CC drivers/usb/gadget/f_fastboot.o
>>> CC env/common.o
>>> CC env/env.o
>>> /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c: In function ‘omap2430_musb_probe’:
>>> /src/etinker/software/u-boot-master/drivers/usb/musb-new/omap2430.c:239:6: warning: assignment to ‘int’ from ‘struct musb *’ makes integer from pointer without a cast [-Wint-conversion]
>>> ret = musb_register(&platdata->plat,
>>> ^
>>> LD drivers/usb/host/built-in.o
>>> CC drivers/usb/gadget/f_sdp.o
>>> CC fs/ext4/ext4fs.o
>>> [...]
Skip to the end first
>>> Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
>>> ---
>>> drivers/usb/musb-new/omap2430.c | 8 ++++++--
>>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c
>>> index 32743aa72c..cca1653f1e 100644
>>> --- a/drivers/usb/musb-new/omap2430.c
>>> +++ b/drivers/usb/musb-new/omap2430.c
>>> @@ -215,11 +215,13 @@ static int omap2430_musb_probe(struct udevice *dev)
>>> {
>>> #ifdef CONFIG_USB_MUSB_HOST
>>> struct musb_host_data *host = dev_get_priv(dev);
>>> +#else
>>> + struct musb *musbp;
Drop this hunk
>>> #endif
>>> struct omap2430_musb_platdata *platdata = dev_get_platdata(dev);
>>> struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
>>> struct omap_musb_board_data *otg_board_data;
>>> - int ret;
>>> + int ret = 0;
>>> void *base = dev_read_addr_ptr(dev);
>>>
>>> priv->desc_before_addr = true;
>>> @@ -236,9 +238,11 @@ static int omap2430_musb_probe(struct udevice *dev)
>>>
>>> ret = musb_lowlevel_init(host);
>>> #else
>>> - ret = musb_register(&platdata->plat,
>>> + musbp = musb_register(&platdata->plat,
Replace musbp with host->host
>>> (struct device *)otg_board_data,
>>> platdata->base);
>>> + if (IS_ERR_OR_NULL(musbp))
here too
>>> + return -EINVAL;
>>
>> For example the pic32 glue code holds the musb_host_data in private data
>> , so it can call musb_stop() in .remove callback . Can you do the same?
>>
>
> This was just a non-structural change to eliminate a compiler warning.
> I agree that other things can/should be done with this driver. That
> work would be outside of what I was trying to accomplsh here, at the
> moment.
See above, I believe that should fix the problem _and_ not crash in the
.remove() .
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2019-05-28 23:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-28 2:22 [U-Boot] [PATCH 3/3] usb: musb-new: omap2430: Fix compilation warning with USB_MUSB_GADGET Derald D. Woods
2019-05-28 21:16 ` Marek Vasut
2019-05-28 23:16 ` Derald Woods
2019-05-28 23:27 ` Marek Vasut [this message]
2019-05-29 0:00 ` Derald Woods
2019-05-29 0:48 ` Marek Vasut
2019-05-29 1:34 ` Derald Woods
2019-05-29 10:07 ` Marek Vasut
2019-05-29 11:44 ` Derald Woods
2019-05-29 12:17 ` Marek Vasut
2019-05-29 12:33 ` Derald D. Woods
2019-05-29 12:36 ` Marek Vasut
2019-07-14 13:07 ` Tom Rini
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=c20b44b1-bfa1-9d71-b6b5-e3ea20d8e579@gmail.com \
--to=marek.vasut@gmail.com \
--cc=u-boot@lists.denx.de \
/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