From patchwork Sat Dec 10 12:23:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 9469275 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E86760234 for ; Sat, 10 Dec 2016 12:25:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00D222840B for ; Sat, 10 Dec 2016 12:25:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9900285A8; Sat, 10 Dec 2016 12:25:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ADF22840B for ; Sat, 10 Dec 2016 12:25:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbcLJMZu (ORCPT ); Sat, 10 Dec 2016 07:25:50 -0500 Received: from mail-lf0-f43.google.com ([209.85.215.43]:36205 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbcLJMX5 (ORCPT ); Sat, 10 Dec 2016 07:23:57 -0500 Received: by mail-lf0-f43.google.com with SMTP id t196so17059269lff.3 for ; Sat, 10 Dec 2016 04:23:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o2iEDQc3pEXCmDYUxUssickRTJdY4OwzwKy8xvCuz+c=; b=PiPDAwt7gWbKrlmy0X9GJozmaNekv6t5bi8anD76CIXyVMJKnZkVKLOAHcgKS5EmB0 tRFvmaVI9HlGfDVknpche9F3BkMCXHQjPx63X31qoh9NMfAJzxYV6R0tYu8JUZEPnKEB XF5MtiCt6jw1SJKFE6WUlbGCPSZ1hpDim9Gzg= 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=o2iEDQc3pEXCmDYUxUssickRTJdY4OwzwKy8xvCuz+c=; b=RdhnTVQaNdY+32AoazUt19NAdmspEBKXnYSOisl1LqTIDCkBwpBECSZiDrWLW10+7B FdCop6K+9K5RyCXMG3aRnPF1noMy83HNnQsNQho09D7FXN3wzfN5Rad6UnpeyU0rAzep AJq75aTcM3jRlllD6YGAC3srJ2zhquROT+T7jJfvDkRLCojJSOPm3z/zM84Y5H3brYHO N//ZzPtQQRY1h9lC50NQX4S3H9NT1/fTc5o0xk3GhtLjCJ4WoLasOkTnTu2QKnEtr/mn HLbAWf655f3L7a98DU/dTwMG9v1Qmu3PjituGKNMFz9LXyDLxPoHD6CF4QHKMVnikJ0i ejow== X-Gm-Message-State: AKaTC03pIOVtupFoyD573AA+Be5AzH8YcObcub5cqf5/p1floo5z+Vs35zZbX3eDojwaYyCB X-Received: by 10.46.74.26 with SMTP id x26mr30585998lja.51.1481372635471; Sat, 10 Dec 2016 04:23:55 -0800 (PST) Received: from localhost.localdomain (183-224-132-95.pool.ukrtel.net. [95.132.224.183]) by smtp.gmail.com with ESMTPSA id f14sm2507060lff.40.2016.12.10.04.23.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Dec 2016 04:23:55 -0800 (PST) From: Ivan Khoronzhuk To: mugunthanvnm@ti.com, grygorii.strashko@ti.com Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH 1/5] net: ethernet: ti: cpsw: use same macros to get active slave Date: Sat, 10 Dec 2016 14:23:46 +0200 Message-Id: <1481372630-14914-2-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481372630-14914-1-git-send-email-ivan.khoronzhuk@linaro.org> References: <1481372630-14914-1-git-send-email-ivan.khoronzhuk@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the same, more convenient macros, to get active slave. Signed-off-by: Ivan Khoronzhuk --- drivers/net/ethernet/ti/cpsw.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index b62d958..c45f7d2 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1624,10 +1624,7 @@ static void cpsw_hwtstamp_v2(struct cpsw_priv *priv) struct cpsw_common *cpsw = priv->cpsw; u32 ctrl, mtype; - if (cpsw->data.dual_emac) - slave = &cpsw->slaves[priv->emac_port]; - else - slave = &cpsw->slaves[cpsw->data.active_slave]; + slave = &cpsw->slaves[cpsw_slave_index(cpsw, priv)]; ctrl = slave_read(slave, CPSW2_CONTROL); switch (cpsw->version) {