From patchwork Thu Mar 25 10:04:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liulongfang X-Patchwork-Id: 409255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3B7EC433C1 for ; Thu, 25 Mar 2021 10:07:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FAEF61A2B for ; Thu, 25 Mar 2021 10:07:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229934AbhCYKG6 (ORCPT ); Thu, 25 Mar 2021 06:06:58 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14589 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbhCYKGu (ORCPT ); Thu, 25 Mar 2021 06:06:50 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4F5ggz213lz19JH5; Thu, 25 Mar 2021 18:04:47 +0800 (CST) Received: from huawei.com (10.67.165.24) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Thu, 25 Mar 2021 18:06:38 +0800 From: Longfang Liu To: , , CC: , , , , , Subject: [RFC PATCH] USB:XHCI:Adjust the log level of hub Date: Thu, 25 Mar 2021 18:04:12 +0800 Message-ID: <1616666652-37920-1-git-send-email-liulongfang@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org When the number of ports of the hub is not between 1 and Maxports, it will only exit the registration of the hub on the current controller, but it will not affect the function of the controller itself. Its other hubs can operate normally, so the log level here can be changed from error to information. Signed-off-by: Longfang Liu --- drivers/usb/core/hub.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b1e14be..70294ad 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1409,13 +1409,11 @@ static int hub_configure(struct usb_hub *hub, maxchild = min_t(unsigned, maxchild, USB_SS_MAXPORTS); if (hub->descriptor->bNbrPorts > maxchild) { - message = "hub has too many ports!"; - ret = -ENODEV; - goto fail; + dev_info(hub_dev, "hub has too many ports!\n"); + return -ENODEV; } else if (hub->descriptor->bNbrPorts == 0) { - message = "hub doesn't have any ports!"; - ret = -ENODEV; - goto fail; + dev_info(hub_dev, "hub doesn't have any ports!\n"); + return -ENODEV; } /*