[PATCH v3] usb: onboard-hub: Update the bind function based on peer-hub property

As the "peer-hub" property is optional, don't error out just skip the bind function.
Fixes: 57e30b09fc ("usb: onboard-hub: Bail out if peer hub is already probed") Signed-off-by: Venkatesh Yadav Abbarapu venkatesh.abbarapu@amd.com --- Changes in v2: - Removed the peer_hub variable and used the return value. Changes in v3: - Removed the else condition. --- common/usb_onboard_hub.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 6f28036e09..7fe62b043e 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -183,7 +183,12 @@ static int usb_onboard_hub_bind(struct udevice *dev) int ret, off;
ret = dev_read_phandle_with_args(dev, "peer-hub", NULL, 0, 0, &phandle); - if (ret) { + if (ret == -ENOENT) { + dev_dbg(dev, "peer-hub property not present\n"); + return 0; + } + + if (ret) { dev_err(dev, "peer-hub not specified\n"); return ret; }

On 12/4/24 08:25, Venkatesh Yadav Abbarapu wrote:
As the "peer-hub" property is optional, don't error out just skip the bind function.
Fixes: 57e30b09fc ("usb: onboard-hub: Bail out if peer hub is already probed") Signed-off-by: Venkatesh Yadav Abbarapu venkatesh.abbarapu@amd.com
Changes in v2:
- Removed the peer_hub variable and used the return value.
Changes in v3:
- Removed the else condition.
common/usb_onboard_hub.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 6f28036e09..7fe62b043e 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -183,7 +183,12 @@ static int usb_onboard_hub_bind(struct udevice *dev) int ret, off;
ret = dev_read_phandle_with_args(dev, "peer-hub", NULL, 0, 0, &phandle);
- if (ret) {
- if (ret == -ENOENT) {
dev_dbg(dev, "peer-hub property not present\n");
return 0;
- }
- if (ret) { dev_err(dev, "peer-hub not specified\n"); return ret; }
Looks good to me.
Acked-by: Michal Simek michal.simek@amd.com
Thanks, Michal

On 12/4/24 8:25 AM, Venkatesh Yadav Abbarapu wrote:
As the "peer-hub" property is optional, don't error out just skip the bind function.
Fixes: 57e30b09fc ("usb: onboard-hub: Bail out if peer hub is already probed") Signed-off-by: Venkatesh Yadav Abbarapu venkatesh.abbarapu@amd.com
Patrice, can you please test and provide RB/TB on ST HW ?

On 12/4/24 08:25, Venkatesh Yadav Abbarapu wrote:
As the "peer-hub" property is optional, don't error out just skip the bind function.
Fixes: 57e30b09fc ("usb: onboard-hub: Bail out if peer hub is already probed") Signed-off-by: Venkatesh Yadav Abbarapu venkatesh.abbarapu@amd.com
Changes in v2:
- Removed the peer_hub variable and used the return value.
Changes in v3:
- Removed the else condition.
common/usb_onboard_hub.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c index 6f28036e09..7fe62b043e 100644 --- a/common/usb_onboard_hub.c +++ b/common/usb_onboard_hub.c @@ -183,7 +183,12 @@ static int usb_onboard_hub_bind(struct udevice *dev) int ret, off;
ret = dev_read_phandle_with_args(dev, "peer-hub", NULL, 0, 0, &phandle);
- if (ret) {
- if (ret == -ENOENT) {
dev_dbg(dev, "peer-hub property not present\n");
return 0;
- }
- if (ret) { dev_err(dev, "peer-hub not specified\n"); return ret; }
Reviewed-by: Patrice Chotard patrice.chotard@foss.st.com Tested-by: Patrice Chotard patrice.chotard@foss.st.com
Tested on STM32MP157C-DK2 board
Thanks Patrice
participants (4)
-
Marek Vasut
-
Michal Simek
-
Patrice CHOTARD
-
Venkatesh Yadav Abbarapu