From 1ce0ed3f5b55d260f7d9724bbfe3fbb6bb4122eb Mon Sep 17 00:00:00 2001 From: brucex Date: Thu, 16 Feb 2023 15:13:08 +0800 Subject: [PATCH] tegra_hv_net: Fix wrong var type mac_address is defined wrongly and it does not match the return type of function of_get_mac_address. Bug 3974840 Signed-off-by: Bruce Xu Change-Id: I582c3755b0e2121b2e937dc77b3f9af8694e4357 (cherry picked from commit 8f8de48950266048eaf142cbdec66b1b7ccf0737) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2859221 Reviewed-by: svcacv Reviewed-by: Shardar Mohammed Reviewed-by: Laxman Dewangan Tested-by: Shardar Mohammed GVS: Gerrit_Virtual_Submit --- drivers/net/tegra_hv_net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/tegra_hv_net.c b/drivers/net/tegra_hv_net.c index d2a933cb..aceddecd 100644 --- a/drivers/net/tegra_hv_net.c +++ b/drivers/net/tegra_hv_net.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ #undef DEBUG @@ -114,7 +114,7 @@ struct tegra_hv_net { struct platform_device *pdev; struct net_device *ndev; struct tegra_hv_ivc_cookie *ivck; - const void *mac_address; + int mac_address; struct napi_struct napi; struct tegra_hv_net_stats __percpu *stats; @@ -702,7 +702,7 @@ static int tegra_hv_net_probe(struct platform_device *pdev) /* get mac address from the DT */ hvn->mac_address = of_get_mac_address(dev->of_node, ndev->dev_addr); - if (IS_ERR_OR_NULL(hvn->mac_address)) { + if (IS_ERR(&hvn->mac_address)) { if (of_property_read_bool(dev->of_node, "use-random-mac-addr")) eth_hw_addr_random(ndev); else { @@ -729,7 +729,7 @@ static int tegra_hv_net_probe(struct platform_device *pdev) } } else { /* Set the MAC address. */ - ether_addr_copy(ndev->dev_addr, hvn->mac_address); + ether_addr_copy(ndev->dev_addr, (const u8 *)&hvn->mac_address); } hvn->xmit_wq = alloc_workqueue("tgvnet-wq-%d",