From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/9] Fix bug when both DFU & ETHER are defined
Date: Thu, 29 Nov 2012 07:30:07 +0100 [thread overview]
Message-ID: <201211290730.07653.marex@denx.de> (raw)
In-Reply-To: <A22B0778-A341-475F-80BE-F07B2FA728D9@antoniou-consulting.com>
Dear Pantelis Antoniou,
> Hi Marek,
>
> On Nov 28, 2012, at 4:43 AM, Marek Vasut wrote:
> > Dear Pantelis Antoniou,
> >
> >> When both CONFIG_USB_GADGET & CONFIG_USB_ETHER are defined
> >> the makefile links objects twice.
> >>
> >> Detect this and fix it with a not very elegant way in the
> >> makefile. Revisit and clean it later.
> >>
> >> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> >> ---
> >> drivers/usb/gadget/Makefile | 13 +++++++++++--
> >> 1 file changed, 11 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
> >> index 040eaba..15206cd 100644
> >> --- a/drivers/usb/gadget/Makefile
> >> +++ b/drivers/usb/gadget/Makefile
> >> @@ -26,14 +26,23 @@ include $(TOPDIR)/config.mk
> >> LIB := $(obj)libusb_gadget.o
> >>
> >> # new USB gadget layer dependencies
> >> +
> >> +# ugh; ugh; ugh common objects included twice
> >> +ifdef CONFIG_USB_GADGET
> >> + COBJS-y += epautoconf.o config.o usbstring.o
> >> +else
> >> + ifdef CONFIG_USB_ETHER
> >> + COBJS-y += epautoconf.o config.o usbstring.o
> >> + endif
> >> +endif
> >
> > COBJS-$(CONFIG_ST) += st.o
> > COBJS-$(CONFIG_ST_ELSE) += st_else.o
> >
> > if (both selected)
> > scream and die.
>
> I fail to see how that would work for the problem at hand, namely
> that if both CONFIG_USB_GADGET & CONFIG_USB_ETHER are defined
> epautoconf.o config.o usbstring.o are linked twice.
Ah, now I understand the problem at hand.
> The proper thing to do would be to have a config symbol enabled
> when either CONFIG_USB_GADGET & CONFIG_USB_ETHER are defined.
>
> Something like
>
> #if defined(CONFIG_USB_GADGET) || defined(CONFIG_USB_ETHER)
> #define CONFIG_USB_GADGET_PLUMPING
> #endif
>
> in a header file someplace and do
Can you not do "or" in conditional expression in Makefile?
> COBJS-$(CONFIG_USB_GADGET_PLUMPING) += epautoconf.o config.o usbstring.o
>
> etc.
>
> This would require putting it either in every board file, or in a core
> usb header.
>
> The patch was the least intrusive method.
>
> Regards
[...]
next prev parent reply other threads:[~2012-11-29 6:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-28 12:43 [U-Boot] [PATCH 0/9] DFU on am35xx_evm (against u-boot-usb) Pantelis Antoniou
2012-11-28 12:43 ` [U-Boot] [PATCH 1/9] Remove obsolete header file Pantelis Antoniou
2012-11-27 16:45 ` Tom Rini
2012-11-27 22:00 ` Marek Vasut
2012-11-28 3:01 ` Tom Rini
2012-11-28 12:43 ` [U-Boot] [PATCH 2/9] Fix bug when both DFU & ETHER are defined Pantelis Antoniou
2012-11-28 2:43 ` Marek Vasut
2012-11-28 8:24 ` Pantelis Antoniou
2012-11-29 6:30 ` Marek Vasut [this message]
2012-11-28 12:43 ` [U-Boot] [PATCH 3/9] Only perform DFU board_usb_init() for TRATS Pantelis Antoniou
2012-11-28 2:45 ` Marek Vasut
2012-11-28 8:26 ` Pantelis Antoniou
2012-11-29 6:28 ` Marek Vasut
2012-11-28 12:43 ` [U-Boot] [PATCH 4/9] Fix crash when wrong number of arguments given Pantelis Antoniou
2012-11-28 12:43 ` [U-Boot] [PATCH 5/9] Generate appropriate responses for DFU Pantelis Antoniou
2012-11-28 2:46 ` Marek Vasut
2012-11-28 8:27 ` Pantelis Antoniou
2012-11-28 12:43 ` [U-Boot] [PATCH 6/9] Properly zero out timeout value Pantelis Antoniou
2012-11-28 2:46 ` Marek Vasut
2012-11-28 8:28 ` Pantelis Antoniou
2012-11-28 10:23 ` Marek Vasut
2012-11-28 12:44 ` [U-Boot] [PATCH 7/9] Add a partition type target Pantelis Antoniou
2012-11-28 2:48 ` Marek Vasut
2012-11-28 8:31 ` Pantelis Antoniou
2012-11-28 9:22 ` Marek Vasut
2012-11-28 12:44 ` [U-Boot] [PATCH 8/9] Issue connect/disconnect as appropriate Pantelis Antoniou
2012-11-28 2:50 ` Marek Vasut
2012-11-28 3:03 ` Tom Rini
2012-11-28 12:44 ` [U-Boot] [PATCH 9/9] Add DFU config Pantelis Antoniou
2012-11-28 2:52 ` Marek Vasut
2012-11-28 3:04 ` Tom Rini
2012-11-28 8:32 ` Pantelis Antoniou
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=201211290730.07653.marex@denx.de \
--to=marex@denx.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.