[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231006150810.09e2c1a9@kernel.org>
Date: Fri, 6 Oct 2023 15:08:10 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Herve Codina <herve.codina@...tlin.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Andrew Lunn
<andrew@...n.ch>, Rob Herring <robh+dt@...nel.org>, Krzysztof Kozlowski
<krzysztof.kozlowski+dt@...aro.org>, Conor Dooley <conor+dt@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>, Qiang Zhao <qiang.zhao@....com>,
Li Yang <leoyang.li@....com>, Liam Girdwood <lgirdwood@...il.com>, Mark
Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai
<tiwai@...e.com>, Shengjiu Wang <shengjiu.wang@...il.com>, Xiubo Li
<Xiubo.Lee@...il.com>, Fabio Estevam <festevam@...il.com>, Nicolin Chen
<nicoleotsuka@...il.com>, Christophe Leroy <christophe.leroy@...roup.eu>,
Randy Dunlap <rdunlap@...radead.org>, netdev@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, alsa-devel@...a-project.org, Simon
Horman <horms@...nel.org>, Christophe JAILLET
<christophe.jaillet@...adoo.fr>, Thomas Petazzoni
<thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v7 24/30] net: wan: Add framer framework support
On Thu, 28 Sep 2023 09:06:42 +0200 Herve Codina wrote:
> +menu "Framer Subsystem"
> +
> +config GENERIC_FRAMER
> + bool "Framer Core"
> + help
> + Generic Framer support.
> + A framer is a component in charge of an E1/T1 line interface.
> + Connected usually to a TDM bus, it converts TDM frames to/from E1/T1
> + frames. It also provides information related to the E1/T1 line.
> + Used with HDLC, the network can be reached through the E1/T1 line.
> +
> + This framework is designed to provide a generic interface for framer
> + devices present in the kernel. This layer will have the generic
> + API by which framer drivers can create framer using the framer
> + framework and framer users can obtain reference to the framer.
> + All the users of this framework should select this config.
maybe make the menu a menuconfig with info about framers but hide
the GENERIC_FRAMER symbol? The driver 'select' it anyway, what's
the point of prompting the user..
> + if (WARN_ON(!dev))
> + return ERR_PTR(-EINVAL);
no defensive programming, let the kernel crash
> + ret = framer_pm_runtime_get_sync(framer);
> + if (ret < 0 && ret != -EOPNOTSUPP)
> + goto err_pm_sync;
> +
> + ret = 0; /* Override possible ret == -EOPNOTSUPP */
This looks pointless given that ret is either overwritten or not used
later on
> + mutex_lock(&framer->mutex);
> + if (framer->power_count == 0 && framer->ops->power_on) {
> + ret = framer->ops->power_on(framer);
> + if (ret < 0) {
> + dev_err(&framer->dev, "framer poweron failed --> %d\n", ret);
> + goto err_pwr_on;
> + }
> + }
> + ++framer->power_count;
> + mutex_unlock(&framer->mutex);
> + return 0;
Powered by blists - more mailing lists