From patchwork Mon Jun 3 15:49:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 10973111 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 6627076 for ; Mon, 3 Jun 2019 15:54:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55F6B28521 for ; Mon, 3 Jun 2019 15:54:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A504286AC; Mon, 3 Jun 2019 15:54:31 +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=-7.9 required=2.0 tests=BAYES_00,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 E2DDC28521 for ; Mon, 3 Jun 2019 15:54:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729038AbfFCPv2 (ORCPT ); Mon, 3 Jun 2019 11:51:28 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:53714 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729012AbfFCPv1 (ORCPT ); Mon, 3 Jun 2019 11:51:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E90101715; Mon, 3 Jun 2019 08:51:26 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8984C3F246; Mon, 3 Jun 2019 08:51:25 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, Oliver Neukum , Sebastian Andrzej Siewior , linux-usb@vger.kernel.org Subject: [RFC PATCH 19/57] drivers: usb: core: Use bus_find_device_by_devt helper Date: Mon, 3 Jun 2019 16:49:45 +0100 Message-Id: <1559577023-558-20-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> References: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> 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 Switch to using the bus_find_device_by_devt helper Cc: Greg Kroah-Hartman Cc: Oliver Neukum Cc: Sebastian Andrzej Siewior Cc: linux-usb@vger.kernel.org Signed-off-by: Suzuki K Poulose --- drivers/usb/core/devio.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index fa783531..28358a3 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -947,17 +947,11 @@ static int parse_usbdevfs_streams(struct usb_dev_state *ps, return ret; } -static int match_devt(struct device *dev, void *data) -{ - return dev->devt == (dev_t) (unsigned long) data; -} - static struct usb_device *usbdev_lookup_by_devt(dev_t devt) { struct device *dev; - dev = bus_find_device(&usb_bus_type, NULL, - (void *) (unsigned long) devt, match_devt); + dev = bus_find_device_by_devt(&usb_bus_type, NULL, devt); if (!dev) return NULL; return to_usb_device(dev);