lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [net-next PATCH v6 05/16] net: dsa: qca8k: add support for cpu port 6
Date
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;
> }

\
 
 \ /
  Last update: 2021-10-13 06:11    [W:0.051 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site