get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1192306/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1192306,
    "url": "http://patchwork.ozlabs.org/api/patches/1192306/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191108142331.10221-10-anthony.l.nguyen@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20191108142331.10221-10-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2019-11-08T14:23:26",
    "name": "[S33,10/15] ice: Add ice_pf_to_dev(pf) macro",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1e7773c8d49a118a5fe854d93faa0946d74521a8",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@intel.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191108142331.10221-10-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 141798,
            "url": "http://patchwork.ozlabs.org/api/series/141798/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=141798",
            "date": "2019-11-08T14:23:30",
            "name": "[S33,01/15] ice: Store number of functions for the device",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/141798/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1192306/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1192306/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.133;\n\thelo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 478wv72c31z9sP4\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 Nov 2019 10:09:07 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id E08FE88055;\n\tFri,  8 Nov 2019 23:09:05 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id 9hQqqLzJTz-K; Fri,  8 Nov 2019 23:08:58 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D7DA987EE6;\n\tFri,  8 Nov 2019 23:08:57 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id ECA191BF5DB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:40 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id DBD70242F3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:40 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id VloiQYpyiLRl for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:19 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 02AAF2442C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:17 +0000 (UTC)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Nov 2019 14:54:17 -0800",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga008.fm.intel.com with ESMTP; 08 Nov 2019 14:54:17 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.68,283,1569308400\"; d=\"scan'208\";a=\"201478835\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri,  8 Nov 2019 06:23:26 -0800",
        "Message-Id": "<20191108142331.10221-10-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20191108142331.10221-1-anthony.l.nguyen@intel.com>",
        "References": "<20191108142331.10221-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "X-Mailman-Approved-At": "Fri, 08 Nov 2019 23:08:55 +0000",
        "Subject": "[Intel-wired-lan] [PATCH S33 10/15] ice: Add ice_pf_to_dev(pf) macro",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "From: Brett Creeley <brett.creeley@intel.com>\n\nWe use &pf->dev->pdev all over the code. Add a simple\nmacro to do this for us. When multiple de-references\nlike this are being done add a local struct device\nvariable.\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h          |   2 +\n drivers/net/ethernet/intel/ice/ice_base.c     |  22 +-\n drivers/net/ethernet/intel/ice/ice_dcb_lib.c  | 112 +++++-----\n drivers/net/ethernet/intel/ice/ice_dcb_lib.h  |   2 +-\n drivers/net/ethernet/intel/ice/ice_dcb_nl.c   |  14 +-\n drivers/net/ethernet/intel/ice/ice_ethtool.c  |  57 +++---\n drivers/net/ethernet/intel/ice/ice_lib.c      | 155 ++++++++------\n drivers/net/ethernet/intel/ice/ice_main.c     | 171 ++++++++--------\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 191 ++++++++++--------\n drivers/net/ethernet/intel/ice/ice_xsk.c      |   4 +-\n 10 files changed, 389 insertions(+), 341 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 8d7e8fc55585..cb7259c27353 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -130,6 +130,8 @@ extern const char ice_drv_ver[];\n \t\t\t\t     ICE_PROMISC_VLAN_TX  | \\\n \t\t\t\t     ICE_PROMISC_VLAN_RX)\n \n+#define ice_pf_to_dev(pf) (&((pf)->pdev->dev))\n+\n struct ice_txq_meta {\n \tu32 q_teid;\t/* Tx-scheduler element identifier */\n \tu16 q_id;\t/* Entry in VSI's txq_map bitmap */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c\nindex 69d2da14fe5c..77d6a0291e97 100644\n--- a/drivers/net/ethernet/intel/ice/ice_base.c\n+++ b/drivers/net/ethernet/intel/ice/ice_base.c\n@@ -101,7 +101,8 @@ static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, int v_idx)\n \tstruct ice_q_vector *q_vector;\n \n \t/* allocate q_vector */\n-\tq_vector = devm_kzalloc(&pf->pdev->dev, sizeof(*q_vector), GFP_KERNEL);\n+\tq_vector = devm_kzalloc(ice_pf_to_dev(pf), sizeof(*q_vector),\n+\t\t\t\tGFP_KERNEL);\n \tif (!q_vector)\n \t\treturn -ENOMEM;\n \n@@ -138,10 +139,11 @@ static void ice_free_q_vector(struct ice_vsi *vsi, int v_idx)\n \tstruct ice_q_vector *q_vector;\n \tstruct ice_pf *pf = vsi->back;\n \tstruct ice_ring *ring;\n+\tstruct device *dev;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (!vsi->q_vectors[v_idx]) {\n-\t\tdev_dbg(&pf->pdev->dev, \"Queue vector at index %d not found\\n\",\n-\t\t\tv_idx);\n+\t\tdev_dbg(dev, \"Queue vector at index %d not found\\n\", v_idx);\n \t\treturn;\n \t}\n \tq_vector = vsi->q_vectors[v_idx];\n@@ -155,7 +157,7 @@ static void ice_free_q_vector(struct ice_vsi *vsi, int v_idx)\n \tif (vsi->netdev)\n \t\tnetif_napi_del(&q_vector->napi);\n \n-\tdevm_kfree(&pf->pdev->dev, q_vector);\n+\tdevm_kfree(dev, q_vector);\n \tvsi->q_vectors[v_idx] = NULL;\n }\n \n@@ -482,7 +484,7 @@ int ice_vsi_ctrl_rx_ring(struct ice_vsi *vsi, bool ena, u16 rxq_idx)\n \t/* wait for the change to finish */\n \tret = ice_pf_rxq_wait(pf, pf_q, ena);\n \tif (ret)\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(ice_pf_to_dev(pf),\n \t\t\t\"VSI idx %d Rx ring %d %sable timeout\\n\",\n \t\t\tvsi->idx, pf_q, (ena ? \"en\" : \"dis\"));\n \n@@ -500,11 +502,12 @@ int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = vsi->back;\n \tint v_idx = 0, num_q_vectors;\n+\tstruct device *dev;\n \tint err;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (vsi->q_vectors[0]) {\n-\t\tdev_dbg(&pf->pdev->dev, \"VSI %d has existing q_vectors\\n\",\n-\t\t\tvsi->vsi_num);\n+\t\tdev_dbg(dev, \"VSI %d has existing q_vectors\\n\", vsi->vsi_num);\n \t\treturn -EEXIST;\n \t}\n \n@@ -522,8 +525,7 @@ int ice_vsi_alloc_q_vectors(struct ice_vsi *vsi)\n \twhile (v_idx--)\n \t\tice_free_q_vector(vsi, v_idx);\n \n-\tdev_err(&pf->pdev->dev,\n-\t\t\"Failed to allocate %d q_vector for VSI %d, ret=%d\\n\",\n+\tdev_err(dev, \"Failed to allocate %d q_vector for VSI %d, ret=%d\\n\",\n \t\tvsi->num_q_vectors, vsi->vsi_num, err);\n \tvsi->num_q_vectors = 0;\n \treturn err;\n@@ -640,7 +642,7 @@ ice_vsi_cfg_txq(struct ice_vsi *vsi, struct ice_ring *ring,\n \tstatus = ice_ena_vsi_txq(vsi->port_info, vsi->idx, tc, ring->q_handle,\n \t\t\t\t 1, qg_buf, buf_len, NULL);\n \tif (status) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(ice_pf_to_dev(pf),\n \t\t\t\"Failed to set LAN Tx queue context, error: %d\\n\",\n \t\t\tstatus);\n \t\treturn -ENODEV;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\nindex 06736709968e..20b63443237c 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c\n@@ -160,6 +160,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n {\n \tstruct ice_aqc_port_ets_elem buf = { 0 };\n \tstruct ice_dcbx_cfg *old_cfg, *curr_cfg;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tint ret = ICE_DCB_NO_HW_CHG;\n \tstruct ice_vsi *pf_vsi;\n \n@@ -171,15 +172,15 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n \n \t/* Enable DCB tagging only when more than one TC */\n \tif (ice_dcb_get_num_tc(new_cfg) > 1) {\n-\t\tdev_dbg(&pf->pdev->dev, \"DCB tagging enabled (num TC > 1)\\n\");\n+\t\tdev_dbg(dev, \"DCB tagging enabled (num TC > 1)\\n\");\n \t\tset_bit(ICE_FLAG_DCB_ENA, pf->flags);\n \t} else {\n-\t\tdev_dbg(&pf->pdev->dev, \"DCB tagging disabled (num TC = 1)\\n\");\n+\t\tdev_dbg(dev, \"DCB tagging disabled (num TC = 1)\\n\");\n \t\tclear_bit(ICE_FLAG_DCB_ENA, pf->flags);\n \t}\n \n \tif (!memcmp(new_cfg, curr_cfg, sizeof(*new_cfg))) {\n-\t\tdev_dbg(&pf->pdev->dev, \"No change in DCB config required\\n\");\n+\t\tdev_dbg(dev, \"No change in DCB config required\\n\");\n \t\treturn ret;\n \t}\n \n@@ -188,10 +189,10 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n \tif (!old_cfg)\n \t\treturn -ENOMEM;\n \n-\tdev_info(&pf->pdev->dev, \"Commit DCB Configuration to the hardware\\n\");\n+\tdev_info(dev, \"Commit DCB Configuration to the hardware\\n\");\n \tpf_vsi = ice_get_main_vsi(pf);\n \tif (!pf_vsi) {\n-\t\tdev_dbg(&pf->pdev->dev, \"PF VSI doesn't exist\\n\");\n+\t\tdev_dbg(dev, \"PF VSI doesn't exist\\n\");\n \t\tret = -EINVAL;\n \t\tgoto free_cfg;\n \t}\n@@ -213,7 +214,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n \tif (pf->hw.port_info->is_sw_lldp) {\n \t\tret = ice_set_dcb_cfg(pf->hw.port_info);\n \t\tif (ret) {\n-\t\t\tdev_err(&pf->pdev->dev, \"Set DCB Config failed\\n\");\n+\t\t\tdev_err(dev, \"Set DCB Config failed\\n\");\n \t\t\t/* Restore previous settings to local config */\n \t\t\tmemcpy(curr_cfg, old_cfg, sizeof(*curr_cfg));\n \t\t\tgoto out;\n@@ -222,7 +223,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)\n \n \tret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Query Port ETS failed\\n\");\n+\t\tdev_err(dev, \"Query Port ETS failed\\n\");\n \t\tgoto out;\n \t}\n \n@@ -269,6 +270,7 @@ static bool\n ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,\n \t\t   struct ice_dcbx_cfg *new_cfg)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tbool need_reconfig = false;\n \n \t/* Check if ETS configuration has changed */\n@@ -279,33 +281,33 @@ ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg,\n \t\t\t   &old_cfg->etscfg.prio_table,\n \t\t\t   sizeof(new_cfg->etscfg.prio_table))) {\n \t\t\tneed_reconfig = true;\n-\t\t\tdev_dbg(&pf->pdev->dev, \"ETS UP2TC changed.\\n\");\n+\t\t\tdev_dbg(dev, \"ETS UP2TC changed.\\n\");\n \t\t}\n \n \t\tif (memcmp(&new_cfg->etscfg.tcbwtable,\n \t\t\t   &old_cfg->etscfg.tcbwtable,\n \t\t\t   sizeof(new_cfg->etscfg.tcbwtable)))\n-\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TC BW Table changed.\\n\");\n+\t\t\tdev_dbg(dev, \"ETS TC BW Table changed.\\n\");\n \n \t\tif (memcmp(&new_cfg->etscfg.tsatable,\n \t\t\t   &old_cfg->etscfg.tsatable,\n \t\t\t   sizeof(new_cfg->etscfg.tsatable)))\n-\t\t\tdev_dbg(&pf->pdev->dev, \"ETS TSA Table changed.\\n\");\n+\t\t\tdev_dbg(dev, \"ETS TSA Table changed.\\n\");\n \t}\n \n \t/* Check if PFC configuration has changed */\n \tif (memcmp(&new_cfg->pfc, &old_cfg->pfc, sizeof(new_cfg->pfc))) {\n \t\tneed_reconfig = true;\n-\t\tdev_dbg(&pf->pdev->dev, \"PFC config change detected.\\n\");\n+\t\tdev_dbg(dev, \"PFC config change detected.\\n\");\n \t}\n \n \t/* Check if APP Table has changed */\n \tif (memcmp(&new_cfg->app, &old_cfg->app, sizeof(new_cfg->app))) {\n \t\tneed_reconfig = true;\n-\t\tdev_dbg(&pf->pdev->dev, \"APP Table change detected.\\n\");\n+\t\tdev_dbg(dev, \"APP Table change detected.\\n\");\n \t}\n \n-\tdev_dbg(&pf->pdev->dev, \"dcb need_reconfig=%d\\n\", need_reconfig);\n+\tdev_dbg(dev, \"dcb need_reconfig=%d\\n\", need_reconfig);\n \treturn need_reconfig;\n }\n \n@@ -317,11 +319,12 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n {\n \tstruct ice_dcbx_cfg *local_dcbx_cfg, *desired_dcbx_cfg, *prev_cfg;\n \tstruct ice_aqc_port_ets_elem buf = { 0 };\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tenum ice_status ret;\n \n \tret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Query Port ETS failed\\n\");\n+\t\tdev_err(dev, \"Query Port ETS failed\\n\");\n \t\tgoto dcb_error;\n \t}\n \n@@ -340,16 +343,14 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \tice_cfg_etsrec_defaults(pf->hw.port_info);\n \tret = ice_set_dcb_cfg(pf->hw.port_info);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Failed to set DCB to unwilling\\n\");\n+\t\tdev_err(dev, \"Failed to set DCB to unwilling\\n\");\n \t\tgoto dcb_error;\n \t}\n \n \t/* Retrieve DCB config and ensure same as current in SW */\n \tprev_cfg = kmemdup(local_dcbx_cfg, sizeof(*prev_cfg), GFP_KERNEL);\n-\tif (!prev_cfg) {\n-\t\tdev_err(&pf->pdev->dev, \"Failed to alloc space for DCB cfg\\n\");\n+\tif (!prev_cfg)\n \t\tgoto dcb_error;\n-\t}\n \n \tice_init_dcb(&pf->hw, true);\n \tif (pf->hw.port_info->dcbx_status == ICE_DCBX_STATUS_DIS)\n@@ -359,7 +360,7 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \n \tif (ice_dcb_need_recfg(pf, prev_cfg, local_dcbx_cfg)) {\n \t\t/* difference in cfg detected - disable DCB till next MIB */\n-\t\tdev_err(&pf->pdev->dev, \"Set local MIB not accurate\\n\");\n+\t\tdev_err(dev, \"Set local MIB not accurate\\n\");\n \t\tkfree(prev_cfg);\n \t\tgoto dcb_error;\n \t}\n@@ -375,20 +376,20 @@ void ice_dcb_rebuild(struct ice_pf *pf)\n \tice_cfg_etsrec_defaults(pf->hw.port_info);\n \tret = ice_set_dcb_cfg(pf->hw.port_info);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Failed to set desired config\\n\");\n+\t\tdev_err(dev, \"Failed to set desired config\\n\");\n \t\tgoto dcb_error;\n \t}\n-\tdev_info(&pf->pdev->dev, \"DCB restored after reset\\n\");\n+\tdev_info(dev, \"DCB restored after reset\\n\");\n \tret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Query Port ETS failed\\n\");\n+\t\tdev_err(dev, \"Query Port ETS failed\\n\");\n \t\tgoto dcb_error;\n \t}\n \n \treturn;\n \n dcb_error:\n-\tdev_err(&pf->pdev->dev, \"Disabling DCB until new settings occur\\n\");\n+\tdev_err(dev, \"Disabling DCB until new settings occur\\n\");\n \tprev_cfg = kzalloc(sizeof(*prev_cfg), GFP_KERNEL);\n \tif (!prev_cfg)\n \t\treturn;\n@@ -419,7 +420,7 @@ static int ice_dcb_init_cfg(struct ice_pf *pf, bool locked)\n \n \tmemset(&pi->local_dcbx_cfg, 0, sizeof(*newcfg));\n \n-\tdev_info(&pf->pdev->dev, \"Configuring initial DCB values\\n\");\n+\tdev_info(ice_pf_to_dev(pf), \"Configuring initial DCB values\\n\");\n \tif (ice_pf_dcb_cfg(pf, newcfg, locked))\n \t\tret = -EINVAL;\n \n@@ -507,13 +508,13 @@ static bool ice_dcb_tc_contig(u8 *prio_table)\n static int ice_dcb_noncontig_cfg(struct ice_pf *pf)\n {\n \tstruct ice_dcbx_cfg *dcbcfg = &pf->hw.port_info->local_dcbx_cfg;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tint ret;\n \n \t/* Configure SW DCB default with ETS non-willing */\n \tret = ice_dcb_sw_dflt_cfg(pf, false, true);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Failed to set local DCB config %d\\n\", ret);\n+\t\tdev_err(dev, \"Failed to set local DCB config %d\\n\", ret);\n \t\treturn ret;\n \t}\n \n@@ -521,7 +522,7 @@ static int ice_dcb_noncontig_cfg(struct ice_pf *pf)\n \tdcbcfg->etscfg.willing = 1;\n \tret = ice_set_dcb_cfg(pf->hw.port_info);\n \tif (ret)\n-\t\tdev_err(&pf->pdev->dev, \"Failed to set DCB to unwilling\\n\");\n+\t\tdev_err(dev, \"Failed to set DCB to unwilling\\n\");\n \n \treturn ret;\n }\n@@ -542,10 +543,12 @@ static void ice_pf_dcb_recfg(struct ice_pf *pf)\n \n \t/* Update each VSI */\n \tice_for_each_vsi(pf, v) {\n-\t\tif (!pf->vsi[v])\n+\t\tstruct ice_vsi *vsi = pf->vsi[v];\n+\n+\t\tif (!vsi)\n \t\t\tcontinue;\n \n-\t\tif (pf->vsi[v]->type == ICE_VSI_PF) {\n+\t\tif (vsi->type == ICE_VSI_PF) {\n \t\t\ttc_map = ice_dcb_get_ena_tc(dcbcfg);\n \n \t\t\t/* If DCBX request non-contiguous TC, then configure\n@@ -559,17 +562,16 @@ static void ice_pf_dcb_recfg(struct ice_pf *pf)\n \t\t\ttc_map = ICE_DFLT_TRAFFIC_CLASS;\n \t\t}\n \n-\t\tret = ice_vsi_cfg_tc(pf->vsi[v], tc_map);\n+\t\tret = ice_vsi_cfg_tc(vsi, tc_map);\n \t\tif (ret) {\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Failed to config TC for VSI index: %d\\n\",\n-\t\t\t\tpf->vsi[v]->idx);\n+\t\t\tdev_err(ice_pf_to_dev(pf), \"Failed to config TC for VSI index: %d\\n\",\n+\t\t\t\tvsi->idx);\n \t\t\tcontinue;\n \t\t}\n \n-\t\tice_vsi_map_rings_to_vectors(pf->vsi[v]);\n-\t\tif (pf->vsi[v]->type == ICE_VSI_PF)\n-\t\t\tice_dcbnl_set_all(pf->vsi[v]);\n+\t\tice_vsi_map_rings_to_vectors(vsi);\n+\t\tif (vsi->type == ICE_VSI_PF)\n+\t\t\tice_dcbnl_set_all(vsi);\n \t}\n }\n \n@@ -580,7 +582,7 @@ static void ice_pf_dcb_recfg(struct ice_pf *pf)\n  */\n int ice_init_pf_dcb(struct ice_pf *pf, bool locked)\n {\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_port_info *port_info;\n \tstruct ice_hw *hw = &pf->hw;\n \tint err;\n@@ -589,23 +591,22 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)\n \n \terr = ice_init_dcb(hw, false);\n \tif (err && !port_info->is_sw_lldp) {\n-\t\tdev_err(&pf->pdev->dev, \"Error initializing DCB %d\\n\", err);\n+\t\tdev_err(dev, \"Error initializing DCB %d\\n\", err);\n \t\tgoto dcb_init_err;\n \t}\n \n-\tdev_info(&pf->pdev->dev,\n+\tdev_info(dev,\n \t\t \"DCB is enabled in the hardware, max number of TCs supported on this port are %d\\n\",\n \t\t pf->hw.func_caps.common_cap.maxtc);\n \tif (err) {\n \t\tstruct ice_vsi *pf_vsi;\n \n \t\t/* FW LLDP is disabled, activate SW DCBX/LLDP mode */\n-\t\tdev_info(&pf->pdev->dev,\n-\t\t\t \"FW LLDP is disabled, DCBx/LLDP in SW mode.\\n\");\n+\t\tdev_info(dev, \"FW LLDP is disabled, DCBx/LLDP in SW mode.\\n\");\n \t\tclear_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);\n \t\terr = ice_dcb_sw_dflt_cfg(pf, true, locked);\n \t\tif (err) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"Failed to set local DCB config %d\\n\", err);\n \t\t\terr = -EIO;\n \t\t\tgoto dcb_init_err;\n@@ -616,8 +617,7 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)\n \t\t */\n \t\tpf_vsi = ice_get_main_vsi(pf);\n \t\tif (!pf_vsi) {\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Failed to set local DCB config\\n\");\n+\t\t\tdev_err(dev, \"Failed to set local DCB config\\n\");\n \t\t\terr = -EIO;\n \t\t\tgoto dcb_init_err;\n \t\t}\n@@ -732,6 +732,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t\t\t\t    struct ice_rq_event_info *event)\n {\n \tstruct ice_aqc_port_ets_elem buf = { 0 };\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_aqc_lldp_get_mib *mib;\n \tstruct ice_dcbx_cfg tmp_dcbx_cfg;\n \tbool need_reconfig = false;\n@@ -745,8 +746,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t\treturn;\n \n \tif (pf->dcbx_cap & DCB_CAP_DCBX_HOST) {\n-\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\"MIB Change Event in HOST mode\\n\");\n+\t\tdev_dbg(dev, \"MIB Change Event in HOST mode\\n\");\n \t\treturn;\n \t}\n \n@@ -755,21 +755,20 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t/* Ignore if event is not for Nearest Bridge */\n \ttype = ((mib->type >> ICE_AQ_LLDP_BRID_TYPE_S) &\n \t\tICE_AQ_LLDP_BRID_TYPE_M);\n-\tdev_dbg(&pf->pdev->dev, \"LLDP event MIB bridge type 0x%x\\n\", type);\n+\tdev_dbg(dev, \"LLDP event MIB bridge type 0x%x\\n\", type);\n \tif (type != ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID)\n \t\treturn;\n \n \t/* Check MIB Type and return if event for Remote MIB update */\n \ttype = mib->type & ICE_AQ_LLDP_MIB_TYPE_M;\n-\tdev_dbg(&pf->pdev->dev,\n-\t\t\"LLDP event mib type %s\\n\", type ? \"remote\" : \"local\");\n+\tdev_dbg(dev, \"LLDP event mib type %s\\n\", type ? \"remote\" : \"local\");\n \tif (type == ICE_AQ_LLDP_MIB_REMOTE) {\n \t\t/* Update the remote cached instance and return */\n \t\tret = ice_aq_get_dcb_cfg(pi->hw, ICE_AQ_LLDP_MIB_REMOTE,\n \t\t\t\t\t ICE_AQ_LLDP_BRID_TYPE_NEAREST_BRID,\n \t\t\t\t\t &pi->remote_dcbx_cfg);\n \t\tif (ret) {\n-\t\t\tdev_err(&pf->pdev->dev, \"Failed to get remote DCB config\\n\");\n+\t\t\tdev_err(dev, \"Failed to get remote DCB config\\n\");\n \t\t\treturn;\n \t\t}\n \t}\n@@ -783,14 +782,13 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \t/* Get updated DCBX data from firmware */\n \tret = ice_get_dcb_cfg(pf->hw.port_info);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Failed to get DCB config\\n\");\n+\t\tdev_err(dev, \"Failed to get DCB config\\n\");\n \t\treturn;\n \t}\n \n \t/* No change detected in DCBX configs */\n \tif (!memcmp(&tmp_dcbx_cfg, &pi->local_dcbx_cfg, sizeof(tmp_dcbx_cfg))) {\n-\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\"No change detected in DCBX configuration.\\n\");\n+\t\tdev_dbg(dev, \"No change detected in DCBX configuration.\\n\");\n \t\treturn;\n \t}\n \n@@ -802,16 +800,16 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \n \t/* Enable DCB tagging only when more than one TC */\n \tif (ice_dcb_get_num_tc(&pi->local_dcbx_cfg) > 1) {\n-\t\tdev_dbg(&pf->pdev->dev, \"DCB tagging enabled (num TC > 1)\\n\");\n+\t\tdev_dbg(dev, \"DCB tagging enabled (num TC > 1)\\n\");\n \t\tset_bit(ICE_FLAG_DCB_ENA, pf->flags);\n \t} else {\n-\t\tdev_dbg(&pf->pdev->dev, \"DCB tagging disabled (num TC = 1)\\n\");\n+\t\tdev_dbg(dev, \"DCB tagging disabled (num TC = 1)\\n\");\n \t\tclear_bit(ICE_FLAG_DCB_ENA, pf->flags);\n \t}\n \n \tpf_vsi = ice_get_main_vsi(pf);\n \tif (!pf_vsi) {\n-\t\tdev_dbg(&pf->pdev->dev, \"PF VSI doesn't exist\\n\");\n+\t\tdev_dbg(dev, \"PF VSI doesn't exist\\n\");\n \t\treturn;\n \t}\n \n@@ -820,7 +818,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,\n \n \tret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev, \"Query Port ETS failed\\n\");\n+\t\tdev_err(dev, \"Query Port ETS failed\\n\");\n \t\trtnl_unlock();\n \t\treturn;\n \t}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\nindex e90e25b7da77..c81d7f69d5c4 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.h\n@@ -58,7 +58,7 @@ ice_dcb_get_tc(struct ice_vsi __always_unused *vsi,\n static inline int\n ice_init_pf_dcb(struct ice_pf *pf, bool __always_unused locked)\n {\n-\tdev_dbg(&pf->pdev->dev, \"DCB not supported\\n\");\n+\tdev_dbg(ice_pf_to_dev(pf), \"DCB not supported\\n\");\n \treturn -EOPNOTSUPP;\n }\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcb_nl.c b/drivers/net/ethernet/intel/ice/ice_dcb_nl.c\nindex 717efbb7c4d1..0851b5a5246a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcb_nl.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcb_nl.c\n@@ -179,7 +179,7 @@ static u8 ice_dcbnl_setdcbx(struct net_device *netdev, u8 mode)\n \telse\n \t\tpf->hw.port_info->local_dcbx_cfg.dcbx_mode = ICE_DCBX_MODE_IEEE;\n \n-\tdev_info(&pf->pdev->dev, \"DCBx mode = 0x%x\\n\", mode);\n+\tdev_info(ice_pf_to_dev(pf), \"DCBx mode = 0x%x\\n\", mode);\n \treturn ICE_DCB_HW_CHG_RST;\n }\n \n@@ -297,7 +297,7 @@ ice_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio, u8 *setting)\n \t\treturn;\n \n \t*setting = (pi->local_dcbx_cfg.pfc.pfcena >> prio) & 0x1;\n-\tdev_dbg(&pf->pdev->dev,\n+\tdev_dbg(ice_pf_to_dev(pf),\n \t\t\"Get PFC Config up=%d, setting=%d, pfcenable=0x%x\\n\",\n \t\tprio, *setting, pi->local_dcbx_cfg.pfc.pfcena);\n }\n@@ -328,7 +328,7 @@ static void ice_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio, u8 set)\n \telse\n \t\tnew_cfg->pfc.pfcena &= ~BIT(prio);\n \n-\tdev_dbg(&pf->pdev->dev, \"Set PFC config UP:%d set:%d pfcena:0x%x\\n\",\n+\tdev_dbg(ice_pf_to_dev(pf), \"Set PFC config UP:%d set:%d pfcena:0x%x\\n\",\n \t\tprio, set, new_cfg->pfc.pfcena);\n }\n \n@@ -359,7 +359,7 @@ static u8 ice_dcbnl_getstate(struct net_device *netdev)\n \n \tstate = test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);\n \n-\tdev_dbg(&pf->pdev->dev, \"DCB enabled state = %d\\n\", state);\n+\tdev_dbg(ice_pf_to_dev(pf), \"DCB enabled state = %d\\n\", state);\n \treturn state;\n }\n \n@@ -418,7 +418,7 @@ ice_dcbnl_get_pg_tc_cfg_tx(struct net_device *netdev, int prio,\n \t\treturn;\n \n \t*pgid = pi->local_dcbx_cfg.etscfg.prio_table[prio];\n-\tdev_dbg(&pf->pdev->dev,\n+\tdev_dbg(ice_pf_to_dev(pf),\n \t\t\"Get PG config prio=%d tc=%d\\n\", prio, *pgid);\n }\n \n@@ -479,7 +479,7 @@ ice_dcbnl_get_pg_bwg_cfg_tx(struct net_device *netdev, int pgid, u8 *bw_pct)\n \t\treturn;\n \n \t*bw_pct = pi->local_dcbx_cfg.etscfg.tcbwtable[pgid];\n-\tdev_dbg(&pf->pdev->dev, \"Get PG BW config tc=%d bw_pct=%d\\n\",\n+\tdev_dbg(ice_pf_to_dev(pf), \"Get PG BW config tc=%d bw_pct=%d\\n\",\n \t\tpgid, *bw_pct);\n }\n \n@@ -597,7 +597,7 @@ static u8 ice_dcbnl_get_cap(struct net_device *netdev, int capid, u8 *cap)\n \t\tbreak;\n \t}\n \n-\tdev_dbg(&pf->pdev->dev, \"DCBX Get Capability cap=%d capval=0x%x\\n\",\n+\tdev_dbg(ice_pf_to_dev(pf), \"DCBX Get Capability cap=%d capval=0x%x\\n\",\n \t\tcapid, *cap);\n \treturn 0;\n }\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c\nindex 0ee78fd1bdfb..5b229f3703b5 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c\n@@ -248,7 +248,7 @@ ice_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,\n \tint ret = 0;\n \tu16 *buf;\n \n-\tdev = &pf->pdev->dev;\n+\tdev = ice_pf_to_dev(pf);\n \n \teeprom->magic = hw->vendor_id | (hw->device_id << 16);\n \n@@ -343,6 +343,7 @@ static u64 ice_eeprom_test(struct net_device *netdev)\n static int ice_reg_pattern_test(struct ice_hw *hw, u32 reg, u32 mask)\n {\n \tstruct ice_pf *pf = (struct ice_pf *)hw->back;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstatic const u32 patterns[] = {\n \t\t0x5A5A5A5A, 0xA5A5A5A5,\n \t\t0x00000000, 0xFFFFFFFF\n@@ -358,7 +359,7 @@ static int ice_reg_pattern_test(struct ice_hw *hw, u32 reg, u32 mask)\n \t\tval = rd32(hw, reg);\n \t\tif (val == pattern)\n \t\t\tcontinue;\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"%s: reg pattern test failed - reg 0x%08x pat 0x%08x val 0x%08x\\n\"\n \t\t\t, __func__, reg, pattern, val);\n \t\treturn 1;\n@@ -367,7 +368,7 @@ static int ice_reg_pattern_test(struct ice_hw *hw, u32 reg, u32 mask)\n \twr32(hw, reg, orig_val);\n \tval = rd32(hw, reg);\n \tif (val != orig_val) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"%s: reg restore test failed - reg 0x%08x orig 0x%08x val 0x%08x\\n\"\n \t\t\t, __func__, reg, orig_val, val);\n \t\treturn 1;\n@@ -507,7 +508,7 @@ static int ice_lbtest_create_frame(struct ice_pf *pf, u8 **ret_data, u16 size)\n \tif (!pf)\n \t\treturn -EINVAL;\n \n-\tdata = devm_kzalloc(&pf->pdev->dev, size, GFP_KERNEL);\n+\tdata = devm_kzalloc(ice_pf_to_dev(pf), size, GFP_KERNEL);\n \tif (!data)\n \t\treturn -ENOMEM;\n \n@@ -649,9 +650,11 @@ static u64 ice_loopback_test(struct net_device *netdev)\n \tu8 broadcast[ETH_ALEN], ret = 0;\n \tint num_frames, valid_frames;\n \tLIST_HEAD(tmp_list);\n+\tstruct device *dev;\n \tu8 *tx_frame;\n \tint i;\n \n+\tdev = ice_pf_to_dev(pf);\n \tnetdev_info(netdev, \"loopback test\\n\");\n \n \ttest_vsi = ice_lb_vsi_setup(pf, pf->hw.port_info);\n@@ -712,12 +715,12 @@ static u64 ice_loopback_test(struct net_device *netdev)\n \t\tret = 10;\n \n lbtest_free_frame:\n-\tdevm_kfree(&pf->pdev->dev, tx_frame);\n+\tdevm_kfree(dev, tx_frame);\n remove_mac_filters:\n \tif (ice_remove_mac(&pf->hw, &tmp_list))\n \t\tnetdev_err(netdev, \"Could not remove MAC filter for the test VSI\");\n free_mac_list:\n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_list);\n+\tice_free_fltr_list(dev, &tmp_list);\n lbtest_mac_dis:\n \t/* Disable MAC loopback after the test is completed. */\n \tif (ice_aq_set_mac_loopback(&pf->hw, false, NULL))\n@@ -774,6 +777,9 @@ ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test,\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tbool if_running = netif_running(netdev);\n \tstruct ice_pf *pf = np->vsi->back;\n+\tstruct device *dev;\n+\n+\tdev = ice_pf_to_dev(pf);\n \n \tif (eth_test->flags == ETH_TEST_FL_OFFLINE) {\n \t\tnetdev_info(netdev, \"offline testing starting\\n\");\n@@ -781,7 +787,7 @@ ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test,\n \t\tset_bit(__ICE_TESTING, pf->state);\n \n \t\tif (ice_active_vfs(pf)) {\n-\t\t\tdev_warn(&pf->pdev->dev,\n+\t\t\tdev_warn(dev,\n \t\t\t\t \"Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\\n\");\n \t\t\tdata[ICE_ETH_TEST_REG] = 1;\n \t\t\tdata[ICE_ETH_TEST_EEPROM] = 1;\n@@ -816,8 +822,7 @@ ice_self_test(struct net_device *netdev, struct ethtool_test *eth_test,\n \t\t\tint status = ice_open(netdev);\n \n \t\t\tif (status) {\n-\t\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\t\"Could not open device %s, err %d\",\n+\t\t\t\tdev_err(dev, \"Could not open device %s, err %d\",\n \t\t\t\t\tpf->int_name, status);\n \t\t\t}\n \t\t}\n@@ -1155,12 +1160,14 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \tDECLARE_BITMAP(orig_flags, ICE_PF_FLAGS_NBITS);\n \tstruct ice_vsi *vsi = np->vsi;\n \tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n \tint ret = 0;\n \tu32 i;\n \n \tif (flags > BIT(ICE_PRIV_FLAG_ARRAY_SIZE))\n \t\treturn -EINVAL;\n \n+\tdev = ice_pf_to_dev(pf);\n \tset_bit(ICE_FLAG_ETHTOOL_CTXT, pf->flags);\n \n \tbitmap_copy(orig_flags, pf->flags, ICE_PF_FLAGS_NBITS);\n@@ -1189,7 +1196,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t * events to respond to.\n \t\t\t */\n \t\t\tif (status)\n-\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\tdev_info(dev,\n \t\t\t\t\t \"Failed to unreg for LLDP events\\n\");\n \n \t\t\t/* The AQ call to stop the FW LLDP agent will generate\n@@ -1197,15 +1204,14 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t */\n \t\t\tstatus = ice_aq_stop_lldp(&pf->hw, true, true, NULL);\n \t\t\tif (status)\n-\t\t\t\tdev_warn(&pf->pdev->dev,\n-\t\t\t\t\t \"Fail to stop LLDP agent\\n\");\n+\t\t\t\tdev_warn(dev, \"Fail to stop LLDP agent\\n\");\n \t\t\t/* Use case for having the FW LLDP agent stopped\n \t\t\t * will likely not need DCB, so failure to init is\n \t\t\t * not a concern of ethtool\n \t\t\t */\n \t\t\tstatus = ice_init_pf_dcb(pf, true);\n \t\t\tif (status)\n-\t\t\t\tdev_warn(&pf->pdev->dev, \"Fail to init DCB\\n\");\n+\t\t\t\tdev_warn(dev, \"Fail to init DCB\\n\");\n \t\t} else {\n \t\t\tenum ice_status status;\n \t\t\tbool dcbx_agent_status;\n@@ -1215,8 +1221,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t */\n \t\t\tstatus = ice_aq_start_lldp(&pf->hw, true, NULL);\n \t\t\tif (status)\n-\t\t\t\tdev_warn(&pf->pdev->dev,\n-\t\t\t\t\t \"Fail to start LLDP Agent\\n\");\n+\t\t\t\tdev_warn(dev, \"Fail to start LLDP Agent\\n\");\n \n \t\t\t/* AQ command to start FW DCBX agent will fail if\n \t\t\t * the agent is already started\n@@ -1225,10 +1230,9 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t\t\t\t\t&dcbx_agent_status,\n \t\t\t\t\t\t\tNULL);\n \t\t\tif (status)\n-\t\t\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\t\t\"Failed to start FW DCBX\\n\");\n+\t\t\t\tdev_dbg(dev, \"Failed to start FW DCBX\\n\");\n \n-\t\t\tdev_info(&pf->pdev->dev, \"FW DCBX agent is %s\\n\",\n+\t\t\tdev_info(dev, \"FW DCBX agent is %s\\n\",\n \t\t\t\t dcbx_agent_status ? \"ACTIVE\" : \"DISABLED\");\n \n \t\t\t/* Failure to configure MIB change or init DCB is not\n@@ -1238,7 +1242,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t */\n \t\t\tstatus = ice_init_pf_dcb(pf, true);\n \t\t\tif (status)\n-\t\t\t\tdev_dbg(&pf->pdev->dev, \"Fail to init DCB\\n\");\n+\t\t\t\tdev_dbg(dev, \"Fail to init DCB\\n\");\n \n \t\t\t/* Remove rule to direct LLDP packets to default VSI.\n \t\t\t * The FW LLDP engine will now be consuming them.\n@@ -1248,7 +1252,7 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)\n \t\t\t/* Register for MIB change events */\n \t\t\tstatus = ice_cfg_lldp_mib_change(&pf->hw, true);\n \t\t\tif (status)\n-\t\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\tdev_dbg(dev,\n \t\t\t\t\t\"Fail to enable MIB change events\\n\");\n \t\t}\n \t}\n@@ -3089,8 +3093,10 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key,\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_vsi *vsi = np->vsi;\n \tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n \tu8 *seed = NULL;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP)\n \t\treturn -EOPNOTSUPP;\n \n@@ -3103,8 +3109,7 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key,\n \tif (key) {\n \t\tif (!vsi->rss_hkey_user) {\n \t\t\tvsi->rss_hkey_user =\n-\t\t\t\tdevm_kzalloc(&pf->pdev->dev,\n-\t\t\t\t\t     ICE_VSIQF_HKEY_ARRAY_SIZE,\n+\t\t\t\tdevm_kzalloc(dev, ICE_VSIQF_HKEY_ARRAY_SIZE,\n \t\t\t\t\t     GFP_KERNEL);\n \t\t\tif (!vsi->rss_hkey_user)\n \t\t\t\treturn -ENOMEM;\n@@ -3114,8 +3119,7 @@ ice_set_rxfh(struct net_device *netdev, const u32 *indir, const u8 *key,\n \t}\n \n \tif (!vsi->rss_lut_user) {\n-\t\tvsi->rss_lut_user = devm_kzalloc(&pf->pdev->dev,\n-\t\t\t\t\t\t vsi->rss_table_size,\n+\t\tvsi->rss_lut_user = devm_kzalloc(dev, vsi->rss_table_size,\n \t\t\t\t\t\t GFP_KERNEL);\n \t\tif (!vsi->rss_lut_user)\n \t\t\treturn -ENOMEM;\n@@ -3177,7 +3181,7 @@ ice_get_rc_coalesce(struct ethtool_coalesce *ec, enum ice_container_type c_type,\n \t\tec->tx_coalesce_usecs = rc->itr_setting & ~ICE_ITR_DYNAMIC;\n \t\tbreak;\n \tdefault:\n-\t\tdev_dbg(&pf->pdev->dev, \"Invalid c_type %d\\n\", c_type);\n+\t\tdev_dbg(ice_pf_to_dev(pf), \"Invalid c_type %d\\n\", c_type);\n \t\treturn -EINVAL;\n \t}\n \n@@ -3317,7 +3321,8 @@ ice_set_rc_coalesce(enum ice_container_type c_type, struct ethtool_coalesce *ec,\n \n \t\tbreak;\n \tdefault:\n-\t\tdev_dbg(&pf->pdev->dev, \"Invalid container type %d\\n\", c_type);\n+\t\tdev_dbg(ice_pf_to_dev(pf), \"Invalid container type %d\\n\",\n+\t\t\tc_type);\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c\nindex de9f616b163e..b546c69a4bbc 100644\n--- a/drivers/net/ethernet/intel/ice/ice_lib.c\n+++ b/drivers/net/ethernet/intel/ice/ice_lib.c\n@@ -52,26 +52,29 @@ static int ice_vsi_ctrl_rx_rings(struct ice_vsi *vsi, bool ena)\n static int ice_vsi_alloc_arrays(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n+\n+\tdev = ice_pf_to_dev(pf);\n \n \t/* allocate memory for both Tx and Rx ring pointers */\n-\tvsi->tx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_txq,\n+\tvsi->tx_rings = devm_kcalloc(dev, vsi->alloc_txq,\n \t\t\t\t     sizeof(*vsi->tx_rings), GFP_KERNEL);\n \tif (!vsi->tx_rings)\n \t\treturn -ENOMEM;\n \n-\tvsi->rx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_rxq,\n+\tvsi->rx_rings = devm_kcalloc(dev, vsi->alloc_rxq,\n \t\t\t\t     sizeof(*vsi->rx_rings), GFP_KERNEL);\n \tif (!vsi->rx_rings)\n \t\tgoto err_rings;\n \n \t/* XDP will have vsi->alloc_txq Tx queues as well, so double the size */\n-\tvsi->txq_map = devm_kcalloc(&pf->pdev->dev, (2 * vsi->alloc_txq),\n+\tvsi->txq_map = devm_kcalloc(dev, (2 * vsi->alloc_txq),\n \t\t\t\t    sizeof(*vsi->txq_map), GFP_KERNEL);\n \n \tif (!vsi->txq_map)\n \t\tgoto err_txq_map;\n \n-\tvsi->rxq_map = devm_kcalloc(&pf->pdev->dev, vsi->alloc_rxq,\n+\tvsi->rxq_map = devm_kcalloc(dev, vsi->alloc_rxq,\n \t\t\t\t    sizeof(*vsi->rxq_map), GFP_KERNEL);\n \tif (!vsi->rxq_map)\n \t\tgoto err_rxq_map;\n@@ -81,7 +84,7 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi)\n \t\treturn 0;\n \n \t/* allocate memory for q_vector pointers */\n-\tvsi->q_vectors = devm_kcalloc(&pf->pdev->dev, vsi->num_q_vectors,\n+\tvsi->q_vectors = devm_kcalloc(dev, vsi->num_q_vectors,\n \t\t\t\t      sizeof(*vsi->q_vectors), GFP_KERNEL);\n \tif (!vsi->q_vectors)\n \t\tgoto err_vectors;\n@@ -89,13 +92,13 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi)\n \treturn 0;\n \n err_vectors:\n-\tdevm_kfree(&pf->pdev->dev, vsi->rxq_map);\n+\tdevm_kfree(dev, vsi->rxq_map);\n err_rxq_map:\n-\tdevm_kfree(&pf->pdev->dev, vsi->txq_map);\n+\tdevm_kfree(dev, vsi->txq_map);\n err_txq_map:\n-\tdevm_kfree(&pf->pdev->dev, vsi->rx_rings);\n+\tdevm_kfree(dev, vsi->rx_rings);\n err_rings:\n-\tdevm_kfree(&pf->pdev->dev, vsi->tx_rings);\n+\tdevm_kfree(dev, vsi->tx_rings);\n \treturn -ENOMEM;\n }\n \n@@ -169,7 +172,7 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi, u16 vf_id)\n \t\tvsi->alloc_rxq = 1;\n \t\tbreak;\n \tdefault:\n-\t\tdev_warn(&pf->pdev->dev, \"Unknown VSI type %d\\n\", vsi->type);\n+\t\tdev_warn(ice_pf_to_dev(pf), \"Unknown VSI type %d\\n\", vsi->type);\n \t\tbreak;\n \t}\n \n@@ -227,8 +230,8 @@ void ice_vsi_delete(struct ice_vsi *vsi)\n \n \tstatus = ice_free_vsi(&pf->hw, vsi->idx, ctxt, false, NULL);\n \tif (status)\n-\t\tdev_err(&pf->pdev->dev, \"Failed to delete VSI %i in FW\\n\",\n-\t\t\tvsi->vsi_num);\n+\t\tdev_err(ice_pf_to_dev(pf), \"Failed to delete VSI %i in FW - error: %d\\n\",\n+\t\t\tvsi->vsi_num, status);\n \n \tkfree(ctxt);\n }\n@@ -240,26 +243,29 @@ void ice_vsi_delete(struct ice_vsi *vsi)\n static void ice_vsi_free_arrays(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n+\n+\tdev = ice_pf_to_dev(pf);\n \n \t/* free the ring and vector containers */\n \tif (vsi->q_vectors) {\n-\t\tdevm_kfree(&pf->pdev->dev, vsi->q_vectors);\n+\t\tdevm_kfree(dev, vsi->q_vectors);\n \t\tvsi->q_vectors = NULL;\n \t}\n \tif (vsi->tx_rings) {\n-\t\tdevm_kfree(&pf->pdev->dev, vsi->tx_rings);\n+\t\tdevm_kfree(dev, vsi->tx_rings);\n \t\tvsi->tx_rings = NULL;\n \t}\n \tif (vsi->rx_rings) {\n-\t\tdevm_kfree(&pf->pdev->dev, vsi->rx_rings);\n+\t\tdevm_kfree(dev, vsi->rx_rings);\n \t\tvsi->rx_rings = NULL;\n \t}\n \tif (vsi->txq_map) {\n-\t\tdevm_kfree(&pf->pdev->dev, vsi->txq_map);\n+\t\tdevm_kfree(dev, vsi->txq_map);\n \t\tvsi->txq_map = NULL;\n \t}\n \tif (vsi->rxq_map) {\n-\t\tdevm_kfree(&pf->pdev->dev, vsi->rxq_map);\n+\t\tdevm_kfree(dev, vsi->rxq_map);\n \t\tvsi->rxq_map = NULL;\n \t}\n }\n@@ -276,6 +282,7 @@ static void ice_vsi_free_arrays(struct ice_vsi *vsi)\n int ice_vsi_clear(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = NULL;\n+\tstruct device *dev;\n \n \tif (!vsi)\n \t\treturn 0;\n@@ -284,10 +291,10 @@ int ice_vsi_clear(struct ice_vsi *vsi)\n \t\treturn -EINVAL;\n \n \tpf = vsi->back;\n+\tdev = ice_pf_to_dev(pf);\n \n \tif (!pf->vsi[vsi->idx] || pf->vsi[vsi->idx] != vsi) {\n-\t\tdev_dbg(&pf->pdev->dev, \"vsi does not exist at pf->vsi[%d]\\n\",\n-\t\t\tvsi->idx);\n+\t\tdev_dbg(dev, \"vsi does not exist at pf->vsi[%d]\\n\", vsi->idx);\n \t\treturn -EINVAL;\n \t}\n \n@@ -300,7 +307,7 @@ int ice_vsi_clear(struct ice_vsi *vsi)\n \n \tice_vsi_free_arrays(vsi);\n \tmutex_unlock(&pf->sw_mutex);\n-\tdevm_kfree(&pf->pdev->dev, vsi);\n+\tdevm_kfree(dev, vsi);\n \n \treturn 0;\n }\n@@ -333,6 +340,7 @@ static irqreturn_t ice_msix_clean_rings(int __always_unused irq, void *data)\n static struct ice_vsi *\n ice_vsi_alloc(struct ice_pf *pf, enum ice_vsi_type type, u16 vf_id)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_vsi *vsi = NULL;\n \n \t/* Need to protect the allocation of the VSIs at the PF level */\n@@ -343,11 +351,11 @@ ice_vsi_alloc(struct ice_pf *pf, enum ice_vsi_type type, u16 vf_id)\n \t * is available to be populated\n \t */\n \tif (pf->next_vsi == ICE_NO_VSI) {\n-\t\tdev_dbg(&pf->pdev->dev, \"out of VSI slots!\\n\");\n+\t\tdev_dbg(dev, \"out of VSI slots!\\n\");\n \t\tgoto unlock_pf;\n \t}\n \n-\tvsi = devm_kzalloc(&pf->pdev->dev, sizeof(*vsi), GFP_KERNEL);\n+\tvsi = devm_kzalloc(dev, sizeof(*vsi), GFP_KERNEL);\n \tif (!vsi)\n \t\tgoto unlock_pf;\n \n@@ -379,7 +387,7 @@ ice_vsi_alloc(struct ice_pf *pf, enum ice_vsi_type type, u16 vf_id)\n \t\t\tgoto err_rings;\n \t\tbreak;\n \tdefault:\n-\t\tdev_warn(&pf->pdev->dev, \"Unknown VSI type %d\\n\", vsi->type);\n+\t\tdev_warn(dev, \"Unknown VSI type %d\\n\", vsi->type);\n \t\tgoto unlock_pf;\n \t}\n \n@@ -392,7 +400,7 @@ ice_vsi_alloc(struct ice_pf *pf, enum ice_vsi_type type, u16 vf_id)\n \tgoto unlock_pf;\n \n err_rings:\n-\tdevm_kfree(&pf->pdev->dev, vsi);\n+\tdevm_kfree(dev, vsi);\n \tvsi = NULL;\n unlock_pf:\n \tmutex_unlock(&pf->sw_mutex);\n@@ -481,14 +489,15 @@ bool ice_is_safe_mode(struct ice_pf *pf)\n  */\n static void ice_rss_clean(struct ice_vsi *vsi)\n {\n-\tstruct ice_pf *pf;\n+\tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n \n-\tpf = vsi->back;\n+\tdev = ice_pf_to_dev(pf);\n \n \tif (vsi->rss_hkey_user)\n-\t\tdevm_kfree(&pf->pdev->dev, vsi->rss_hkey_user);\n+\t\tdevm_kfree(dev, vsi->rss_hkey_user);\n \tif (vsi->rss_lut_user)\n-\t\tdevm_kfree(&pf->pdev->dev, vsi->rss_lut_user);\n+\t\tdevm_kfree(dev, vsi->rss_lut_user);\n }\n \n /**\n@@ -526,7 +535,7 @@ static void ice_vsi_set_rss_params(struct ice_vsi *vsi)\n \tcase ICE_VSI_LB:\n \t\tbreak;\n \tdefault:\n-\t\tdev_warn(&pf->pdev->dev, \"Unknown VSI type %d\\n\",\n+\t\tdev_warn(ice_pf_to_dev(pf), \"Unknown VSI type %d\\n\",\n \t\t\t vsi->type);\n \t\tbreak;\n \t}\n@@ -702,9 +711,11 @@ static void ice_vsi_setup_q_map(struct ice_vsi *vsi, struct ice_vsi_ctx *ctxt)\n static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)\n {\n \tu8 lut_type, hash_type;\n+\tstruct device *dev;\n \tstruct ice_pf *pf;\n \n \tpf = vsi->back;\n+\tdev = ice_pf_to_dev(pf);\n \n \tswitch (vsi->type) {\n \tcase ICE_VSI_PF:\n@@ -718,11 +729,11 @@ static void ice_set_rss_vsi_ctx(struct ice_vsi_ctx *ctxt, struct ice_vsi *vsi)\n \t\thash_type = ICE_AQ_VSI_Q_OPT_RSS_TPLZ;\n \t\tbreak;\n \tcase ICE_VSI_LB:\n-\t\tdev_dbg(&pf->pdev->dev, \"Unsupported VSI type %s\\n\",\n+\t\tdev_dbg(dev, \"Unsupported VSI type %s\\n\",\n \t\t\tice_vsi_type_str(vsi->type));\n \t\treturn;\n \tdefault:\n-\t\tdev_warn(&pf->pdev->dev, \"Unknown VSI type %d\\n\", vsi->type);\n+\t\tdev_warn(dev, \"Unknown VSI type %d\\n\", vsi->type);\n \t\treturn;\n \t}\n \n@@ -796,8 +807,7 @@ static int ice_vsi_init(struct ice_vsi *vsi)\n \n \tret = ice_add_vsi(hw, vsi->idx, ctxt, NULL);\n \tif (ret) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Add VSI failed, err %d\\n\", ret);\n+\t\tdev_err(ice_pf_to_dev(pf), \"Add VSI failed, err %d\\n\", ret);\n \t\tret = -EIO;\n \t\tgoto out;\n \t}\n@@ -826,14 +836,16 @@ static int ice_vsi_init(struct ice_vsi *vsi)\n static int ice_vsi_setup_vector_base(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n \tu16 num_q_vectors;\n \n+\tdev = ice_pf_to_dev(pf);\n \t/* SRIOV doesn't grab irq_tracker entries for each VSI */\n \tif (vsi->type == ICE_VSI_VF)\n \t\treturn 0;\n \n \tif (vsi->base_vector) {\n-\t\tdev_dbg(&pf->pdev->dev, \"VSI %d has non-zero base vector %d\\n\",\n+\t\tdev_dbg(dev, \"VSI %d has non-zero base vector %d\\n\",\n \t\t\tvsi->vsi_num, vsi->base_vector);\n \t\treturn -EEXIST;\n \t}\n@@ -843,7 +855,7 @@ static int ice_vsi_setup_vector_base(struct ice_vsi *vsi)\n \tvsi->base_vector = ice_get_res(pf, pf->irq_tracker, num_q_vectors,\n \t\t\t\t       vsi->idx);\n \tif (vsi->base_vector < 0) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"Failed to get tracking for %d vectors for VSI %d, err=%d\\n\",\n \t\t\tnum_q_vectors, vsi->vsi_num, vsi->base_vector);\n \t\treturn -ENOENT;\n@@ -886,8 +898,10 @@ static void ice_vsi_clear_rings(struct ice_vsi *vsi)\n static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n {\n \tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n \tint i;\n \n+\tdev = ice_pf_to_dev(pf);\n \t/* Allocate Tx rings */\n \tfor (i = 0; i < vsi->alloc_txq; i++) {\n \t\tstruct ice_ring *ring;\n@@ -902,7 +916,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n \t\tring->reg_idx = vsi->txq_map[i];\n \t\tring->ring_active = false;\n \t\tring->vsi = vsi;\n-\t\tring->dev = &pf->pdev->dev;\n+\t\tring->dev = dev;\n \t\tring->count = vsi->num_tx_desc;\n \t\tvsi->tx_rings[i] = ring;\n \t}\n@@ -921,7 +935,7 @@ static int ice_vsi_alloc_rings(struct ice_vsi *vsi)\n \t\tring->ring_active = false;\n \t\tring->vsi = vsi;\n \t\tring->netdev = vsi->netdev;\n-\t\tring->dev = &pf->pdev->dev;\n+\t\tring->dev = dev;\n \t\tring->count = vsi->num_rx_desc;\n \t\tvsi->rx_rings[i] = ring;\n \t}\n@@ -973,9 +987,11 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \tstruct ice_aqc_get_set_rss_keys *key;\n \tstruct ice_pf *pf = vsi->back;\n \tenum ice_status status;\n+\tstruct device *dev;\n \tint err = 0;\n \tu8 *lut;\n \n+\tdev = ice_pf_to_dev(pf);\n \tvsi->rss_size = min_t(int, vsi->rss_size, vsi->num_rxq);\n \n \tlut = kzalloc(vsi->rss_table_size, GFP_KERNEL);\n@@ -991,8 +1007,7 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \t\t\t\t    vsi->rss_table_size);\n \n \tif (status) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"set_rss_lut failed, error %d\\n\", status);\n+\t\tdev_err(dev, \"set_rss_lut failed, error %d\\n\", status);\n \t\terr = -EIO;\n \t\tgoto ice_vsi_cfg_rss_exit;\n \t}\n@@ -1014,8 +1029,7 @@ static int ice_vsi_cfg_rss_lut_key(struct ice_vsi *vsi)\n \tstatus = ice_aq_set_rss_key(&pf->hw, vsi->idx, key);\n \n \tif (status) {\n-\t\tdev_err(&pf->pdev->dev, \"set_rss_key failed, error %d\\n\",\n-\t\t\tstatus);\n+\t\tdev_err(dev, \"set_rss_key failed, error %d\\n\", status);\n \t\terr = -EIO;\n \t}\n \n@@ -1041,7 +1055,7 @@ int ice_add_mac_to_list(struct ice_vsi *vsi, struct list_head *add_list,\n \tstruct ice_fltr_list_entry *tmp;\n \tstruct ice_pf *pf = vsi->back;\n \n-\ttmp = devm_kzalloc(&pf->pdev->dev, sizeof(*tmp), GFP_ATOMIC);\n+\ttmp = devm_kzalloc(ice_pf_to_dev(pf), sizeof(*tmp), GFP_ATOMIC);\n \tif (!tmp)\n \t\treturn -ENOMEM;\n \n@@ -1133,9 +1147,11 @@ int ice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid)\n \tstruct ice_pf *pf = vsi->back;\n \tLIST_HEAD(tmp_add_list);\n \tenum ice_status status;\n+\tstruct device *dev;\n \tint err = 0;\n \n-\ttmp = devm_kzalloc(&pf->pdev->dev, sizeof(*tmp), GFP_KERNEL);\n+\tdev = ice_pf_to_dev(pf);\n+\ttmp = devm_kzalloc(dev, sizeof(*tmp), GFP_KERNEL);\n \tif (!tmp)\n \t\treturn -ENOMEM;\n \n@@ -1152,11 +1168,11 @@ int ice_vsi_add_vlan(struct ice_vsi *vsi, u16 vid)\n \tstatus = ice_add_vlan(&pf->hw, &tmp_add_list);\n \tif (status) {\n \t\terr = -ENODEV;\n-\t\tdev_err(&pf->pdev->dev, \"Failure Adding VLAN %d on VSI %i\\n\",\n-\t\t\tvid, vsi->vsi_num);\n+\t\tdev_err(dev, \"Failure Adding VLAN %d on VSI %i\\n\", vid,\n+\t\t\tvsi->vsi_num);\n \t}\n \n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+\tice_free_fltr_list(dev, &tmp_add_list);\n \treturn err;\n }\n \n@@ -1173,9 +1189,11 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)\n \tstruct ice_pf *pf = vsi->back;\n \tLIST_HEAD(tmp_add_list);\n \tenum ice_status status;\n+\tstruct device *dev;\n \tint err = 0;\n \n-\tlist = devm_kzalloc(&pf->pdev->dev, sizeof(*list), GFP_KERNEL);\n+\tdev = ice_pf_to_dev(pf);\n+\tlist = devm_kzalloc(dev, sizeof(*list), GFP_KERNEL);\n \tif (!list)\n \t\treturn -ENOMEM;\n \n@@ -1191,17 +1209,17 @@ int ice_vsi_kill_vlan(struct ice_vsi *vsi, u16 vid)\n \n \tstatus = ice_remove_vlan(&pf->hw, &tmp_add_list);\n \tif (status == ICE_ERR_DOES_NOT_EXIST) {\n-\t\tdev_dbg(&pf->pdev->dev,\n+\t\tdev_dbg(dev,\n \t\t\t\"Failed to remove VLAN %d on VSI %i, it does not exist, status: %d\\n\",\n \t\t\tvid, vsi->vsi_num, status);\n \t} else if (status) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"Error removing VLAN %d on vsi %i error: %d\\n\",\n \t\t\tvid, vsi->vsi_num, status);\n \t\terr = -EIO;\n \t}\n \n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+\tice_free_fltr_list(dev, &tmp_add_list);\n \treturn err;\n }\n \n@@ -1683,8 +1701,10 @@ ice_vsi_add_rem_eth_mac(struct ice_vsi *vsi, bool add_rule)\n \tstruct ice_pf *pf = vsi->back;\n \tLIST_HEAD(tmp_add_list);\n \tenum ice_status status;\n+\tstruct device *dev;\n \n-\tlist = devm_kzalloc(&pf->pdev->dev, sizeof(*list), GFP_KERNEL);\n+\tdev = ice_pf_to_dev(pf);\n+\tlist = devm_kzalloc(dev, sizeof(*list), GFP_KERNEL);\n \tif (!list)\n \t\treturn;\n \n@@ -1704,11 +1724,11 @@ ice_vsi_add_rem_eth_mac(struct ice_vsi *vsi, bool add_rule)\n \t\tstatus = ice_remove_eth_mac(&pf->hw, &tmp_add_list);\n \n \tif (status)\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"Failure Adding or Removing Ethertype on VSI %i error: %d\\n\",\n \t\t\tvsi->vsi_num, status);\n \n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+\tice_free_fltr_list(dev, &tmp_add_list);\n }\n \n /**\n@@ -1723,8 +1743,10 @@ void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create)\n \tstruct ice_pf *pf = vsi->back;\n \tLIST_HEAD(tmp_add_list);\n \tenum ice_status status;\n+\tstruct device *dev;\n \n-\tlist = devm_kzalloc(&pf->pdev->dev, sizeof(*list), GFP_KERNEL);\n+\tdev = ice_pf_to_dev(pf);\n+\tlist = devm_kzalloc(dev, sizeof(*list), GFP_KERNEL);\n \tif (!list)\n \t\treturn;\n \n@@ -1751,12 +1773,11 @@ void ice_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create)\n \t\tstatus = ice_remove_eth_mac(&pf->hw, &tmp_add_list);\n \n \tif (status)\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Fail %s %s LLDP rule on VSI %i error: %d\\n\",\n+\t\tdev_err(dev, \"Fail %s %s LLDP rule on VSI %i error: %d\\n\",\n \t\t\tcreate ? \"adding\" : \"removing\", tx ? \"TX\" : \"RX\",\n \t\t\tvsi->vsi_num, status);\n \n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+\tice_free_fltr_list(dev, &tmp_add_list);\n }\n \n /**\n@@ -1778,7 +1799,7 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,\n \t      enum ice_vsi_type type, u16 vf_id)\n {\n \tu16 max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 };\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tenum ice_status status;\n \tstruct ice_vsi *vsi;\n \tint ret, i;\n@@ -1887,8 +1908,7 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,\n \tstatus = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,\n \t\t\t\t max_txqs);\n \tif (status) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"VSI %d failed lan queue config, error %d\\n\",\n+\t\tdev_err(dev, \"VSI %d failed lan queue config, error %d\\n\",\n \t\t\tvsi->vsi_num, status);\n \t\tgoto unroll_vector_base;\n \t}\n@@ -2000,8 +2020,7 @@ void ice_vsi_free_irq(struct ice_vsi *vsi)\n \t\t/* clear the affinity_mask in the IRQ descriptor */\n \t\tirq_set_affinity_hint(irq_num, NULL);\n \t\tsynchronize_irq(irq_num);\n-\t\tdevm_free_irq(&pf->pdev->dev, irq_num,\n-\t\t\t      vsi->q_vectors[i]);\n+\t\tdevm_free_irq(ice_pf_to_dev(pf), irq_num, vsi->q_vectors[i]);\n \t}\n }\n \n@@ -2187,7 +2206,7 @@ ice_get_res(struct ice_pf *pf, struct ice_res_tracker *res, u16 needed, u16 id)\n \t\treturn -EINVAL;\n \n \tif (!needed || needed > res->num_entries || id >= ICE_RES_VALID_BIT) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(ice_pf_to_dev(pf),\n \t\t\t\"param err: needed=%d, num_entries = %d id=0x%04x\\n\",\n \t\t\tneeded, res->num_entries, id);\n \t\treturn -EINVAL;\n@@ -2469,7 +2488,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi)\n \tstatus = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,\n \t\t\t\t max_txqs);\n \tif (status) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(ice_pf_to_dev(pf),\n \t\t\t\"VSI %d failed lan queue config, error %d\\n\",\n \t\t\tvsi->vsi_num, status);\n \t\tgoto err_vectors;\n@@ -2532,9 +2551,12 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)\n \tstruct ice_vsi_ctx *ctx;\n \tstruct ice_pf *pf = vsi->back;\n \tenum ice_status status;\n+\tstruct device *dev;\n \tint i, ret = 0;\n \tu8 num_tc = 0;\n \n+\tdev = ice_pf_to_dev(pf);\n+\n \tice_for_each_traffic_class(i) {\n \t\t/* build bitmap of enabled TCs */\n \t\tif (ena_tc & BIT(i))\n@@ -2559,7 +2581,7 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)\n \tctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_RXQ_MAP_VALID);\n \tstatus = ice_update_vsi(&pf->hw, vsi->idx, ctx, NULL);\n \tif (status) {\n-\t\tdev_info(&pf->pdev->dev, \"Failed VSI Update\\n\");\n+\t\tdev_info(dev, \"Failed VSI Update\\n\");\n \t\tret = -EIO;\n \t\tgoto out;\n \t}\n@@ -2568,8 +2590,7 @@ int ice_vsi_cfg_tc(struct ice_vsi *vsi, u8 ena_tc)\n \t\t\t\t max_txqs);\n \n \tif (status) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"VSI %d failed TC config, error %d\\n\",\n+\t\tdev_err(dev, \"VSI %d failed TC config, error %d\\n\",\n \t\t\tvsi->vsi_num, status);\n \t\tret = -EIO;\n \t\tgoto out;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex 0f68910ba87d..ea577588b274 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -161,7 +161,7 @@ static int ice_init_mac_fltr(struct ice_pf *pf)\n \t * had an error\n \t */\n \tif (status && vsi->netdev->reg_state == NETREG_REGISTERED) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(ice_pf_to_dev(pf),\n \t\t\t\"Could not add MAC filters error %d. Unregistering device\\n\",\n \t\t\tstatus);\n \t\tunregister_netdev(vsi->netdev);\n@@ -495,7 +495,7 @@ ice_prepare_for_reset(struct ice_pf *pf)\n  */\n static void ice_do_reset(struct ice_pf *pf, enum ice_reset_req reset_type)\n {\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \n \tdev_dbg(dev, \"reset_type 0x%x requested\\n\", reset_type);\n@@ -792,6 +792,7 @@ static int\n ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,\n \t       u16 link_speed)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_phy_info *phy_info;\n \tstruct ice_vsi *vsi;\n \tu16 old_link_speed;\n@@ -809,7 +810,7 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,\n \t */\n \tresult = ice_update_link_info(pi);\n \tif (result)\n-\t\tdev_dbg(&pf->pdev->dev,\n+\t\tdev_dbg(dev,\n \t\t\t\"Failed to update link status and re-enable link events for port %d\\n\",\n \t\t\tpi->lport);\n \n@@ -828,7 +829,7 @@ ice_link_event(struct ice_pf *pf, struct ice_port_info *pi, bool link_up,\n \n \t\tresult = ice_aq_set_link_restart_an(pi, false, NULL);\n \t\tif (result) {\n-\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\tdev_dbg(dev,\n \t\t\t\t\"Failed to set link down, VSI %d error %d\\n\",\n \t\t\t\tvsi->vsi_num, result);\n \t\t\treturn result;\n@@ -924,7 +925,7 @@ ice_handle_link_event(struct ice_pf *pf, struct ice_rq_event_info *event)\n \t\t\t\t!!(link_data->link_info & ICE_AQ_LINK_UP),\n \t\t\t\tle16_to_cpu(link_data->link_speed));\n \tif (status)\n-\t\tdev_dbg(&pf->pdev->dev,\n+\t\tdev_dbg(ice_pf_to_dev(pf),\n \t\t\t\"Could not process link event, error %d\\n\", status);\n \n \treturn status;\n@@ -937,6 +938,7 @@ ice_handle_link_event(struct ice_pf *pf, struct ice_rq_event_info *event)\n  */\n static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_rq_event_info event;\n \tstruct ice_hw *hw = &pf->hw;\n \tstruct ice_ctl_q_info *cq;\n@@ -958,8 +960,7 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\tqtype = \"Mailbox\";\n \t\tbreak;\n \tdefault:\n-\t\tdev_warn(&pf->pdev->dev, \"Unknown control queue type 0x%x\\n\",\n-\t\t\t q_type);\n+\t\tdev_warn(dev, \"Unknown control queue type 0x%x\\n\", q_type);\n \t\treturn 0;\n \t}\n \n@@ -971,15 +972,15 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\t   PF_FW_ARQLEN_ARQCRIT_M)) {\n \t\toldval = val;\n \t\tif (val & PF_FW_ARQLEN_ARQVFE_M)\n-\t\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\t\"%s Receive Queue VF Error detected\\n\", qtype);\n+\t\t\tdev_dbg(dev, \"%s Receive Queue VF Error detected\\n\",\n+\t\t\t\tqtype);\n \t\tif (val & PF_FW_ARQLEN_ARQOVFL_M) {\n-\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\tdev_dbg(dev,\n \t\t\t\t\"%s Receive Queue Overflow Error detected\\n\",\n \t\t\t\tqtype);\n \t\t}\n \t\tif (val & PF_FW_ARQLEN_ARQCRIT_M)\n-\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\tdev_dbg(dev,\n \t\t\t\t\"%s Receive Queue Critical Error detected\\n\",\n \t\t\t\tqtype);\n \t\tval &= ~(PF_FW_ARQLEN_ARQVFE_M | PF_FW_ARQLEN_ARQOVFL_M |\n@@ -993,16 +994,14 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\t   PF_FW_ATQLEN_ATQCRIT_M)) {\n \t\toldval = val;\n \t\tif (val & PF_FW_ATQLEN_ATQVFE_M)\n-\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\tdev_dbg(dev,\n \t\t\t\t\"%s Send Queue VF Error detected\\n\", qtype);\n \t\tif (val & PF_FW_ATQLEN_ATQOVFL_M) {\n-\t\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\t\"%s Send Queue Overflow Error detected\\n\",\n+\t\t\tdev_dbg(dev, \"%s Send Queue Overflow Error detected\\n\",\n \t\t\t\tqtype);\n \t\t}\n \t\tif (val & PF_FW_ATQLEN_ATQCRIT_M)\n-\t\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\t\"%s Send Queue Critical Error detected\\n\",\n+\t\t\tdev_dbg(dev, \"%s Send Queue Critical Error detected\\n\",\n \t\t\t\tqtype);\n \t\tval &= ~(PF_FW_ATQLEN_ATQVFE_M | PF_FW_ATQLEN_ATQOVFL_M |\n \t\t\t PF_FW_ATQLEN_ATQCRIT_M);\n@@ -1023,8 +1022,7 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\tif (ret == ICE_ERR_AQ_NO_WORK)\n \t\t\tbreak;\n \t\tif (ret) {\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"%s Receive Queue event error %d\\n\", qtype,\n+\t\t\tdev_err(dev, \"%s Receive Queue event error %d\\n\", qtype,\n \t\t\t\tret);\n \t\t\tbreak;\n \t\t}\n@@ -1034,8 +1032,7 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\tswitch (opcode) {\n \t\tcase ice_aqc_opc_get_link_status:\n \t\t\tif (ice_handle_link_event(pf, &event))\n-\t\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\t\"Could not handle link event\\n\");\n+\t\t\t\tdev_err(dev, \"Could not handle link event\\n\");\n \t\t\tbreak;\n \t\tcase ice_mbx_opc_send_msg_to_pf:\n \t\t\tice_vc_process_vf_msg(pf, &event);\n@@ -1047,7 +1044,7 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\t\tice_dcb_process_lldp_set_mib_change(pf, &event);\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\tdev_dbg(dev,\n \t\t\t\t\"%s Receive Queue unknown event 0x%04x ignored\\n\",\n \t\t\t\tqtype, opcode);\n \t\t\tbreak;\n@@ -1198,6 +1195,7 @@ static void ice_service_timer(struct timer_list *t)\n  */\n static void ice_handle_mdd_event(struct ice_pf *pf)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \tbool mdd_detected = false;\n \tu32 reg;\n@@ -1219,7 +1217,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\t\t\tGL_MDET_TX_PQM_QNUM_S);\n \n \t\tif (netif_msg_tx_err(pf))\n-\t\t\tdev_info(&pf->pdev->dev, \"Malicious Driver Detection event %d on TX queue %d PF# %d VF# %d\\n\",\n+\t\t\tdev_info(dev, \"Malicious Driver Detection event %d on TX queue %d PF# %d VF# %d\\n\",\n \t\t\t\t event, queue, pf_num, vf_num);\n \t\twr32(hw, GL_MDET_TX_PQM, 0xffffffff);\n \t\tmdd_detected = true;\n@@ -1237,7 +1235,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\t\t\tGL_MDET_TX_TCLAN_QNUM_S);\n \n \t\tif (netif_msg_rx_err(pf))\n-\t\t\tdev_info(&pf->pdev->dev, \"Malicious Driver Detection event %d on TX queue %d PF# %d VF# %d\\n\",\n+\t\t\tdev_info(dev, \"Malicious Driver Detection event %d on TX queue %d PF# %d VF# %d\\n\",\n \t\t\t\t event, queue, pf_num, vf_num);\n \t\twr32(hw, GL_MDET_TX_TCLAN, 0xffffffff);\n \t\tmdd_detected = true;\n@@ -1255,7 +1253,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\t\t\tGL_MDET_RX_QNUM_S);\n \n \t\tif (netif_msg_rx_err(pf))\n-\t\t\tdev_info(&pf->pdev->dev, \"Malicious Driver Detection event %d on RX queue %d PF# %d VF# %d\\n\",\n+\t\t\tdev_info(dev, \"Malicious Driver Detection event %d on RX queue %d PF# %d VF# %d\\n\",\n \t\t\t\t event, queue, pf_num, vf_num);\n \t\twr32(hw, GL_MDET_RX, 0xffffffff);\n \t\tmdd_detected = true;\n@@ -1267,21 +1265,21 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\treg = rd32(hw, PF_MDET_TX_PQM);\n \t\tif (reg & PF_MDET_TX_PQM_VALID_M) {\n \t\t\twr32(hw, PF_MDET_TX_PQM, 0xFFFF);\n-\t\t\tdev_info(&pf->pdev->dev, \"TX driver issue detected, PF reset issued\\n\");\n+\t\t\tdev_info(dev, \"TX driver issue detected, PF reset issued\\n\");\n \t\t\tpf_mdd_detected = true;\n \t\t}\n \n \t\treg = rd32(hw, PF_MDET_TX_TCLAN);\n \t\tif (reg & PF_MDET_TX_TCLAN_VALID_M) {\n \t\t\twr32(hw, PF_MDET_TX_TCLAN, 0xFFFF);\n-\t\t\tdev_info(&pf->pdev->dev, \"TX driver issue detected, PF reset issued\\n\");\n+\t\t\tdev_info(dev, \"TX driver issue detected, PF reset issued\\n\");\n \t\t\tpf_mdd_detected = true;\n \t\t}\n \n \t\treg = rd32(hw, PF_MDET_RX);\n \t\tif (reg & PF_MDET_RX_VALID_M) {\n \t\t\twr32(hw, PF_MDET_RX, 0xFFFF);\n-\t\t\tdev_info(&pf->pdev->dev, \"RX driver issue detected, PF reset issued\\n\");\n+\t\t\tdev_info(dev, \"RX driver issue detected, PF reset issued\\n\");\n \t\t\tpf_mdd_detected = true;\n \t\t}\n \t\t/* Queue belongs to the PF initiate a reset */\n@@ -1301,7 +1299,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\tif (reg & VP_MDET_TX_PQM_VALID_M) {\n \t\t\twr32(hw, VP_MDET_TX_PQM(i), 0xFFFF);\n \t\t\tvf_mdd_detected = true;\n-\t\t\tdev_info(&pf->pdev->dev, \"TX driver issue detected on VF %d\\n\",\n+\t\t\tdev_info(dev, \"TX driver issue detected on VF %d\\n\",\n \t\t\t\t i);\n \t\t}\n \n@@ -1309,7 +1307,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\tif (reg & VP_MDET_TX_TCLAN_VALID_M) {\n \t\t\twr32(hw, VP_MDET_TX_TCLAN(i), 0xFFFF);\n \t\t\tvf_mdd_detected = true;\n-\t\t\tdev_info(&pf->pdev->dev, \"TX driver issue detected on VF %d\\n\",\n+\t\t\tdev_info(dev, \"TX driver issue detected on VF %d\\n\",\n \t\t\t\t i);\n \t\t}\n \n@@ -1317,7 +1315,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\tif (reg & VP_MDET_TX_TDPU_VALID_M) {\n \t\t\twr32(hw, VP_MDET_TX_TDPU(i), 0xFFFF);\n \t\t\tvf_mdd_detected = true;\n-\t\t\tdev_info(&pf->pdev->dev, \"TX driver issue detected on VF %d\\n\",\n+\t\t\tdev_info(dev, \"TX driver issue detected on VF %d\\n\",\n \t\t\t\t i);\n \t\t}\n \n@@ -1325,7 +1323,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\tif (reg & VP_MDET_RX_VALID_M) {\n \t\t\twr32(hw, VP_MDET_RX(i), 0xFFFF);\n \t\t\tvf_mdd_detected = true;\n-\t\t\tdev_info(&pf->pdev->dev, \"RX driver issue detected on VF %d\\n\",\n+\t\t\tdev_info(dev, \"RX driver issue detected on VF %d\\n\",\n \t\t\t\t i);\n \t\t}\n \n@@ -1333,7 +1331,7 @@ static void ice_handle_mdd_event(struct ice_pf *pf)\n \t\t\tvf->num_mdd_events++;\n \t\t\tif (vf->num_mdd_events &&\n \t\t\t    vf->num_mdd_events <= ICE_MDD_EVENTS_THRESHOLD)\n-\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\tdev_info(dev,\n \t\t\t\t\t \"VF %d has had %llu MDD events since last boot, Admin might need to reload AVF driver with this number of events\\n\",\n \t\t\t\t\t i, vf->num_mdd_events);\n \t\t}\n@@ -1580,11 +1578,13 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename)\n \tint q_vectors = vsi->num_q_vectors;\n \tstruct ice_pf *pf = vsi->back;\n \tint base = vsi->base_vector;\n+\tstruct device *dev;\n \tint rx_int_idx = 0;\n \tint tx_int_idx = 0;\n \tint vector, err;\n \tint irq_num;\n \n+\tdev = ice_pf_to_dev(pf);\n \tfor (vector = 0; vector < q_vectors; vector++) {\n \t\tstruct ice_q_vector *q_vector = vsi->q_vectors[vector];\n \n@@ -1604,8 +1604,7 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename)\n \t\t\t/* skip this unused q_vector */\n \t\t\tcontinue;\n \t\t}\n-\t\terr = devm_request_irq(&pf->pdev->dev, irq_num,\n-\t\t\t\t       vsi->irq_handler, 0,\n+\t\terr = devm_request_irq(dev, irq_num, vsi->irq_handler, 0,\n \t\t\t\t       q_vector->name, q_vector);\n \t\tif (err) {\n \t\t\tnetdev_err(vsi->netdev,\n@@ -1631,7 +1630,7 @@ static int ice_vsi_req_irq_msix(struct ice_vsi *vsi, char *basename)\n \t\tirq_num = pf->msix_entries[base + vector].vector,\n \t\tirq_set_affinity_notifier(irq_num, NULL);\n \t\tirq_set_affinity_hint(irq_num, NULL);\n-\t\tdevm_free_irq(&pf->pdev->dev, irq_num, &vsi->q_vectors[vector]);\n+\t\tdevm_free_irq(dev, irq_num, &vsi->q_vectors[vector]);\n \t}\n \treturn err;\n }\n@@ -1720,9 +1719,11 @@ int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog)\n \t\t.mapping_mode = ICE_VSI_MAP_CONTIG\n \t};\n \tenum ice_status status;\n+\tstruct device *dev;\n \tint i, v_idx;\n \n-\tvsi->xdp_rings = devm_kcalloc(&pf->pdev->dev, vsi->num_xdp_txq,\n+\tdev = ice_pf_to_dev(pf);\n+\tvsi->xdp_rings = devm_kcalloc(dev, vsi->num_xdp_txq,\n \t\t\t\t      sizeof(*vsi->xdp_rings), GFP_KERNEL);\n \tif (!vsi->xdp_rings)\n \t\treturn -ENOMEM;\n@@ -1769,8 +1770,7 @@ int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog)\n \tstatus = ice_cfg_vsi_lan(vsi->port_info, vsi->idx, vsi->tc_cfg.ena_tc,\n \t\t\t\t max_txqs);\n \tif (status) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Failed VSI LAN queue config for XDP, error:%d\\n\",\n+\t\tdev_err(dev, \"Failed VSI LAN queue config for XDP, error:%d\\n\",\n \t\t\tstatus);\n \t\tgoto clear_xdp_rings;\n \t}\n@@ -1792,7 +1792,7 @@ int ice_prepare_xdp_rings(struct ice_vsi *vsi, struct bpf_prog *prog)\n \t}\n \tmutex_unlock(&pf->avail_q_mutex);\n \n-\tdevm_kfree(&pf->pdev->dev, vsi->xdp_rings);\n+\tdevm_kfree(dev, vsi->xdp_rings);\n \treturn -ENOMEM;\n }\n \n@@ -1845,7 +1845,7 @@ int ice_destroy_xdp_rings(struct ice_vsi *vsi)\n \t\t\tvsi->xdp_rings[i] = NULL;\n \t\t}\n \n-\tdevm_kfree(&pf->pdev->dev, vsi->xdp_rings);\n+\tdevm_kfree(ice_pf_to_dev(pf), vsi->xdp_rings);\n \tvsi->xdp_rings = NULL;\n \n \tif (ice_is_reset_in_progress(pf->state) || !vsi->q_vectors[0])\n@@ -1992,8 +1992,10 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n \tstruct ice_pf *pf = (struct ice_pf *)data;\n \tstruct ice_hw *hw = &pf->hw;\n \tirqreturn_t ret = IRQ_NONE;\n+\tstruct device *dev;\n \tu32 oicr, ena_mask;\n \n+\tdev = ice_pf_to_dev(pf);\n \tset_bit(__ICE_ADMINQ_EVENT_PENDING, pf->state);\n \tset_bit(__ICE_MAILBOXQ_EVENT_PENDING, pf->state);\n \n@@ -2029,8 +2031,7 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n \t\telse if (reset == ICE_RESET_EMPR)\n \t\t\tpf->empr_count++;\n \t\telse\n-\t\t\tdev_dbg(&pf->pdev->dev, \"Invalid reset type %d\\n\",\n-\t\t\t\treset);\n+\t\t\tdev_dbg(dev, \"Invalid reset type %d\\n\", reset);\n \n \t\t/* If a reset cycle isn't already in progress, we set a bit in\n \t\t * pf->state so that the service task can start a reset/rebuild.\n@@ -2064,8 +2065,7 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n \n \tif (oicr & PFINT_OICR_HMC_ERR_M) {\n \t\tena_mask &= ~PFINT_OICR_HMC_ERR_M;\n-\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\"HMC Error interrupt - info 0x%x, data 0x%x\\n\",\n+\t\tdev_dbg(dev, \"HMC Error interrupt - info 0x%x, data 0x%x\\n\",\n \t\t\trd32(hw, PFHMC_ERRORINFO),\n \t\t\trd32(hw, PFHMC_ERRORDATA));\n \t}\n@@ -2073,8 +2073,7 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)\n \t/* Report any remaining unexpected interrupts */\n \toicr &= ena_mask;\n \tif (oicr) {\n-\t\tdev_dbg(&pf->pdev->dev, \"unhandled interrupt oicr=0x%08x\\n\",\n-\t\t\toicr);\n+\t\tdev_dbg(dev, \"unhandled interrupt oicr=0x%08x\\n\", oicr);\n \t\t/* If a critical error is pending there is no choice but to\n \t\t * reset the device.\n \t\t */\n@@ -2132,7 +2131,7 @@ static void ice_free_irq_msix_misc(struct ice_pf *pf)\n \n \tif (pf->msix_entries) {\n \t\tsynchronize_irq(pf->msix_entries[pf->oicr_idx].vector);\n-\t\tdevm_free_irq(&pf->pdev->dev,\n+\t\tdevm_free_irq(ice_pf_to_dev(pf),\n \t\t\t      pf->msix_entries[pf->oicr_idx].vector, pf);\n \t}\n \n@@ -2176,13 +2175,13 @@ static void ice_ena_ctrlq_interrupts(struct ice_hw *hw, u16 reg_idx)\n  */\n static int ice_req_irq_msix_misc(struct ice_pf *pf)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \tint oicr_idx, err = 0;\n \n \tif (!pf->int_name[0])\n \t\tsnprintf(pf->int_name, sizeof(pf->int_name) - 1, \"%s-%s:misc\",\n-\t\t\t dev_driver_string(&pf->pdev->dev),\n-\t\t\t dev_name(&pf->pdev->dev));\n+\t\t\t dev_driver_string(dev), dev_name(dev));\n \n \t/* Do not request IRQ but do enable OICR interrupt since settings are\n \t * lost during reset. Note that this function is called only during\n@@ -2199,12 +2198,10 @@ static int ice_req_irq_msix_misc(struct ice_pf *pf)\n \tpf->num_avail_sw_msix -= 1;\n \tpf->oicr_idx = oicr_idx;\n \n-\terr = devm_request_irq(&pf->pdev->dev,\n-\t\t\t       pf->msix_entries[pf->oicr_idx].vector,\n+\terr = devm_request_irq(dev, pf->msix_entries[pf->oicr_idx].vector,\n \t\t\t       ice_misc_intr, 0, pf->int_name, pf);\n \tif (err) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"devm_request_irq for %s failed: %d\\n\",\n+\t\tdev_err(dev, \"devm_request_irq for %s failed: %d\\n\",\n \t\t\tpf->int_name, err);\n \t\tice_free_res(pf->irq_tracker, 1, ICE_RES_MISC_VEC_ID);\n \t\tpf->num_avail_sw_msix += 1;\n@@ -2337,7 +2334,7 @@ static int ice_cfg_netdev(struct ice_vsi *vsi)\n \tice_set_ops(netdev);\n \n \tif (vsi->type == ICE_VSI_PF) {\n-\t\tSET_NETDEV_DEV(netdev, &pf->pdev->dev);\n+\t\tSET_NETDEV_DEV(netdev, ice_pf_to_dev(pf));\n \t\tether_addr_copy(mac_addr, vsi->port_info->mac.perm_addr);\n \t\tether_addr_copy(netdev->dev_addr, mac_addr);\n \t\tether_addr_copy(netdev->perm_addr, mac_addr);\n@@ -2664,7 +2661,7 @@ static int ice_init_pf(struct ice_pf *pf)\n \n \tpf->avail_rxqs = bitmap_zalloc(pf->max_pf_rxqs, GFP_KERNEL);\n \tif (!pf->avail_rxqs) {\n-\t\tdevm_kfree(&pf->pdev->dev, pf->avail_txqs);\n+\t\tdevm_kfree(ice_pf_to_dev(pf), pf->avail_txqs);\n \t\tpf->avail_txqs = NULL;\n \t\treturn -ENOMEM;\n \t}\n@@ -2681,6 +2678,7 @@ static int ice_init_pf(struct ice_pf *pf)\n  */\n static int ice_ena_msix_range(struct ice_pf *pf)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tint v_left, v_actual, v_budget = 0;\n \tint needed, err, i;\n \n@@ -2701,7 +2699,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)\n \tv_budget += needed;\n \tv_left -= needed;\n \n-\tpf->msix_entries = devm_kcalloc(&pf->pdev->dev, v_budget,\n+\tpf->msix_entries = devm_kcalloc(dev, v_budget,\n \t\t\t\t\tsizeof(*pf->msix_entries), GFP_KERNEL);\n \n \tif (!pf->msix_entries) {\n@@ -2717,13 +2715,13 @@ static int ice_ena_msix_range(struct ice_pf *pf)\n \t\t\t\t\t ICE_MIN_MSIX, v_budget);\n \n \tif (v_actual < 0) {\n-\t\tdev_err(&pf->pdev->dev, \"unable to reserve MSI-X vectors\\n\");\n+\t\tdev_err(dev, \"unable to reserve MSI-X vectors\\n\");\n \t\terr = v_actual;\n \t\tgoto msix_err;\n \t}\n \n \tif (v_actual < v_budget) {\n-\t\tdev_warn(&pf->pdev->dev,\n+\t\tdev_warn(dev,\n \t\t\t \"not enough OS MSI-X vectors. requested = %d, obtained = %d\\n\",\n \t\t\t v_budget, v_actual);\n /* 2 vectors for LAN (traffic + OICR) */\n@@ -2742,11 +2740,11 @@ static int ice_ena_msix_range(struct ice_pf *pf)\n \treturn v_actual;\n \n msix_err:\n-\tdevm_kfree(&pf->pdev->dev, pf->msix_entries);\n+\tdevm_kfree(dev, pf->msix_entries);\n \tgoto exit_err;\n \n no_hw_vecs_left_err:\n-\tdev_err(&pf->pdev->dev,\n+\tdev_err(dev,\n \t\t\"not enough device MSI-X vectors. requested = %d, available = %d\\n\",\n \t\tneeded, v_left);\n \terr = -ERANGE;\n@@ -2762,7 +2760,7 @@ static int ice_ena_msix_range(struct ice_pf *pf)\n static void ice_dis_msix(struct ice_pf *pf)\n {\n \tpci_disable_msix(pf->pdev);\n-\tdevm_kfree(&pf->pdev->dev, pf->msix_entries);\n+\tdevm_kfree(ice_pf_to_dev(pf), pf->msix_entries);\n \tpf->msix_entries = NULL;\n }\n \n@@ -2775,7 +2773,7 @@ static void ice_clear_interrupt_scheme(struct ice_pf *pf)\n \tice_dis_msix(pf);\n \n \tif (pf->irq_tracker) {\n-\t\tdevm_kfree(&pf->pdev->dev, pf->irq_tracker);\n+\t\tdevm_kfree(ice_pf_to_dev(pf), pf->irq_tracker);\n \t\tpf->irq_tracker = NULL;\n \t}\n }\n@@ -2795,7 +2793,7 @@ static int ice_init_interrupt_scheme(struct ice_pf *pf)\n \n \t/* set up vector assignment tracking */\n \tpf->irq_tracker =\n-\t\tdevm_kzalloc(&pf->pdev->dev, sizeof(*pf->irq_tracker) +\n+\t\tdevm_kzalloc(ice_pf_to_dev(pf), sizeof(*pf->irq_tracker) +\n \t\t\t     (sizeof(u16) * vectors), GFP_KERNEL);\n \tif (!pf->irq_tracker) {\n \t\tice_dis_msix(pf);\n@@ -2819,7 +2817,7 @@ static void\n ice_log_pkg_init(struct ice_hw *hw, enum ice_status *status)\n {\n \tstruct ice_pf *pf = (struct ice_pf *)hw->back;\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \n \tswitch (*status) {\n \tcase ICE_SUCCESS:\n@@ -2938,7 +2936,7 @@ static void\n ice_load_pkg(const struct firmware *firmware, struct ice_pf *pf)\n {\n \tenum ice_status status = ICE_ERR_PARAM;\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \n \t/* Load DDP Package */\n@@ -2978,7 +2976,7 @@ ice_load_pkg(const struct firmware *firmware, struct ice_pf *pf)\n static void ice_verify_cacheline_size(struct ice_pf *pf)\n {\n \tif (rd32(&pf->hw, GLPCI_CNF2) & GLPCI_CNF2_CACHELINE_SIZE_M)\n-\t\tdev_warn(&pf->pdev->dev,\n+\t\tdev_warn(ice_pf_to_dev(pf),\n \t\t\t \"%d Byte cache line assumption is invalid, driver may have Tx timeouts!\\n\",\n \t\t\t ICE_CACHE_LINE_BYTES);\n }\n@@ -3048,7 +3046,7 @@ static void ice_request_fw(struct ice_pf *pf)\n {\n \tchar *opt_fw_filename = ice_get_opt_fw_name(pf);\n \tconst struct firmware *firmware = NULL;\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tint err = 0;\n \n \t/* optional device-specific DDP (if present) overrides the default DDP\n@@ -3239,7 +3237,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)\n \n \terr = ice_setup_pf_sw(pf);\n \tif (err) {\n-\t\tdev_err(dev, \"probe failed due to setup PF switch:%d\\n\", err);\n+\t\tdev_err(dev, \"probe failed due to setup PF switch: %d\\n\", err);\n \t\tgoto err_alloc_sw_unroll;\n \t}\n \n@@ -3287,7 +3285,7 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)\n err_alloc_sw_unroll:\n \tset_bit(__ICE_SERVICE_DIS, pf->state);\n \tset_bit(__ICE_DOWN, pf->state);\n-\tdevm_kfree(&pf->pdev->dev, pf->first_sw);\n+\tdevm_kfree(dev, pf->first_sw);\n err_msix_misc_unroll:\n \tice_free_irq_msix_misc(pf);\n err_init_interrupt_unroll:\n@@ -4409,7 +4407,7 @@ static int ice_vsi_open(struct ice_vsi *vsi)\n \t\tgoto err_setup_rx;\n \n \tsnprintf(int_name, sizeof(int_name) - 1, \"%s-%s\",\n-\t\t dev_driver_string(&pf->pdev->dev), vsi->netdev->name);\n+\t\t dev_driver_string(ice_pf_to_dev(pf)), vsi->netdev->name);\n \terr = ice_vsi_req_irq_msix(vsi, int_name);\n \tif (err)\n \t\tgoto err_setup_rx;\n@@ -4458,7 +4456,7 @@ static void ice_vsi_release_all(struct ice_pf *pf)\n \n \t\terr = ice_vsi_release(pf->vsi[i]);\n \t\tif (err)\n-\t\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\tdev_dbg(ice_pf_to_dev(pf),\n \t\t\t\t\"Failed to release pf->vsi[%d], err %d, vsi_num = %d\\n\",\n \t\t\t\ti, err, pf->vsi[i]->vsi_num);\n \t}\n@@ -4473,6 +4471,7 @@ static void ice_vsi_release_all(struct ice_pf *pf)\n  */\n static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tenum ice_status status;\n \tint i, err;\n \n@@ -4485,7 +4484,7 @@ static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)\n \t\t/* rebuild the VSI */\n \t\terr = ice_vsi_rebuild(vsi);\n \t\tif (err) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"rebuild VSI failed, err %d, VSI index %d, type %s\\n\",\n \t\t\t\terr, vsi->idx, ice_vsi_type_str(type));\n \t\t\treturn err;\n@@ -4494,7 +4493,7 @@ static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)\n \t\t/* replay filters for the VSI */\n \t\tstatus = ice_replay_vsi(&pf->hw, vsi->idx);\n \t\tif (status) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"replay VSI failed, status %d, VSI index %d, type %s\\n\",\n \t\t\t\tstatus, vsi->idx, ice_vsi_type_str(type));\n \t\t\treturn -EIO;\n@@ -4508,14 +4507,14 @@ static int ice_vsi_rebuild_by_type(struct ice_pf *pf, enum ice_vsi_type type)\n \t\t/* enable the VSI */\n \t\terr = ice_ena_vsi(vsi, false);\n \t\tif (err) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"enable VSI failed, err %d, VSI index %d, type %s\\n\",\n \t\t\t\terr, vsi->idx, ice_vsi_type_str(type));\n \t\t\treturn err;\n \t\t}\n \n-\t\tdev_info(&pf->pdev->dev, \"VSI rebuilt. VSI index %d, type %s\\n\",\n-\t\t\t vsi->idx, ice_vsi_type_str(type));\n+\t\tdev_info(dev, \"VSI rebuilt. VSI index %d, type %s\\n\", vsi->idx,\n+\t\t\t ice_vsi_type_str(type));\n \t}\n \n \treturn 0;\n@@ -4554,7 +4553,7 @@ static void ice_update_pf_netdev_link(struct ice_pf *pf)\n  */\n static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)\n {\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \tenum ice_status ret;\n \tint err;\n@@ -4600,7 +4599,7 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)\n \n \terr = ice_update_link_info(hw->port_info);\n \tif (err)\n-\t\tdev_err(&pf->pdev->dev, \"Get link status error %d\\n\", err);\n+\t\tdev_err(dev, \"Get link status error %d\\n\", err);\n \n \t/* start misc vector */\n \terr = ice_req_irq_msix_misc(pf);\n@@ -4759,7 +4758,9 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \tstruct ice_pf *pf = vsi->back;\n \tstruct ice_hw *hw = &pf->hw;\n \tenum ice_status status;\n+\tstruct device *dev;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (seed) {\n \t\tstruct ice_aqc_get_set_rss_keys *buf =\n \t\t\t\t  (struct ice_aqc_get_set_rss_keys *)seed;\n@@ -4767,8 +4768,7 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \t\tstatus = ice_aq_set_rss_key(hw, vsi->idx, buf);\n \n \t\tif (status) {\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Cannot set RSS key, err %d aq_err %d\\n\",\n+\t\t\tdev_err(dev, \"Cannot set RSS key, err %d aq_err %d\\n\",\n \t\t\t\tstatus, hw->adminq.rq_last_status);\n \t\t\treturn -EIO;\n \t\t}\n@@ -4778,8 +4778,7 @@ int ice_set_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \t\tstatus = ice_aq_set_rss_lut(hw, vsi->idx, vsi->rss_lut_type,\n \t\t\t\t\t    lut, lut_size);\n \t\tif (status) {\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Cannot set RSS lut, err %d aq_err %d\\n\",\n+\t\t\tdev_err(dev, \"Cannot set RSS lut, err %d aq_err %d\\n\",\n \t\t\t\tstatus, hw->adminq.rq_last_status);\n \t\t\treturn -EIO;\n \t\t}\n@@ -4802,15 +4801,16 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \tstruct ice_pf *pf = vsi->back;\n \tstruct ice_hw *hw = &pf->hw;\n \tenum ice_status status;\n+\tstruct device *dev;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (seed) {\n \t\tstruct ice_aqc_get_set_rss_keys *buf =\n \t\t\t\t  (struct ice_aqc_get_set_rss_keys *)seed;\n \n \t\tstatus = ice_aq_get_rss_key(hw, vsi->idx, buf);\n \t\tif (status) {\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Cannot get RSS key, err %d aq_err %d\\n\",\n+\t\t\tdev_err(dev, \"Cannot get RSS key, err %d aq_err %d\\n\",\n \t\t\t\tstatus, hw->adminq.rq_last_status);\n \t\t\treturn -EIO;\n \t\t}\n@@ -4820,8 +4820,7 @@ int ice_get_rss(struct ice_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)\n \t\tstatus = ice_aq_get_rss_lut(hw, vsi->idx, vsi->rss_lut_type,\n \t\t\t\t\t    lut, lut_size);\n \t\tif (status) {\n-\t\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\t\"Cannot get RSS lut, err %d aq_err %d\\n\",\n+\t\t\tdev_err(dev, \"Cannot get RSS lut, err %d aq_err %d\\n\",\n \t\t\t\tstatus, hw->adminq.rq_last_status);\n \t\t\treturn -EIO;\n \t\t}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 565fc9780ebe..269204ca0b1d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -185,12 +185,14 @@ static void ice_dis_vf_mappings(struct ice_vf *vf)\n {\n \tstruct ice_pf *pf = vf->pf;\n \tstruct ice_vsi *vsi;\n+\tstruct device *dev;\n \tint first, last, v;\n \tstruct ice_hw *hw;\n \n \thw = &pf->hw;\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n \n+\tdev = ice_pf_to_dev(pf);\n \twr32(hw, VPINT_ALLOC(vf->vf_id), 0);\n \twr32(hw, VPINT_ALLOC_PCI(vf->vf_id), 0);\n \n@@ -209,13 +211,12 @@ static void ice_dis_vf_mappings(struct ice_vf *vf)\n \tif (vsi->tx_mapping_mode == ICE_VSI_MAP_CONTIG)\n \t\twr32(hw, VPLAN_TX_QBASE(vf->vf_id), 0);\n \telse\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Scattered mode for VF Tx queues is not yet implemented\\n\");\n+\t\tdev_err(dev, \"Scattered mode for VF Tx queues is not yet implemented\\n\");\n \n \tif (vsi->rx_mapping_mode == ICE_VSI_MAP_CONTIG)\n \t\twr32(hw, VPLAN_RX_QBASE(vf->vf_id), 0);\n \telse\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"Scattered mode for VF Rx queues is not yet implemented\\n\");\n }\n \n@@ -290,6 +291,7 @@ static void ice_dis_vf_qs(struct ice_vf *vf)\n  */\n void ice_free_vfs(struct ice_pf *pf)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \tint tmp, i;\n \n@@ -311,7 +313,7 @@ void ice_free_vfs(struct ice_pf *pf)\n \tif (!pci_vfs_assigned(pf->pdev))\n \t\tpci_disable_sriov(pf->pdev);\n \telse\n-\t\tdev_warn(&pf->pdev->dev, \"VFs are assigned - not disabling SR-IOV\\n\");\n+\t\tdev_warn(dev, \"VFs are assigned - not disabling SR-IOV\\n\");\n \n \ttmp = pf->num_alloc_vfs;\n \tpf->num_vf_qps = 0;\n@@ -326,10 +328,9 @@ void ice_free_vfs(struct ice_pf *pf)\n \t}\n \n \tif (ice_sriov_free_msix_res(pf))\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Failed to free MSIX resources used by SR-IOV\\n\");\n+\t\tdev_err(dev, \"Failed to free MSIX resources used by SR-IOV\\n\");\n \n-\tdevm_kfree(&pf->pdev->dev, pf->vf);\n+\tdevm_kfree(dev, pf->vf);\n \tpf->vf = NULL;\n \n \t/* This check is for when the driver is unloaded while VFs are\n@@ -368,9 +369,11 @@ static void ice_trigger_vf_reset(struct ice_vf *vf, bool is_vflr, bool is_pfr)\n {\n \tstruct ice_pf *pf = vf->pf;\n \tu32 reg, reg_idx, bit_idx;\n+\tstruct device *dev;\n \tstruct ice_hw *hw;\n \tint vf_abs_id, i;\n \n+\tdev = ice_pf_to_dev(pf);\n \thw = &pf->hw;\n \tvf_abs_id = vf->vf_id + hw->func_caps.vf_base_id;\n \n@@ -416,7 +419,7 @@ static void ice_trigger_vf_reset(struct ice_vf *vf, bool is_vflr, bool is_pfr)\n \t\tif ((reg & VF_TRANS_PENDING_M) == 0)\n \t\t\tbreak;\n \n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"VF %d PCI transactions stuck\\n\", vf->vf_id);\n \t\tudelay(ICE_PCI_CIAD_WAIT_DELAY_US);\n \t}\n@@ -532,14 +535,16 @@ static int ice_alloc_vsi_res(struct ice_vf *vf)\n \tLIST_HEAD(tmp_add_list);\n \tu8 broadcast[ETH_ALEN];\n \tstruct ice_vsi *vsi;\n+\tstruct device *dev;\n \tint status = 0;\n \n+\tdev = ice_pf_to_dev(pf);\n \t/* first vector index is the VFs OICR index */\n \tvf->first_vector_idx = ice_calc_vf_first_vector_idx(pf, vf);\n \n \tvsi = ice_vf_vsi_setup(pf, pf->hw.port_info, vf->vf_id);\n \tif (!vsi) {\n-\t\tdev_err(&pf->pdev->dev, \"Failed to create VF VSI\\n\");\n+\t\tdev_err(dev, \"Failed to create VF VSI\\n\");\n \t\treturn -ENOMEM;\n \t}\n \n@@ -567,8 +572,7 @@ static int ice_alloc_vsi_res(struct ice_vf *vf)\n \n \tstatus = ice_add_mac(&pf->hw, &tmp_add_list);\n \tif (status)\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"could not add mac filters error %d\\n\", status);\n+\t\tdev_err(dev, \"could not add mac filters error %d\\n\", status);\n \telse\n \t\tvf->num_mac = 1;\n \n@@ -579,7 +583,7 @@ static int ice_alloc_vsi_res(struct ice_vf *vf)\n \t * more vectors.\n \t */\n ice_alloc_vsi_res_exit:\n-\tice_free_fltr_list(&pf->pdev->dev, &tmp_add_list);\n+\tice_free_fltr_list(dev, &tmp_add_list);\n \treturn status;\n }\n \n@@ -635,10 +639,12 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)\n \tint abs_vf_id, abs_first, abs_last;\n \tstruct ice_pf *pf = vf->pf;\n \tstruct ice_vsi *vsi;\n+\tstruct device *dev;\n \tint first, last, v;\n \tstruct ice_hw *hw;\n \tu32 reg;\n \n+\tdev = ice_pf_to_dev(pf);\n \thw = &pf->hw;\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n \tfirst = vf->first_vector_idx;\n@@ -686,8 +692,7 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)\n \t\t\tVPLAN_TX_QBASE_VFNUMQ_M));\n \t\twr32(hw, VPLAN_TX_QBASE(vf->vf_id), reg);\n \t} else {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Scattered mode for VF Tx queues is not yet implemented\\n\");\n+\t\tdev_err(dev, \"Scattered mode for VF Tx queues is not yet implemented\\n\");\n \t}\n \n \t/* set regardless of mapping mode */\n@@ -705,8 +710,7 @@ static void ice_ena_vf_mappings(struct ice_vf *vf)\n \t\t\tVPLAN_RX_QBASE_VFNUMQ_M));\n \t\twr32(hw, VPLAN_RX_QBASE(vf->vf_id), reg);\n \t} else {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Scattered mode for VF Rx queues is not yet implemented\\n\");\n+\t\tdev_err(dev, \"Scattered mode for VF Rx queues is not yet implemented\\n\");\n \t}\n }\n \n@@ -852,6 +856,7 @@ static int ice_check_avail_res(struct ice_pf *pf)\n {\n \tint max_valid_res_idx = ice_get_max_valid_res_idx(pf->irq_tracker);\n \tu16 num_msix, num_txq, num_rxq, num_avail_msix;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \n \tif (!pf->num_alloc_vfs || max_valid_res_idx < 0)\n \t\treturn -EINVAL;\n@@ -884,8 +889,7 @@ static int ice_check_avail_res(struct ice_pf *pf)\n \t\t\t\t\t     ICE_DFLT_INTR_PER_VF,\n \t\t\t\t\t     ICE_MIN_INTR_PER_VF);\n \t} else {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Number of VFs %d exceeds max VF count %d\\n\",\n+\t\tdev_err(dev, \"Number of VFs %d exceeds max VF count %d\\n\",\n \t\t\tpf->num_alloc_vfs, ICE_MAX_VF_COUNT);\n \t\treturn -EIO;\n \t}\n@@ -1023,12 +1027,12 @@ ice_vf_set_vsi_promisc(struct ice_vf *vf, struct ice_vsi *vsi, u8 promisc_m,\n  */\n static bool ice_config_res_vfs(struct ice_pf *pf)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \tint v;\n \n \tif (ice_check_avail_res(pf)) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Cannot allocate VF resources, try with fewer number of VFs\\n\");\n+\t\tdev_err(dev, \"Cannot allocate VF resources, try with fewer number of VFs\\n\");\n \t\treturn false;\n \t}\n \n@@ -1041,9 +1045,8 @@ static bool ice_config_res_vfs(struct ice_pf *pf)\n \t\tstruct ice_vf *vf = &pf->vf[v];\n \n \t\tvf->num_vf_qs = pf->num_vf_qps;\n-\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\"VF-id %d has %d queues configured\\n\",\n-\t\t\tvf->vf_id, vf->num_vf_qs);\n+\t\tdev_dbg(dev, \"VF-id %d has %d queues configured\\n\", vf->vf_id,\n+\t\t\tvf->num_vf_qs);\n \t\tice_cleanup_and_realloc_vf(vf);\n \t}\n \n@@ -1067,6 +1070,7 @@ static bool ice_config_res_vfs(struct ice_pf *pf)\n  */\n bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \tstruct ice_vf *vf;\n \tint v, i;\n@@ -1125,7 +1129,7 @@ bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr)\n \t * time, but continue on with the operation.\n \t */\n \tif (v < pf->num_alloc_vfs)\n-\t\tdev_warn(&pf->pdev->dev, \"VF reset check timeout\\n\");\n+\t\tdev_warn(dev, \"VF reset check timeout\\n\");\n \n \t/* free VF resources to begin resetting the VSI state */\n \tfor (v = 0; v < pf->num_alloc_vfs; v++) {\n@@ -1142,8 +1146,7 @@ bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr)\n \t}\n \n \tif (ice_sriov_free_msix_res(pf))\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"Failed to free MSIX resources used by SR-IOV\\n\");\n+\t\tdev_err(dev, \"Failed to free MSIX resources used by SR-IOV\\n\");\n \n \tif (!ice_config_res_vfs(pf))\n \t\treturn false;\n@@ -1181,16 +1184,18 @@ static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n {\n \tstruct ice_pf *pf = vf->pf;\n \tstruct ice_vsi *vsi;\n+\tstruct device *dev;\n \tstruct ice_hw *hw;\n \tbool rsd = false;\n \tu8 promisc_m;\n \tu32 reg;\n \tint i;\n \n+\tdev = ice_pf_to_dev(pf);\n+\n \tif (ice_is_vf_disabled(vf)) {\n-\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\"VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\\n\",\n-\t\t\t vf->vf_id);\n+\t\tdev_dbg(dev, \"VF is already disabled, there is no need for resetting it, telling VM, all is fine %d\\n\",\n+\t\t\tvf->vf_id);\n \t\treturn true;\n \t}\n \n@@ -1232,8 +1237,7 @@ static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \t * continue on with the operation.\n \t */\n \tif (!rsd)\n-\t\tdev_warn(&pf->pdev->dev, \"VF reset check timeout on VF %d\\n\",\n-\t\t\t vf->vf_id);\n+\t\tdev_warn(dev, \"VF reset check timeout on VF %d\\n\", vf->vf_id);\n \n \t/* disable promiscuous modes in case they were enabled\n \t * ignore any error if disabling process failed\n@@ -1247,7 +1251,7 @@ static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \n \t\tvsi = pf->vsi[vf->lan_vsi_idx];\n \t\tif (ice_vf_set_vsi_promisc(vf, vsi, promisc_m, true))\n-\t\t\tdev_err(&pf->pdev->dev, \"disabling promiscuous mode failed\\n\");\n+\t\t\tdev_err(dev, \"disabling promiscuous mode failed\\n\");\n \t}\n \n \t/* free VF resources to begin resetting the VSI state */\n@@ -1325,6 +1329,7 @@ static void ice_vc_notify_vf_reset(struct ice_vf *vf)\n  */\n static int ice_alloc_vfs(struct ice_pf *pf, u16 num_alloc_vfs)\n {\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tstruct ice_hw *hw = &pf->hw;\n \tstruct ice_vf *vfs;\n \tint i, ret;\n@@ -1341,8 +1346,7 @@ static int ice_alloc_vfs(struct ice_pf *pf, u16 num_alloc_vfs)\n \t\tgoto err_unroll_intr;\n \t}\n \t/* allocate memory */\n-\tvfs = devm_kcalloc(&pf->pdev->dev, num_alloc_vfs, sizeof(*vfs),\n-\t\t\t   GFP_KERNEL);\n+\tvfs = devm_kcalloc(dev, num_alloc_vfs, sizeof(*vfs), GFP_KERNEL);\n \tif (!vfs) {\n \t\tret = -ENOMEM;\n \t\tgoto err_pci_disable_sriov;\n@@ -1371,7 +1375,7 @@ static int ice_alloc_vfs(struct ice_pf *pf, u16 num_alloc_vfs)\n \n err_unroll_sriov:\n \tpf->vf = NULL;\n-\tdevm_kfree(&pf->pdev->dev, vfs);\n+\tdevm_kfree(dev, vfs);\n \tvfs = NULL;\n \tpf->num_alloc_vfs = 0;\n err_pci_disable_sriov:\n@@ -1416,7 +1420,7 @@ static bool ice_pf_state_is_nominal(struct ice_pf *pf)\n static int ice_pci_sriov_ena(struct ice_pf *pf, int num_vfs)\n {\n \tint pre_existing_vfs = pci_num_vf(pf->pdev);\n-\tstruct device *dev = &pf->pdev->dev;\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \tint err;\n \n \tif (!ice_pf_state_is_nominal(pf)) {\n@@ -1461,10 +1465,10 @@ static int ice_pci_sriov_ena(struct ice_pf *pf, int num_vfs)\n int ice_sriov_configure(struct pci_dev *pdev, int num_vfs)\n {\n \tstruct ice_pf *pf = pci_get_drvdata(pdev);\n+\tstruct device *dev = ice_pf_to_dev(pf);\n \n \tif (ice_is_safe_mode(pf)) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"SR-IOV cannot be configured - Device is in Safe Mode\\n\");\n+\t\tdev_err(dev, \"SR-IOV cannot be configured - Device is in Safe Mode\\n\");\n \t\treturn -EOPNOTSUPP;\n \t}\n \n@@ -1474,8 +1478,7 @@ int ice_sriov_configure(struct pci_dev *pdev, int num_vfs)\n \tif (!pci_vfs_assigned(pdev)) {\n \t\tice_free_vfs(pf);\n \t} else {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"can't free VFs because some are assigned to VMs.\\n\");\n+\t\tdev_err(dev, \"can't free VFs because some are assigned to VMs.\\n\");\n \t\treturn -EBUSY;\n \t}\n \n@@ -1538,6 +1541,7 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,\n \t\t      enum virtchnl_status_code v_retval, u8 *msg, u16 msglen)\n {\n \tenum ice_status aq_ret;\n+\tstruct device *dev;\n \tstruct ice_pf *pf;\n \n \t/* validate the request */\n@@ -1546,16 +1550,18 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,\n \n \tpf = vf->pf;\n \n+\tdev = ice_pf_to_dev(pf);\n+\n \t/* single place to detect unsuccessful return values */\n \tif (v_retval) {\n \t\tvf->num_inval_msgs++;\n-\t\tdev_info(&pf->pdev->dev, \"VF %d failed opcode %d, retval: %d\\n\",\n-\t\t\t vf->vf_id, v_opcode, v_retval);\n+\t\tdev_info(dev, \"VF %d failed opcode %d, retval: %d\\n\", vf->vf_id,\n+\t\t\t v_opcode, v_retval);\n \t\tif (vf->num_inval_msgs > ICE_DFLT_NUM_INVAL_MSGS_ALLOWED) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"Number of invalid messages exceeded for VF %d\\n\",\n \t\t\t\tvf->vf_id);\n-\t\t\tdev_err(&pf->pdev->dev, \"Use PF Control I/F to enable the VF\\n\");\n+\t\t\tdev_err(dev, \"Use PF Control I/F to enable the VF\\n\");\n \t\t\tset_bit(ICE_VF_STATE_DIS, vf->vf_states);\n \t\t\treturn -EIO;\n \t\t}\n@@ -1568,7 +1574,7 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,\n \taq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval,\n \t\t\t\t       msg, msglen, NULL);\n \tif (aq_ret && pf->hw.mailboxq.sq_last_status != ICE_AQ_RC_ENOSYS) {\n-\t\tdev_info(&pf->pdev->dev,\n+\t\tdev_info(dev,\n \t\t\t \"Unable to send the message to VF %d ret %d aq_err %d\\n\",\n \t\t\t vf->vf_id, aq_ret, pf->hw.mailboxq.sq_last_status);\n \t\treturn -EIO;\n@@ -2273,7 +2279,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)\n \n \tif (qci->num_queue_pairs > ICE_MAX_BASE_QS_PER_VF ||\n \t    qci->num_queue_pairs > min_t(u16, vsi->alloc_txq, vsi->alloc_rxq)) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(ice_pf_to_dev(pf),\n \t\t\t\"VF-%d requesting more than supported number of queues: %d\\n\",\n \t\t\tvf->vf_id, min_t(u16, vsi->alloc_txq, vsi->alloc_rxq));\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n@@ -2386,9 +2392,12 @@ ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set)\n \tenum virtchnl_ops vc_op;\n \tenum ice_status status;\n \tstruct ice_vsi *vsi;\n+\tstruct device *dev;\n \tint mac_count = 0;\n \tint i;\n \n+\tdev = ice_pf_to_dev(pf);\n+\n \tif (set)\n \t\tvc_op = VIRTCHNL_OP_ADD_ETH_ADDR;\n \telse\n@@ -2402,7 +2411,7 @@ ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set)\n \n \tif (set && !ice_is_vf_trusted(vf) &&\n \t    (vf->num_mac + al->num_elements) > ICE_MAX_MACADDR_PER_VF) {\n-\t\tdev_err(&pf->pdev->dev,\n+\t\tdev_err(dev,\n \t\t\t\"Can't add more MAC addresses, because VF-%d is not trusted, switch the VF to trusted mode in order to add more functionalities\\n\",\n \t\t\tvf->vf_id);\n \t\t/* There is no need to let VF know about not being trusted\n@@ -2427,13 +2436,13 @@ ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set)\n \t\t\t\t/* VF is trying to add filters that the PF\n \t\t\t\t * already added. Just continue.\n \t\t\t\t */\n-\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\tdev_info(dev,\n \t\t\t\t\t \"MAC %pM already set for VF %d\\n\",\n \t\t\t\t\t maddr, vf->vf_id);\n \t\t\t\tcontinue;\n \t\t\t} else {\n \t\t\t\t/* VF can't remove dflt_lan_addr/bcast MAC */\n-\t\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\tdev_err(dev,\n \t\t\t\t\t\"VF can't remove default MAC address or MAC %pM programmed by PF for VF %d\\n\",\n \t\t\t\t\tmaddr, vf->vf_id);\n \t\t\t\tcontinue;\n@@ -2442,7 +2451,7 @@ ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set)\n \n \t\t/* check for the invalid cases and bail if necessary */\n \t\tif (is_zero_ether_addr(maddr)) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"invalid MAC %pM provided for VF %d\\n\",\n \t\t\t\tmaddr, vf->vf_id);\n \t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n@@ -2451,7 +2460,7 @@ ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set)\n \n \t\tif (is_unicast_ether_addr(maddr) &&\n \t\t    !ice_can_vf_change_mac(vf)) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"can't change unicast MAC for untrusted VF %d\\n\",\n \t\t\t\tvf->vf_id);\n \t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n@@ -2462,12 +2471,12 @@ ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set)\n \t\tstatus = ice_vsi_cfg_mac_fltr(vsi, maddr, set);\n \t\tif (status == ICE_ERR_DOES_NOT_EXIST ||\n \t\t    status == ICE_ERR_ALREADY_EXISTS) {\n-\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\tdev_info(dev,\n \t\t\t\t \"can't %s MAC filters %pM for VF %d, error %d\\n\",\n \t\t\t\t set ? \"add\" : \"remove\", maddr, vf->vf_id,\n \t\t\t\t status);\n \t\t} else if (status) {\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"can't %s MAC filters for VF %d, error %d\\n\",\n \t\t\t\tset ? \"add\" : \"remove\", vf->vf_id, status);\n \t\t\tv_ret = ice_err_to_virt_err(status);\n@@ -2532,7 +2541,9 @@ static int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg)\n \tu16 max_allowed_vf_queues;\n \tu16 tx_rx_queue_left;\n \tu16 cur_queues;\n+\tstruct device *dev;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n \t\tgoto error_param;\n@@ -2543,17 +2554,15 @@ static int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg)\n \t\t\t\t ice_get_avail_rxq_count(pf));\n \tmax_allowed_vf_queues = tx_rx_queue_left + cur_queues;\n \tif (!req_queues) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"VF %d tried to request 0 queues. Ignoring.\\n\",\n+\t\tdev_err(dev, \"VF %d tried to request 0 queues. Ignoring.\\n\",\n \t\t\tvf->vf_id);\n \t} else if (req_queues > ICE_MAX_BASE_QS_PER_VF) {\n-\t\tdev_err(&pf->pdev->dev,\n-\t\t\t\"VF %d tried to request more than %d queues.\\n\",\n+\t\tdev_err(dev, \"VF %d tried to request more than %d queues.\\n\",\n \t\t\tvf->vf_id, ICE_MAX_BASE_QS_PER_VF);\n \t\tvfres->num_queue_pairs = ICE_MAX_BASE_QS_PER_VF;\n \t} else if (req_queues > cur_queues &&\n \t\t   req_queues - cur_queues > tx_rx_queue_left) {\n-\t\tdev_warn(&pf->pdev->dev,\n+\t\tdev_warn(dev,\n \t\t\t \"VF %d requested %u more queues, but only %u left.\\n\",\n \t\t\t vf->vf_id, req_queues - cur_queues, tx_rx_queue_left);\n \t\tvfres->num_queue_pairs = min_t(u16, max_allowed_vf_queues,\n@@ -2562,8 +2571,7 @@ static int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg)\n \t\t/* request is successful, then reset VF */\n \t\tvf->num_req_qs = req_queues;\n \t\tice_vc_reset_vf(vf);\n-\t\tdev_info(&pf->pdev->dev,\n-\t\t\t \"VF %d granted request of %u queues.\\n\",\n+\t\tdev_info(dev, \"VF %d granted request of %u queues.\\n\",\n \t\t\t vf->vf_id, req_queues);\n \t\treturn 0;\n \t}\n@@ -2592,36 +2600,37 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_pf *pf = np->vsi->back;\n \tstruct ice_vsi *vsi;\n+\tstruct device *dev;\n \tstruct ice_vf *vf;\n \tint ret = 0;\n \n+\tdev = ice_pf_to_dev(pf);\n \t/* validate the request */\n \tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tdev_err(&pf->pdev->dev, \"invalid VF id: %d\\n\", vf_id);\n+\t\tdev_err(dev, \"invalid VF id: %d\\n\", vf_id);\n \t\treturn -EINVAL;\n \t}\n \n \tif (vlan_id > ICE_MAX_VLANID || qos > 7) {\n-\t\tdev_err(&pf->pdev->dev, \"Invalid VF Parameters\\n\");\n+\t\tdev_err(dev, \"Invalid VF Parameters\\n\");\n \t\treturn -EINVAL;\n \t}\n \n \tif (vlan_proto != htons(ETH_P_8021Q)) {\n-\t\tdev_err(&pf->pdev->dev, \"VF VLAN protocol is not supported\\n\");\n+\t\tdev_err(dev, \"VF VLAN protocol is not supported\\n\");\n \t\treturn -EPROTONOSUPPORT;\n \t}\n \n \tvf = &pf->vf[vf_id];\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n \tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tdev_err(&pf->pdev->dev, \"VF %d in reset. Try again.\\n\", vf_id);\n+\t\tdev_err(dev, \"VF %d in reset. Try again.\\n\", vf_id);\n \t\treturn -EBUSY;\n \t}\n \n \tif (le16_to_cpu(vsi->info.pvid) == vlanprio) {\n \t\t/* duplicate request, so just return success */\n-\t\tdev_info(&pf->pdev->dev,\n-\t\t\t \"Duplicate pvid %d request\\n\", vlanprio);\n+\t\tdev_dbg(dev, \"Duplicate pvid %d request\\n\", vlanprio);\n \t\treturn ret;\n \t}\n \n@@ -2640,7 +2649,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,\n \t}\n \n \tif (vlan_id) {\n-\t\tdev_info(&pf->pdev->dev, \"Setting VLAN %d, QOS 0x%x on VF %d\\n\",\n+\t\tdev_info(dev, \"Setting VLAN %d, QoS 0x%x on VF %d\\n\",\n \t\t\t vlan_id, qos, vf_id);\n \n \t\t/* add new VLAN filter for each MAC */\n@@ -2685,11 +2694,13 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \tstruct ice_pf *pf = vf->pf;\n \tbool vlan_promisc = false;\n \tstruct ice_vsi *vsi;\n+\tstruct device *dev;\n \tstruct ice_hw *hw;\n \tint status = 0;\n \tu8 promisc_m;\n \tint i;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n \t\tgoto error_param;\n@@ -2707,7 +2718,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \n \tif (add_v && !ice_is_vf_trusted(vf) &&\n \t    vf->num_vlan >= ICE_MAX_VLAN_PER_VF) {\n-\t\tdev_info(&pf->pdev->dev,\n+\t\tdev_info(dev,\n \t\t\t \"VF-%d is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\\n\",\n \t\t\t vf->vf_id);\n \t\t/* There is no need to let VF know about being not trusted,\n@@ -2719,7 +2730,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \tfor (i = 0; i < vfl->num_elements; i++) {\n \t\tif (vfl->vlan_id[i] > ICE_MAX_VLANID) {\n \t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"invalid VF VLAN id %d\\n\", vfl->vlan_id[i]);\n \t\t\tgoto error_param;\n \t\t}\n@@ -2747,7 +2758,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \n \t\t\tif (!ice_is_vf_trusted(vf) &&\n \t\t\t    vf->num_vlan >= ICE_MAX_VLAN_PER_VF) {\n-\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\tdev_info(dev,\n \t\t\t\t\t \"VF-%d is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\\n\",\n \t\t\t\t\t vf->vf_id);\n \t\t\t\t/* There is no need to let VF know about being\n@@ -2768,7 +2779,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \t\t\t\tstatus = ice_cfg_vlan_pruning(vsi, true, false);\n \t\t\t\tif (status) {\n \t\t\t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n-\t\t\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\tdev_err(dev,\n \t\t\t\t\t\t\"Enable VLAN pruning on VLAN ID: %d failed error-%d\\n\",\n \t\t\t\t\t\tvid, status);\n \t\t\t\t\tgoto error_param;\n@@ -2782,7 +2793,7 @@ static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n \t\t\t\t\t\t\t     promisc_m, vid);\n \t\t\t\tif (status) {\n \t\t\t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n-\t\t\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\tdev_err(dev,\n \t\t\t\t\t\t\"Enable Unicast/multicast promiscuous mode on VLAN ID:%d failed error-%d\\n\",\n \t\t\t\t\t\tvid, status);\n \t\t\t\t}\n@@ -2969,8 +2980,10 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \tu16 msglen = event->msg_len;\n \tu8 *msg = event->msg_buf;\n \tstruct ice_vf *vf = NULL;\n+\tstruct device *dev;\n \tint err = 0;\n \n+\tdev = ice_pf_to_dev(pf);\n \tif (vf_id >= pf->num_alloc_vfs) {\n \t\terr = -EINVAL;\n \t\tgoto error_handler;\n@@ -2997,7 +3010,7 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \tif (err) {\n \t\tice_vc_send_msg_to_vf(vf, v_opcode, VIRTCHNL_STATUS_ERR_PARAM,\n \t\t\t\t      NULL, 0);\n-\t\tdev_err(&pf->pdev->dev, \"Invalid message from VF %d, opcode %d, len %d, error %d\\n\",\n+\t\tdev_err(dev, \"Invalid message from VF %d, opcode %d, len %d, error %d\\n\",\n \t\t\tvf_id, v_opcode, msglen, err);\n \t\treturn;\n \t}\n@@ -3009,7 +3022,7 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \tcase VIRTCHNL_OP_GET_VF_RESOURCES:\n \t\terr = ice_vc_get_vf_res_msg(vf, msg);\n \t\tif (ice_vf_init_vlan_stripping(vf))\n-\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\tdev_err(dev,\n \t\t\t\t\"Failed to initialize VLAN stripping for VF %d\\n\",\n \t\t\t\tvf->vf_id);\n \t\tice_vc_notify_vf_link_state(vf);\n@@ -3062,8 +3075,8 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \t\tbreak;\n \tcase VIRTCHNL_OP_UNKNOWN:\n \tdefault:\n-\t\tdev_err(&pf->pdev->dev, \"Unsupported opcode %d from VF %d\\n\",\n-\t\t\tv_opcode, vf_id);\n+\t\tdev_err(dev, \"Unsupported opcode %d from VF %d\\n\", v_opcode,\n+\t\t\tvf_id);\n \t\terr = ice_vc_send_msg_to_vf(vf, v_opcode,\n \t\t\t\t\t    VIRTCHNL_STATUS_ERR_NOT_SUPPORTED,\n \t\t\t\t\t    NULL, 0);\n@@ -3073,8 +3086,7 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \t\t/* Helper function cares less about error return values here\n \t\t * as it is busy with pending work.\n \t\t */\n-\t\tdev_info(&pf->pdev->dev,\n-\t\t\t \"PF failed to honor VF %d, opcode %d, error %d\\n\",\n+\t\tdev_info(dev, \"PF failed to honor VF %d, opcode %d, error %d\\n\",\n \t\t\t vf_id, v_opcode, err);\n \t}\n }\n@@ -3145,9 +3157,12 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n \tstruct ice_pf *pf = vsi->back;\n \tstruct ice_vsi_ctx *ctx;\n \tenum ice_status status;\n+\tstruct device *dev;\n \tstruct ice_vf *vf;\n \tint ret = 0;\n \n+\tdev = ice_pf_to_dev(pf);\n+\n \t/* validate the request */\n \tif (vf_id >= pf->num_alloc_vfs) {\n \t\tnetdev_err(netdev, \"invalid VF id: %d\\n\", vf_id);\n@@ -3161,7 +3176,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n \t}\n \n \tif (ena == vf->spoofchk) {\n-\t\tdev_dbg(&pf->pdev->dev, \"VF spoofchk already %s\\n\",\n+\t\tdev_dbg(dev, \"VF spoofchk already %s\\n\",\n \t\t\tena ? \"ON\" : \"OFF\");\n \t\treturn 0;\n \t}\n@@ -3179,7 +3194,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n \n \tstatus = ice_update_vsi(&pf->hw, vsi->idx, ctx, NULL);\n \tif (status) {\n-\t\tdev_dbg(&pf->pdev->dev,\n+\t\tdev_dbg(dev,\n \t\t\t\"Error %d, failed to update VSI* parameters\\n\", status);\n \t\tret = -EIO;\n \t\tgoto out;\n@@ -3280,11 +3295,14 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n \tstruct ice_netdev_priv *np = netdev_priv(netdev);\n \tstruct ice_vsi *vsi = np->vsi;\n \tstruct ice_pf *pf = vsi->back;\n+\tstruct device *dev;\n \tstruct ice_vf *vf;\n \n+\tdev = ice_pf_to_dev(pf);\n+\n \t/* validate the request */\n \tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tdev_err(&pf->pdev->dev, \"invalid VF id: %d\\n\", vf_id);\n+\t\tdev_err(dev, \"invalid VF id: %d\\n\", vf_id);\n \t\treturn -EINVAL;\n \t}\n \n@@ -3299,7 +3317,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n \tice_wait_on_vf_reset(vf);\n \n \tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tdev_err(&pf->pdev->dev, \"VF %d in reset. Try again.\\n\", vf_id);\n+\t\tdev_err(dev, \"VF %d in reset. Try again.\\n\", vf_id);\n \t\treturn -EBUSY;\n \t}\n \n@@ -3309,7 +3327,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n \n \tvf->trusted = trusted;\n \tice_vc_reset_vf(vf);\n-\tdev_info(&pf->pdev->dev, \"VF %u is now %strusted\\n\",\n+\tdev_info(dev, \"VF %u is now %strusted\\n\",\n \t\t vf_id, trusted ? \"\" : \"un\");\n \n \treturn 0;\n@@ -3329,11 +3347,14 @@ int ice_set_vf_link_state(struct net_device *netdev, int vf_id, int link_state)\n \tstruct ice_pf *pf = np->vsi->back;\n \tstruct virtchnl_pf_event pfe = { 0 };\n \tstruct ice_link_status *ls;\n+\tstruct device *dev;\n \tstruct ice_vf *vf;\n \tstruct ice_hw *hw;\n \n+\tdev = ice_pf_to_dev(pf);\n+\n \tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tdev_err(&pf->pdev->dev, \"Invalid VF Identifier %d\\n\", vf_id);\n+\t\tdev_err(dev, \"Invalid VF Identifier %d\\n\", vf_id);\n \t\treturn -EINVAL;\n \t}\n \n@@ -3342,7 +3363,7 @@ int ice_set_vf_link_state(struct net_device *netdev, int vf_id, int link_state)\n \tls = &pf->hw.port_info->phy.link_info;\n \n \tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tdev_err(&pf->pdev->dev, \"vf %d in reset. Try again.\\n\", vf_id);\n+\t\tdev_err(dev, \"vf %d in reset. Try again.\\n\", vf_id);\n \t\treturn -EBUSY;\n \t}\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c\nindex fcffad0069d6..cf9b8b22d24f 100644\n--- a/drivers/net/ethernet/intel/ice/ice_xsk.c\n+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c\n@@ -331,7 +331,7 @@ static int ice_xsk_umem_dma_map(struct ice_vsi *vsi, struct xdp_umem *umem)\n \tstruct device *dev;\n \tunsigned int i;\n \n-\tdev = &pf->pdev->dev;\n+\tdev = ice_pf_to_dev(pf);\n \tfor (i = 0; i < umem->npgs; i++) {\n \t\tdma_addr_t dma = dma_map_page_attrs(dev, umem->pgs[i], 0,\n \t\t\t\t\t\t    PAGE_SIZE,\n@@ -369,7 +369,7 @@ static void ice_xsk_umem_dma_unmap(struct ice_vsi *vsi, struct xdp_umem *umem)\n \tstruct device *dev;\n \tunsigned int i;\n \n-\tdev = &pf->pdev->dev;\n+\tdev = ice_pf_to_dev(pf);\n \tfor (i = 0; i < umem->npgs; i++) {\n \t\tdma_unmap_page_attrs(dev, umem->pages[i].dma, PAGE_SIZE,\n \t\t\t\t     DMA_BIDIRECTIONAL, ICE_RX_DMA_ATTR);\n",
    "prefixes": [
        "S33",
        "10/15"
    ]
}