From patchwork Mon Jan 21 14:30:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suwan Kim X-Patchwork-Id: 10773941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72926746 for ; Mon, 21 Jan 2019 14:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62C832A3CE for ; Mon, 21 Jan 2019 14:31:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60A322A45E; Mon, 21 Jan 2019 14:31:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF20F2A42B for ; Mon, 21 Jan 2019 14:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729415AbfAUObD (ORCPT ); Mon, 21 Jan 2019 09:31:03 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:47067 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729036AbfAUObC (ORCPT ); Mon, 21 Jan 2019 09:31:02 -0500 Received: by mail-pl1-f195.google.com with SMTP id t13so9908404ply.13 for ; Mon, 21 Jan 2019 06:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gOhhRcy3pGU3QRkPUyM3KK/UaONc4nF9Sk/DYORfA20=; b=h5+7pPS1A7m0dORtDC1v9kUTdsMAZR7jiumgEJIuSIrQmb529GI+qKvPpWqHTSfqVM uvhDd/OZvHyOujL70HYMD5W9+EheinAtsGHqNbx1QKv2PMaOsFnk5ppcxI9EDkIdIn+M Haduos5spz9wO9ymKNQfltIPQjZ6vgTHkqBbqPz9xRbzGLzePZk65PfQGl6RZxBSLSzG OH+wAomvxPwG/3v4IJTGjYiP2+sUzXE0DqIwIHZLc1P/ZL20vWhT2KPJHs9ip4bmRy2X 0oSIsxY8xC42v3oKusu7CtbTbSsQq0zQP7DrqYFodKGi0xvtr5qCv5JOXE0iA/cfKJje 9awg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gOhhRcy3pGU3QRkPUyM3KK/UaONc4nF9Sk/DYORfA20=; b=q12vB127TkRbbcyw+BDi6PRVRfOJ4xk3DwPMZKAm7GP5WKBuV0kDLFxKaj8VsBBd5S soS+eomJtxRqjXpjU1xm8mSOEZyrsvXd61Prnp9jtrPremHPo8vMlw7W2LHStqyNfMnR inFgDusYsFJM+BLsiPJktBRcqfZmGLD+hA1C+FErd9mlWzng38JPZ2gEdvQWPOHViU/u eQPBVx0yhMuCfQElde60JkS6sqeItDNv4ETrW+Pxck9fXUPxtzuQX0vCOrH3YzslK4wM 4UYoVp163WaaAzfiafqkE22OWALdjfu2CaJHwhF4N/YiKIE7q8pDELpDsSR06PhM+B/Z ogAw== X-Gm-Message-State: AJcUukfXuVrlYUufc2lCke5JmfGDXTxV6BizyIcYU8BVjt9/uDV/4Pq+ 34YBCo2/j37/OpEe24W0GaU= X-Google-Smtp-Source: ALg8bN6TE4+hf3NOuDTvmSkLodd1lQdVuG2zHMpYbZwIpCnQrj3nH25GZPS1e78JA5UX6hmMw5EpOw== X-Received: by 2002:a17:902:4081:: with SMTP id c1mr30905972pld.87.1548081062240; Mon, 21 Jan 2019 06:31:02 -0800 (PST) Received: from localhost.localdomain ([125.142.23.13]) by smtp.googlemail.com with ESMTPSA id v191sm30506600pgb.77.2019.01.21.06.31.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 06:31:01 -0800 (PST) From: Suwan Kim To: gregkh@linuxfoundation.org, stern@rowland.harvard.edu Cc: linux-usb@vger.kernel.org, mathias.nyman@linux.intel.com Subject: [PATCH] usb: core: endpoint: Add error messages for usb_create_ep_devs() Date: Mon, 21 Jan 2019 23:30:55 +0900 Message-Id: <20190121143055.11781-1-suwan.kim027@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP usb_create_ep_devs() returns error code if an error occurs. But usb_new_device() and create_intf_ep_devs() which use usb_create_ep_devs() to create endpoint devices ignore the error and cut the propagation of the error when usb_create_ep_devs() fails. So, usb_create_ep_devs() prints an error message for debugging or notification purposes if an error occurs. Signed-off-by: Suwan Kim --- drivers/usb/core/endpoint.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/core/endpoint.c b/drivers/usb/core/endpoint.c index 1c2c04079676..ad3902c023d9 100644 --- a/drivers/usb/core/endpoint.c +++ b/drivers/usb/core/endpoint.c @@ -182,6 +182,7 @@ int usb_create_ep_devs(struct device *parent, ep_dev = kzalloc(sizeof(*ep_dev), GFP_KERNEL); if (!ep_dev) { + dev_err(parent, "endpoint device alloc failed\n"); retval = -ENOMEM; goto exit; } @@ -194,8 +195,10 @@ int usb_create_ep_devs(struct device *parent, dev_set_name(&ep_dev->dev, "ep_%02x", endpoint->desc.bEndpointAddress); retval = device_register(&ep_dev->dev); - if (retval) + if (retval) { + dev_err(parent, "endpoint device register failed\n"); goto error_register; + } device_enable_async_suspend(&ep_dev->dev); endpoint->ep_dev = ep_dev;