U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: Tom Rini <trini@konsulko.com>,
	Beniamino Galvani <b.galvani@gmail.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>,
	Marek Vasut <marex@denx.de>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Michal Simek <michal.simek@amd.com>,
	u-boot@lists.denx.de (open list),
	u-boot-amlogic@groups.io (open list:P200)
Cc: Anand Moon <linux.amoon@gmail.com>, Wayne Schroeder <raz@chewies.net>
Subject: [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization
Date: Fri,  9 May 2025 12:32:12 +0530	[thread overview]
Message-ID: <20250509070258.5077-8-linux.amoon@gmail.com> (raw)
In-Reply-To: <20250509070258.5077-1-linux.amoon@gmail.com>

Add conditional compilation for the usb5744_i2c_init() function based
on the CONFIG_DM_I2C configuration, to avoid compilation failure.

  CC      net/net-common.o
  AR      net/built-in.o
  LDS     u-boot.lds
  LD      u-boot
aarch64-linux-gnu-ld.bfd: common/usb_onboard_hub.o: in function `usb5744_i2c_init':
/home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:74:(.text.usb5744_i2c_init+0xfc): undefined reference to `i2c_get_chip'
aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:89:(.text.usb5744_i2c_init+0x1a0): undefined reference to `dm_i2c_write'
aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:96:(.text.usb5744_i2c_init+0x1c8): undefined reference to `dm_i2c_write'
aarch64-linux-gnu-ld.bfd: /home/amoon/mainline/u-boot/amlogic/u-boot-maineline/common/usb_onboard_hub.c:104:(.text.usb5744_i2c_init+0x1f0): undefined reference to `dm_i2c_write'
Segmentation fault (core dumped)
make: *** [Makefile:1824: u-boot] Error 139
make: *** Deleting file 'u-boot'

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 common/usb_onboard_hub.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c
index 1242513c631..92e3f3a92c9 100644
--- a/common/usb_onboard_hub.c
+++ b/common/usb_onboard_hub.c
@@ -30,6 +30,7 @@ struct onboard_hub_data {
 	int (*init)(struct udevice *dev);
 };
 
+#if CONFIG_IS_ENABLED(DM_I2C)
 static int usb5744_i2c_init(struct udevice *dev)
 {
 	/*
@@ -109,6 +110,7 @@ static int usb5744_i2c_init(struct udevice *dev)
 
 	return 0;
 }
+#endif
 
 int usb_onboard_hub_reset(struct udevice *dev)
 {
@@ -222,7 +224,9 @@ static const struct onboard_hub_data usb2514_data = {
 };
 
 static const struct onboard_hub_data usb5744_data = {
+#if CONFIG_IS_ENABLED(DM_I2C)
 	.init = usb5744_i2c_init,
+#endif
 	.power_on_delay_us = 1000,
 	.reset_us = 5,
 };
-- 
2.49.0


  parent reply	other threads:[~2025-05-09  7:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  7:02 [RFC v1 0/7] common: usb_onboard_hub: Add support for Odroid onboard USB hub reset Anand Moon
2025-05-09  7:02 ` [RFC v1 1/7] usb: onboard-hub: Add support for Genesys GL852G hub Anand Moon
2025-05-09  7:55   ` Neil Armstrong
2025-05-09  7:02 ` [RFC v1 2/7] configs: odorid-c2: Enable Onboard HUB driver Anand Moon
2025-05-09  7:56   ` Neil Armstrong
2025-05-09  8:01     ` Anand Moon
2025-05-09  7:02 ` [RFC v1 3/7] usb: onboard-hub: Add support for Genesys GL853G Anand Moon
2025-05-09  7:58   ` Neil Armstrong
2025-05-09  7:02 ` [RFC v1 4/7] configs: odorid-n2: Enable Oboard HUB driver Anand Moon
2025-05-09  7:57   ` Neil Armstrong
2025-05-09  7:02 ` [RFC v1 5/7] usb: onboard-hub: Add support for VL817 USB hub Anand Moon
2025-05-09  7:58   ` Neil Armstrong
2025-05-09  7:02 ` [RFC v1 6/7] configs: odorid-c4: Enable Oboard HUB driver Anand Moon
2025-05-09  7:57   ` Neil Armstrong
2025-05-09  7:02 ` Anand Moon [this message]
2025-05-09  7:57   ` [RFC v1 7/7] usb: onboard-hub: Add conditional compilation for I2C initialization Neil Armstrong
2025-05-09  9:17     ` Anand Moon
2025-05-09 11:51     ` Quentin Schulz
2025-05-09 17:45       ` Anand Moon
2025-05-12  7:06         ` Quentin Schulz
2025-05-12  8:21           ` Anand Moon
     [not found]           ` <183EB9E9446C2114.11104@groups.io>
2025-05-13 16:14             ` Anand Moon
2025-05-13 16:22               ` Quentin Schulz
2025-05-14  7:30                 ` Anand Moon
2025-05-21 14:34           ` Michal Simek
2025-05-21 15:18             ` Quentin Schulz
2025-05-22  5:54               ` Michal Simek

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=20250509070258.5077-8-linux.amoon@gmail.com \
    --to=linux.amoon@gmail.com \
    --cc=b.galvani@gmail.com \
    --cc=marex@denx.de \
    --cc=michal.simek@amd.com \
    --cc=neil.armstrong@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=raz@chewies.net \
    --cc=trini@konsulko.com \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=venkatesh.abbarapu@amd.com \
    /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