Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2640884ybg; Sat, 19 Oct 2019 20:21:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyEh59rKhV2ikIaxWkV3eClU91NpdFmWV5EHd51X1QsxoQgBtydz7+6VkjoueanKltiIMo X-Received: by 2002:a17:906:3751:: with SMTP id e17mr16167300ejc.269.1571541712494; Sat, 19 Oct 2019 20:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571541712; cv=none; d=google.com; s=arc-20160816; b=JRKMe+EL5caTRgQJoEX/8EWR6Bw2cejA/+NXQIuzfAfEHKkYIxh/a1CzfL9Acdu27Y 0C/Wx73ALSpWeTeky3dkPBwhC30wjFpwDUd3XXVzZMEGT7artN5UWrjohqBW9iRDpYTx dZ8i2N5epEEZJG5017Ol+KuxhVXX8VuIyYXwtuGEyJ8RD6pQv1q+ng3wBpTLtj1lcBLg 4weRP0OjMYVh++gVsHqFOnxJWJsFgp9ohQofz9420x1XjJD5BA6JwJTWgh+K2OsdW6fN L3IMx2O7bhWPls3sIICh6uzqK8T7j/buo1yQDRgWYLA19hezsbrOteraog4vibomqMzb jBRg== 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=vSoUwQMmb28/9YfL/IRu91HWB5Xx5Cph7smwaeepDas=; b=04VA8autSvXBot+lG+Ky/vwTn3zBs4ThIPRFaBmPPAfZsAFtqfYnq2e9UFcK5hWbMj qz8cYl6abfizZiYeGgKoeiKMc2kKMU4/5GEleqozIlYwUQhDf2zdATZKT1p4e3dcL2NL bfuvF0HWfu/QweyTMb/VKJxrlD4lxNv/KUi+Ubgf0HMnU5lmczvAwRGkNz8inyLGeeam wu1/I286mXLW0i/SeMUlbTEUMaoax4gqBkFwNDDn8dBfkoTVwE7oZeBEjhzlMwDtWqeJ 3e4euta/pt/WaDwQWMQB8hO2Uk7hauWG/sg9bN9ifY3xcCYJWSH3gh7+0EO3CThZD2f4 MpAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RgbxzeyQ; 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 n17si6294647edo.143.2019.10.19.20.21.29; Sat, 19 Oct 2019 20:21:52 -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=RgbxzeyQ; 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 S1726622AbfJTDUc (ORCPT + 99 others); Sat, 19 Oct 2019 23:20:32 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:42970 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726494AbfJTDUX (ORCPT ); Sat, 19 Oct 2019 23:20:23 -0400 Received: by mail-qk1-f196.google.com with SMTP id f16so9059679qkl.9; Sat, 19 Oct 2019 20:20:23 -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=vSoUwQMmb28/9YfL/IRu91HWB5Xx5Cph7smwaeepDas=; b=RgbxzeyQIGrk+XZy3OCxoZIzCAtBCHUwV1CkM5hY0pOilLYCOU2va+1t/PrMl5ZrkI Snpo+mAHh6YAcv3bAA571byXGP4TMMdMHIeHDt3l7phPtGWGN7ULwPSuuKOo/aeX1BJL nN5lfxSMnYSyxd5xXKtCTteaqvuP2upmrRX328i47HT24HLFqgAmuFMNbFWorBO0zT7r God5N9Y25brAX2cUlHRFsOpAW39Q7ldLVh6wzjxCpHtSb75TKQW+ZkjBHFihDZLEVX6T ivAley2EecOH/k6iCaIr7CNLzl4hSUG1SomZvP3QL8BqmyZx/D9QVJFCZ+AXD8kHQSCd djQg== 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=vSoUwQMmb28/9YfL/IRu91HWB5Xx5Cph7smwaeepDas=; b=qh2RNOo+wHAb7VhMZ9bnlclFFTKlWxj0beeqfKWq0g1iAwBPm4Y+unjyTLxe53Vuq7 0zNFXIyLYGxGzLMT8SI3qlS5bEwn21jMx4lSrhfsZz9YZDqFk3XrMRL1dm2p6hVzNNxH AGwAOt9jDx2ihoeHBgipIDhA1G3xCU23hvHNQG3zAbX1sDu5sOCDZNFdt72QwJXjYU+b kWIossrVi4/O+gdEXCoPdLNGYdiM8K6ci1CHWhzHYH8zbkvaI372BoGmfi8jJiCCHmlv b6/WSWPVevI62mJoWb0hHkgx0EweZqup/Ph1kc0LAGfpGNQ76j7yTxCPRWYabNVz5SNV 46wg== X-Gm-Message-State: APjAAAWK0ghIU51tteBruoQoFPedJtVNLwwrrGXzRTScNRiPUHus44eI tdjOIRn66a+/wS8iPsDAhio= X-Received: by 2002:a37:ef04:: with SMTP id j4mr16439936qkk.75.1571541622484; Sat, 19 Oct 2019 20:20:22 -0700 (PDT) Received: from localhost (modemcable249.105-163-184.mc.videotron.ca. [184.163.105.249]) by smtp.gmail.com with ESMTPSA id y188sm3516599qke.31.2019.10.19.20.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Oct 2019 20:20:21 -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 11/16] net: dsa: mv88e6xxx: silently skip PVT ops Date: Sat, 19 Oct 2019 23:19:36 -0400 Message-Id: <20191020031941.3805884-12-vivien.didelot@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191020031941.3805884-1-vivien.didelot@gmail.com> References: <20191020031941.3805884-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 --- 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