Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4747912ybg; Mon, 21 Oct 2019 13:53:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrk5t+aAygDzlky5wGxrrGZmPHhfVRvdPmx8J3VCPcdLskZK1VcovM8Dr3imnaecjR6O8+ X-Received: by 2002:a50:af45:: with SMTP id g63mr26792319edd.21.1571691236098; Mon, 21 Oct 2019 13:53:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571691236; cv=none; d=google.com; s=arc-20160816; b=HgcGBgrwh6yuCzp2uLMBu+IUaGdqz20+EFB9ResY+YTKxGKsLRH9rFsk1y0AZ5QQ69 I65zQv0E2KHDd92kCRGlvxLPdZgMRzRRoInM3NaHtIU5DEDVYIpnMRwG1obwtYRgBTYi 9buQqIxa/NQgwmGik2SndQpjkLqNFS+M17lGaDmgBT9AIR9eYXhIOH3a8uM1tNDKwK/0 bQWl8Aoi1mQzVr65AJjz2N0sZmBBiT5UOpgF5sxbwyIA8bXK3Chjmloi1Bq1uGtRjLED pxo5ZtB9PPJgm2pqe3I4cVsaesacPvw7cejBHQudzvOuNXDihfq9gEtOaKHB90VOIihb dQxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oSeB99tFWrSsr858sLtErorntCjYJIilkerqAgdpByo=; b=Nkvxnq3lu/jyB08E2YFbWuZuO5vvCxxti3i7Vc9aU+s9NOeTuyU6DXDhN/b7gosi76 F+uuoKDDZFzaNIf2chmF3U21QWKjWwIAVAMm1nD1AFFF0BeZ2qHIeW+CPgoxfZ61AAfC /ygJTb1qsChvBVWGuhY0aCg9iq/lI/jPuyhSimH1CkIXEvmSVBxZxgvcZLwEk+rr9DjV CijLOMd81bgnh+L7Fv7E+lWZ5oRGo7nx6NLsGs/VORvywwlO850O6KiSqSn4y4Q+EFw4 ny+ZvZd2cQU/bFtzbD11r9nz6we+iI9d9z8J3ZYKUSJA9ff97UuYVAH7Y8a7NTORLv/e Gf/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KOdh9YDG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20si8415709eju.109.2019.10.21.13.53.32; Mon, 21 Oct 2019 13:53:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KOdh9YDG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730506AbfJUUv4 (ORCPT + 99 others); Mon, 21 Oct 2019 16:51:56 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:35224 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730494AbfJUUvy (ORCPT ); Mon, 21 Oct 2019 16:51:54 -0400 Received: by mail-qt1-f194.google.com with SMTP id m15so23396432qtq.2; Mon, 21 Oct 2019 13:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oSeB99tFWrSsr858sLtErorntCjYJIilkerqAgdpByo=; b=KOdh9YDGlIxLKlwrwjHEzIwis/8g92PV/BE52JCKYFqEkK+Y48TP35JaJp7juAZrvZ kba4xzHaPYFpup9+5XQ8DYxyhiiEd+oboNPna18+B2ol3LXvHUeeg8S4zA7Y+PTHTLOw 7yD5z3ItiaxoTzxYoS96BL9/HfMIJIR7DAzxgG6+Nlgm53rEQ1sDSJRT20oWJnQ4WI9Q xs6qdTGugM3TtqbOy6W417fc2mRG5S7NOecOtOPjsDkapsM0JgE+39OlbIZ2jphAJ647 em1Z1FsMnMjxENW3K3Gcuny+ohotTwFjFtYBKb2JoF6R/oQ5pJ34Hy8c78lZ+T+VzLYj MZKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oSeB99tFWrSsr858sLtErorntCjYJIilkerqAgdpByo=; b=LYLfYRPzK4sGPL8RnKiPVTI2lldEecfOA9wiCTKq1z2pWLWu02UmOUQRzEqAZ4Ezke cmiLcgElqng6IuVQbbQNLxHYch6jqC0nP/Ep0M5vHxJ3ko7maKaDhZxJnujWpaAZ2wGg cs2zk3X+nkZw/VEue2SHGEkulP6lCp/JhjpwqVAr+CdNsXgRy4wMQIPxs1D1E9C7/j2Z sqoPtO8V9Tb4tYLGEDRA1kS32KdlKtYUC1mKuYu1PdKvPCteCL0eI4aFi8p50AHM5IFQ QUEsFMyjbpbH5lvfaobAq2sA3Em6+AUc2idd2+e4LEeOFEuFDPH+h/ZL5326XKvEENXo hjkw== X-Gm-Message-State: APjAAAXZucVPHXdCbqsfdOD4jWKfbVY761OCPsYAdw/FRmmahd0VEjHH k/VNIA76csmfVaQs+zGiYEn8Jrf0 X-Received: by 2002:ac8:23e8:: with SMTP id r37mr27024688qtr.365.1571691113112; Mon, 21 Oct 2019 13:51:53 -0700 (PDT) Received: from localhost (modemcable249.105-163-184.mc.videotron.ca. [184.163.105.249]) by smtp.gmail.com with ESMTPSA id h3sm430795qte.62.2019.10.21.13.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 13:51:52 -0700 (PDT) From: Vivien Didelot To: "David S. Miller" Cc: linux-kernel@vger.kernel.org, Vivien Didelot , Florian Fainelli , Andrew Lunn , netdev@vger.kernel.org Subject: [PATCH net-next v2 11/16] net: dsa: mv88e6xxx: silently skip PVT ops Date: Mon, 21 Oct 2019 16:51:25 -0400 Message-Id: <20191021205130.304149-12-vivien.didelot@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191021205130.304149-1-vivien.didelot@gmail.com> References: <20191021205130.304149-1-vivien.didelot@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since mv88e6xxx_pvt_map is a static helper, no need to return -EOPNOTSUPP if the chip has no PVT, simply silently skip the operation. Signed-off-by: Vivien Didelot Reviewed-by: Florian Fainelli --- drivers/net/dsa/mv88e6xxx/chip.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index d67deec77452..510ccdc2d03c 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -1253,7 +1253,7 @@ static int mv88e6xxx_pvt_map(struct mv88e6xxx_chip *chip, int dev, int port) u16 pvlan = 0; if (!mv88e6xxx_has_pvt(chip)) - return -EOPNOTSUPP; + return 0; /* Skip the local source device, which uses in-chip port VLAN */ if (dev != chip->ds->index) @@ -2049,9 +2049,6 @@ static int mv88e6xxx_bridge_map(struct mv88e6xxx_chip *chip, } } - if (!mv88e6xxx_has_pvt(chip)) - return 0; - /* Remap the Port VLAN of each cross-chip bridge group member */ for (dev = 0; dev < DSA_MAX_SWITCHES; ++dev) { ds = chip->ds->dst->ds[dev]; @@ -2101,9 +2098,6 @@ static int mv88e6xxx_crosschip_bridge_join(struct dsa_switch *ds, int dev, struct mv88e6xxx_chip *chip = ds->priv; int err; - if (!mv88e6xxx_has_pvt(chip)) - return 0; - mv88e6xxx_reg_lock(chip); err = mv88e6xxx_pvt_map(chip, dev, port); mv88e6xxx_reg_unlock(chip); @@ -2116,9 +2110,6 @@ static void mv88e6xxx_crosschip_bridge_leave(struct dsa_switch *ds, int dev, { struct mv88e6xxx_chip *chip = ds->priv; - if (!mv88e6xxx_has_pvt(chip)) - return; - mv88e6xxx_reg_lock(chip); if (mv88e6xxx_pvt_map(chip, dev, port)) dev_err(ds->dev, "failed to remap cross-chip Port VLAN\n"); -- 2.23.0