From patchwork Thu Feb 11 16:20:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 8282451 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F0E29F1C0 for ; Thu, 11 Feb 2016 16:22:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBA8F203B5 for ; Thu, 11 Feb 2016 16:22:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01738203B0 for ; Thu, 11 Feb 2016 16:22:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTtyw-0003Ih-PE; Thu, 11 Feb 2016 16:20:38 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aTtwv-0000Kn-G1 for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2016 16:18:49 +0000 Received: by mail-pf0-x243.google.com with SMTP id 71so2734419pfv.1 for ; Thu, 11 Feb 2016 08:18:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rBXHW/q4SATd5Gh4D6Y+qzayhDjZruE6G1rkFKyoby0=; b=sYHhXRx94vPRbcEIYZnWElJCEzzrCUD13/ZJkllJyms3Gi0YgjMv1R0NtsgG2/KVhq qRwGE4MPbHrgEloOUsYpwXk19N9udow7q+CIJlWGpcFddc51FirhIgL2m8dE/UdPp1Pc HoY99uEcSbeMLn5quZxqktj5A46NpG8xDVRMTHE2HWu3sU2yVcwVPmoIaUJ3B97JVSe+ 5q9uRYScN+og74ybNlXN+76Qim1+Ds2gBgov1UAkSSfnqdTFld8KQlsU3PJ161xJVbIG SHhE69J+CeWlG4iQNFT5r2+vhNP5rqpvcUgnGrmXBWtHmEJAYnFnK4fXFEIywQR79OXn X8Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rBXHW/q4SATd5Gh4D6Y+qzayhDjZruE6G1rkFKyoby0=; b=UaE8zzwBmDAC7DDkzw/CmnI0k4I/qWFg60ZcUO+zyyUOLNBkw9TWpGSpVnooGTxeXE cpX8fFi+1oZ5gh/WzyZkeoR0bNKq0wmXH4M66T+KFUPPIJF5zNr+Kc1Ia49KVe058L1a oyui1nItuWrhFxcsLS0JwCXXL8aY2XN1bffw8s0t+kay7bBdP374D9UoiEeB+5WcBAHU s6X4S8cAgIaEp8oomqjJ1sUJsTe7CiSFQCUyMIUxou2h5ZAayFApdWKoCrrPtl3kLcDa OcejJuwhNl/5BCF+yKY1n4GAZ8E0hrT7M9IK/b7+4eGndMBEUfu61HfxkVVPRfN2jIn1 6p0A== X-Gm-Message-State: AG10YOT2XodZW/wKVX+2pkBInYE6REBK6aVzzgZPjkPib48C2uD5laF2983FXShGIPXCbQ== X-Received: by 10.98.13.154 with SMTP id 26mr53465959pfn.164.1455207493107; Thu, 11 Feb 2016 08:18:13 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id s90sm13355894pfa.49.2016.02.11.08.18.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 08:18:11 -0800 (PST) From: sunil.kovvuri@gmail.com To: netdev@vger.kernel.org Subject: [PATCH v2 5/6] net: thunderx: bgx: Add log message when setting mac address Date: Thu, 11 Feb 2016 21:50:25 +0530 Message-Id: <1455207626-35488-6-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1455207626-35488-1-git-send-email-sunil.kovvuri@gmail.com> References: <1455207626-35488-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_081833_917587_F57C4BE4 X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -1.4 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Robert Richter , sgoutham@cavium.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robert.richter@caviumnetworks.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Robert Richter Signed-off-by: Robert Richter Signed-off-by: Sunil Goutham --- drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c index 111835b..f8abdff 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -886,7 +886,8 @@ static void bgx_get_qlm_mode(struct bgx *bgx) #ifdef CONFIG_ACPI -static int acpi_get_mac_address(struct acpi_device *adev, u8 *dst) +static int acpi_get_mac_address(struct device *dev, struct acpi_device *adev, + u8 *dst) { u8 mac[ETH_ALEN]; int ret; @@ -897,10 +898,13 @@ static int acpi_get_mac_address(struct acpi_device *adev, u8 *dst) goto out; if (!is_valid_ether_addr(mac)) { + dev_err(dev, "MAC address invalid: %pM\n", mac); ret = -EINVAL; goto out; } + dev_info(dev, "MAC address set to: %pM\n", mac); + memcpy(dst, mac, ETH_ALEN); out: return ret; @@ -911,14 +915,15 @@ static acpi_status bgx_acpi_register_phy(acpi_handle handle, u32 lvl, void *context, void **rv) { struct bgx *bgx = context; + struct device *dev = &bgx->pdev->dev; struct acpi_device *adev; if (acpi_bus_get_device(handle, &adev)) goto out; - acpi_get_mac_address(adev, bgx->lmac[bgx->lmac_count].mac); + acpi_get_mac_address(dev, adev, bgx->lmac[bgx->lmac_count].mac); - SET_NETDEV_DEV(&bgx->lmac[bgx->lmac_count].netdev, &bgx->pdev->dev); + SET_NETDEV_DEV(&bgx->lmac[bgx->lmac_count].netdev, dev); bgx->lmac[bgx->lmac_count].lmacid = bgx->lmac_count; out: