From patchwork Sat Nov 17 01:07:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 10687197 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 55F821709 for ; Sat, 17 Nov 2018 01:08:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D7DF2C9EC for ; Sat, 17 Nov 2018 01:08:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08CDF2CA0F; Sat, 17 Nov 2018 01:08:22 +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=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL 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 97B192C9EC for ; Sat, 17 Nov 2018 01:08:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731018AbeKQLWv (ORCPT ); Sat, 17 Nov 2018 06:22:51 -0500 Received: from mail-pg1-f201.google.com ([209.85.215.201]:53595 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731017AbeKQLWu (ORCPT ); Sat, 17 Nov 2018 06:22:50 -0500 Received: by mail-pg1-f201.google.com with SMTP id h10so14275760pgv.20 for ; Fri, 16 Nov 2018 17:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=otj/32ePMtp8zjyI9T3AOMCzqrhYC3AtvdJgM2y5xMU=; b=KRJ9ktXtxL92PTIPjGraoP+jZH+QxfyrW0XLo5P38qqRG5iXW4H0mbHVGrTJY01VVY 5IQkgkU8oE7auKOf1UjR0ex9sDUtY3z6klXTaGvBm6z7jZ31hwKDLIfkIsCIGqQLj3qJ rRQYBIWTdtCd8UERr8EnmPR8+st0jufTbj853h8ul+nW3py4ooVTOUZYjzDRQH0jVfRn p3g5E2BWinWrcvlh8ET0/PqZW6pjQIdslKm93VXTCiau0BoZ2VXfgsofdeAMYzID9YTD 07wb0FyHo6ZoJbIitMBhVaRKA0IfzjCQqu/ZtOzyLQPfcA35pHFgJXLSJcfCrIRIhz5r 9BVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=otj/32ePMtp8zjyI9T3AOMCzqrhYC3AtvdJgM2y5xMU=; b=AqPjmPRgcrUnLuOSH4LOpDso1o7ClKPB6HHsi4tY78RmtJr+Km1mqy8p80V7JwZ2hX 7/iUf1UiRiHmUg9yMP+sfFfCOEcYK7tuX7ce2sfdCmgSjTeaES42Uq1n1vp2pq/IwfNp aramcTtbIPAWMVSkVGlkzIQhH6N7xbOv2AatwM7aEHS5R3HuWhohyOl6Lbf8161L8WGm iu2wawMZsWXwGPvnTkaeH8pOVl4b/i9EzFMEfxpisB/eVcUqklWrES/y6nZgfAESiM4v sxFWmQqB81PYgKX2TkEmUiaqrcz/a7avacBkuqvQWJYTkq1XZc+X5Yb8JmQX6HlmzX66 9gEA== X-Gm-Message-State: AA+aEWa8c5TteIGPQfM3/1x3Jg9fwJL+H0IXUs7sLmJYXfMeMYtS6o8J YZUet0u5t+ZSbJJhVnsKGuwyXS9+LWkO X-Google-Smtp-Source: AFSGD/XRJZoMm/pkhIcQK8n1ROMyqQENtXD0+5hcPxiq6+KXNTzOQ3LxFLcqSj/FLV/zvuQs2WbLKtVsxm0m X-Received: by 2002:a63:e210:: with SMTP id q16mr64085pgh.132.1542416889258; Fri, 16 Nov 2018 17:08:09 -0800 (PST) Date: Fri, 16 Nov 2018 17:07:47 -0800 In-Reply-To: <20181117010748.24347-1-rajatja@google.com> Message-Id: <20181117010748.24347-5-rajatja@google.com> Mime-Version: 1.0 References: <20181117010748.24347-1-rajatja@google.com> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog Subject: [PATCH 4/5] Bluetooth: btusb: Collect the common Intel assignments together From: Rajat Jain To: Marcel Holtmann , Johan Hedberg , Greg Kroah-Hartman , "David S. Miller" , Dmitry Torokhov , Rajat Jain , Alex Hung , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Cc: rajatxjain@gmail.com, dtor@google.com, raghuram.hegde@intel.com, chethan.tumkur.narayan@intel.com, sukumar.ghorai@intel.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 The BTUSB_INTEL and BTUSB_INTEL_NEW have common functions & quirks are assigned to hdev structure. Lets collect them together instead of repeating them in different code branches. Signed-off-by: Rajat Jain --- drivers/bluetooth/btusb.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 7439a7eb50ac..e8e148480c91 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3077,28 +3077,25 @@ static int btusb_probe(struct usb_interface *intf, data->diag = usb_ifnum_to_if(data->udev, ifnum_base + 2); } #endif + if (id->driver_info & BTUSB_INTEL || + id->driver_info & BTUSB_INTEL_NEW) { - if (id->driver_info & BTUSB_INTEL) { hdev->manufacturer = 2; - hdev->setup = btusb_setup_intel; - hdev->shutdown = btusb_shutdown_intel; - hdev->set_diag = btintel_set_diag_mfg; hdev->set_bdaddr = btintel_set_bdaddr; set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); - } - if (id->driver_info & BTUSB_INTEL_NEW) { - hdev->manufacturer = 2; - hdev->send = btusb_send_frame_intel; - hdev->setup = btusb_setup_intel_new; - hdev->hw_error = btintel_hw_error; - hdev->set_diag = btintel_set_diag; - hdev->set_bdaddr = btintel_set_bdaddr; - set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks); - set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks); - set_bit(HCI_QUIRK_NON_PERSISTENT_DIAG, &hdev->quirks); + if (id->driver_info & BTUSB_INTEL) { + hdev->setup = btusb_setup_intel; + hdev->shutdown = btusb_shutdown_intel; + hdev->set_diag = btintel_set_diag_mfg; + } else { + hdev->send = btusb_send_frame_intel; + hdev->setup = btusb_setup_intel_new; + hdev->hw_error = btintel_hw_error; + hdev->set_diag = btintel_set_diag; + } } if (id->driver_info & BTUSB_MARVELL)