Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3393229imu; Mon, 19 Nov 2018 15:30:02 -0800 (PST) X-Google-Smtp-Source: AJdET5dK2QBny8212k4UqJ0z/KzBWsUTUS7BcyidJUUWNU39tvp5aVH8JJB8J2pHSVKTq41ckL54 X-Received: by 2002:a17:902:7c82:: with SMTP id y2mr16790968pll.33.1542670202798; Mon, 19 Nov 2018 15:30:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542670202; cv=none; d=google.com; s=arc-20160816; b=Kd0mi7oce7Qi5heBHS3RZ76m28akxaCjMrJyzVlDklidcL+7ONnoHlWMNcnKQ5EiYc EcIn7t4AafNkx0rkBObTKbEY2/L2gwDj+BWcdYT/tM64LqQwu1ltJhWWbn2Vzw8gAqMc 8O8HeaoZSfAP4BZ8MRwZXQmB/oQx3fbUSEcpf7B/Xs01jrV/OyqbspjkSUyPbIa1bvKu 11xOGGqHmDDC3QL/Tq8bFPz2dzjsHR5Tm8EeR6EJunmySghdAv0LWPzaWlJy/XZcPvzs Q1hx3C2F5sQ7FmEVO0/boNS4PdzsHmDeSFpjlte62FR8ygSNxhlNqg8rRya/lAOYF+in z/gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=ZerO0x85S+KXn/eWjn2EIwWcOtUjMTo6CrHKJ6cTlG0=; b=fZrSWlvhexG4EKoAzQ91ZK22BOpRAPA8MgNSjM+dQw1cwc02+zV3IQ7QSrJ4PxwvRm NZs9n8Cuphp2tjAo00yu3lPiPA6NoM3rBXvqHvtDV5woMxkYtd95KDrpA695QaQf7zY6 2yalBwLSmCT+6cRGWJfRWRc/iGUNBVYEc35W2YukoZcJG9+n2UALj+ANs+YyhvmAJyi3 TjDeWU+BrpA6j7uIkYbDyHdlh/8s5SFYAqWw/F01Q2ks+VRnFlk1tqRFmo/16Wo5w4EX v4B81EvREsiJgVu8nrsaphDRegDTYfqcXexIb/q0jRY8jDsJl2/R2qy7K4WGUprOQK/h Y1xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pt9I7orm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si1949612pgi.263.2018.11.19.15.29.48; Mon, 19 Nov 2018 15:30:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=pt9I7orm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732163AbeKTJap (ORCPT + 99 others); Tue, 20 Nov 2018 04:30:45 -0500 Received: from mail-pl1-f202.google.com ([209.85.214.202]:51454 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732123AbeKTJab (ORCPT ); Tue, 20 Nov 2018 04:30:31 -0500 Received: by mail-pl1-f202.google.com with SMTP id 3-v6so24643284plc.18 for ; Mon, 19 Nov 2018 15:04:33 -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=ZerO0x85S+KXn/eWjn2EIwWcOtUjMTo6CrHKJ6cTlG0=; b=pt9I7ormK9h9+8r2hg8AmgjQkbcKJ9Yndj0BnG+HfwD8qxm9b0wYagZUP2IjG9OlzJ KEofOyQGFEvY2CVHlGOYU1U2KX9bhw3b/nj8AmJV4JcsIG/SbttDHAw3QcpXScZKIYuu Qtshz2DH3flU00r2o7CtXkB8rX7kY+2WbYXH3A3uRC+XBIB2mQuUHoP2ntMuo/c1nOxa pmGyVjwANThkHAEIHRmS9NmNvokgm3N637K/CnPv3f+kKMPvYGqzXSOfbWTHT4PDcFhW MAsoNoFlkgjNbPwCm9EvXb58vkBH6Y5JFCIzbLCIqshjyvfAFLAQT/8B2QrtXEU4BRyy f4jw== 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=ZerO0x85S+KXn/eWjn2EIwWcOtUjMTo6CrHKJ6cTlG0=; b=F5gC/Dq7hwsCHtka8S8jzuimMOzgvIVcX1orwk0U8zVJLdPbH4OB/urRwDfItxyOeA myRWDuCwPjCOiGxGj1WkLd740WByG4cVSF+auYgMyMjUn7xSEgdb/2YU+J4iil2mwc/W CrgcPm/DUkk0mMf6aQOP18OdP2qK3NlfiZUwgLZIRzZ702MjrphDelwYGlTCmKzAE1WG 9grM5nNvpk82xL1BPMKtshyq/QoFWUM4C7kM/GG3NEwbdniDIXJpb8l58MWkwl6c9p5E JBKD0zdXYHLl1Q73IaLfu9idT745Ke+8lC1Oa4EjM0yRPVyagpzXlW7Q0icuqqN3Dnst WKJw== X-Gm-Message-State: AGRZ1gIgRsiKrWr3nIg0AKsFXRIJ8ZuOya9XG2oBEmVqZk9k73nXj46Z pit+xjOYbhFhwyXIk779NrDGShid1ghJ X-Received: by 2002:a62:8a41:: with SMTP id y62-v6mr8164482pfd.70.1542668673264; Mon, 19 Nov 2018 15:04:33 -0800 (PST) Date: Mon, 19 Nov 2018 15:04:08 -0800 In-Reply-To: <20181119230409.258121-1-rajatja@google.com> Message-Id: <20181119230409.258121-4-rajatja@google.com> Mime-Version: 1.0 References: <20181117010748.24347-1-rajatja@google.com> <20181119230409.258121-1-rajatja@google.com> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog Subject: [PATCH v2 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v2: same as v1 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) -- 2.19.1.1215.g8438c0b245-goog