Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3083678pxb; Tue, 12 Oct 2021 21:13:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi1aV+C2kDVfJE82WSdkDdfGUZ1ICY+W3QPKr+LIG7ti/ndUZHD/AhASeucepyBh40t9Cc X-Received: by 2002:a17:902:c942:b0:13f:d1c:819a with SMTP id i2-20020a170902c94200b0013f0d1c819amr30601461pla.64.1634098381233; Tue, 12 Oct 2021 21:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634098381; cv=none; d=google.com; s=arc-20160816; b=hXSPSIDHMduYRkL7zMXDWGoHbiRsT/CMrB8pPivaSk3B5QqgrOO2MguSbpsttdBiWN se7kukvLS50KTnmT+QsPNCTyZPc/AnZiy8WmizlWTvBhknPxW3TA7bjbnCJTU+/mSwg5 zVoAzx6Y6NJJCyDsyHbwHNyioN+AAil8qWaLW5zPxzj1h9UommWcBZ6F7fwP+R+IeuK4 M8KUgUKvmmJEUZS37xsJPXf2zZ27sQ5kcI7cCsb3H1pGHVBdNB6ylinGBOI17xFMJUtY TVQKNZgXjQ3ZHok0rG/xcTpe+hj8ttERB5M3CFBtiPokllvyGR95mK0U12osl9duNIJK PvEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=veH4x5sZ0wWvTp8mChrhEWWmXKy3+vBBDBajnwyCPHo=; b=UC7W0fJilnIzqn6BQO2S/h0WNcPEU4tXYS+D6NJrwZzEOu/fYFiTTMrix3rJwFDWVs hymQx8w6fv92N7RdVVgIhrUowEXUMshxLjAuEVgqj27r5+W1XbOoOB/YPm1Ik4+tJjUQ f8Rneg80wRiHG5KI7FohYUsmFGaN7V/7/5J3WjoTf3pWx6T29ymCRBzpwyC2/BPhcems yc+OYxKyp2N8q/2ueqCPBuZLmPRARa8VKjOA8sKTTb8UxVNrdJ/l/zIi9nB7lA8sjvzj dZYXKPiuKT7YHpSO5F1bGSJywenTy0f759idYcnydJXmoSzirij9j6P30SZH45J0bI7V QXAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bHujX44T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id pg7si7477411pjb.45.2021.10.12.21.12.48; Tue, 12 Oct 2021 21:13:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bHujX44T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229663AbhJMEMR (ORCPT + 99 others); Wed, 13 Oct 2021 00:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbhJMEMQ (ORCPT ); Wed, 13 Oct 2021 00:12:16 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E062C061570; Tue, 12 Oct 2021 21:10:14 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id y7so1292303pfg.8; Tue, 12 Oct 2021 21:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-disposition:content-transfer-encoding; bh=veH4x5sZ0wWvTp8mChrhEWWmXKy3+vBBDBajnwyCPHo=; b=bHujX44TNM4ZNeM8Us6qSs0RXR591DDGUmWJ7S6H67FtRcZTOPSJQ+rclHDDBmuB30 YRCm1mtc/G4Jd3IBWJ89fXSBim+PMdBuTB9gRcM67hKJrM9sKP1Rn/PAW99zlEwq8vAI iwQqCuqKvpaTE2MkVRFVImAqPIZ69vcafp+H2rjvJvHL8N0c9Ptr/JHSaDt9vI9ds38g hz4ZrHhUI00X4zQFgWEPvHRbxnZZwmtMKitu1JKd1N+9uA5FG/zCdBTdpDpnLG552bhb 9cpaxdRZI1k5G1Mw20R8sIYNW7f/pNmlWN3EOHhxbkvotmReIwOPeXRXaFNCZNrav6lA TEZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-disposition :content-transfer-encoding; bh=veH4x5sZ0wWvTp8mChrhEWWmXKy3+vBBDBajnwyCPHo=; b=aPWJe8Sqt+fuvMkG/QcG5b31wEJKEHQmUIbCtEJB8JeVjODmqJBkOc7zld6lwypu2m T61OOTb/tQhljrfWzaU1+c7K28flRhIY7dkbSFGLsD7xqeFU8sXmmXr/8YKB8NkWcKxc xn6LEPaEeTQGmcTFDJ5OcUP+m4N5nEA8F7TG0ws0iatcrKJ8oGVPAYa8ON68U2arUBDL RKidr7yu5hFlMrTAy5OjvgVBcdUywiIhcBDAn0t7+sqIcsXa8DmmbmxrCQpuvGNJ7QP4 hftadNJdnJZNgsTmbzHXk4jTcIR6ojdx+VkQTrRQKrcwYXggjNaRmAmyykEE3WWSjTZI NlkQ== X-Gm-Message-State: AOAM531GGcj0DlZHwhfRQDzkL2apPWM8BcXZam0612HZniI6rCGnr7fL qM4WbY5GCYjf0IWiDIaLesw= X-Received: by 2002:a63:cf44:: with SMTP id b4mr26338884pgj.215.1634098213803; Tue, 12 Oct 2021 21:10:13 -0700 (PDT) Received: from localhost.localdomain ([171.211.26.24]) by smtp.gmail.com with ESMTPSA id z9sm4231826pji.42.2021.10.12.21.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 21:10:13 -0700 (PDT) From: DENG Qingfang To: Ansuel Smith Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Andy Gross , Bjorn Andersson , Russell King , John Crispin , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [net-next PATCH v6 05/16] net: dsa: qca8k: add support for cpu port 6 Date: Wed, 13 Oct 2021 12:10:04 +0800 Message-Id: <20211013041004.29805-1-dqfext@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211013011622.10537-6-ansuelsmth@gmail.com> References: <20211013011622.10537-1-ansuelsmth@gmail.com> <20211013011622.10537-6-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 03:16:11AM +0200, Ansuel Smith wrote: > @@ -1017,13 +1033,14 @@ static int > qca8k_setup(struct dsa_switch *ds) > { > struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; > + u8 cpu_port; > int ret, i; > u32 mask; > > - /* Make sure that port 0 is the cpu port */ > - if (!dsa_is_cpu_port(ds, 0)) { > - dev_err(priv->dev, "port 0 is not the CPU port"); > - return -EINVAL; > + cpu_port = qca8k_find_cpu_port(ds); > + if (cpu_port < 0) { cpu_port should be of type int, otherwise this is always false. > + dev_err(priv->dev, "No cpu port configured in both cpu port0 and port6"); > + return cpu_port; > }