From: David S. Miller Date: Tue, 25 Jul 2017 04:20:16 +0000 (-0700) Subject: bnxt_en: Use SWITCHDEV_SET_OPS(). X-Git-Tag: v4.1.12-124.31.3~966 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=380869fa1947f9c17719d300cfc2c49bc8eb304f;p=users%2Fjedix%2Flinux-maple.git bnxt_en: Use SWITCHDEV_SET_OPS(). Orabug: 27648355, 27648339 Suggested by Jakub Kicinski. Fixes: c124a62ff2dd ("bnxt_en: add support for port_attr_get and and get_phys_port_name") Reported-by: kbuild test robot Signed-off-by: David S. Miller (cherry picked from commit bc88055ab72c0eaa080926c888628b77d2055513) Signed-off-by: Brian Maly Reviewed-by: Jack Vogel Conflicts: drivers/net/ethernet/broadcom/bnxt/bnxt.c --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 3a5ee4f7ada4..4eb85343bcbb 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -52,6 +52,7 @@ #include #include +#include "bnxt_compat.h" #include "bnxt_hsi.h" #include "bnxt.h" #include "bnxt_ulp.h" @@ -7847,6 +7848,9 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) dev->netdev_ops = &bnxt_netdev_ops; dev->watchdog_timeo = BNXT_TX_TIMEOUT; dev->ethtool_ops = &bnxt_ethtool_ops; +#ifdef CONFIG_VF_REPS + SWITCHDEV_SET_OPS(dev, &bnxt_switchdev_ops); +#endif pci_set_drvdata(pdev, dev); rc = bnxt_alloc_hwrm_resources(bp); diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_compat.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_compat.h new file mode 100644 index 000000000000..4bc0a935b9d6 --- /dev/null +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_compat.h @@ -0,0 +1,26 @@ +/* Broadcom NetXtreme-C/E network driver. + * + * Copyright (c) 2014-2016 Broadcom Corporation + * Copyright (c) 2016-2017 Broadcom Limited + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#if !defined(NEW_FLOW_KEYS) && defined(HAVE_FLOW_KEYS) +#include +#endif +#include + + +#ifndef SWITCHDEV_SET_OPS +#define SWITCHDEV_SET_OPS(netdev, ops) ((netdev)->switchdev_ops = (ops)) +#endif