From: Simon Horman <horms@kernel.org>
To: Marek Vasut <marex@denx.de>
Cc: linux-wireless@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
"Adham Abozaeid" <adham.abozaeid@microchip.com>,
"Ajay Singh" <ajay.kathat@microchip.com>,
"Alexis Lothoré" <alexis.lothore@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Conor Dooley" <conor+dt@kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Kalle Valo" <kvalo@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Rob Herring" <robh@kernel.org>,
devicetree@vger.kernel.org, netdev@vger.kernel.org,
"Dan Carpenter" <dan.carpenter@linaro.org>
Subject: Re: [PATCH v2 2/4] wifi: wilc1000: Fold wilc_get_chipid() into wlan.c
Date: Sat, 24 Aug 2024 13:44:30 +0100 [thread overview]
Message-ID: <20240824124430.GI2164@kernel.org> (raw)
In-Reply-To: <006098a3-efb5-4bf3-a28c-20702597feaa@denx.de>
+ Dan
On Fri, Aug 23, 2024 at 10:38:59PM +0200, Marek Vasut wrote:
> On 8/23/24 7:46 PM, Simon Horman wrote:
> > On Fri, Aug 23, 2024 at 06:08:57PM +0200, Marek Vasut wrote:
> > > Do not use wilc_get_chipid() outside of wlan.c . Instead, call
> > > wilc_get_chipid() right after the SDIO/SPI interface has been
> > > initialized to cache the device chipid, and then use the cached
> > > chipid throughout the driver. Make wilc_get_chipid() static and
> > > remove its prototype from wlan.h .
> > >
> > > Signed-off-by: Marek Vasut <marex@denx.de>
> >
> > ...
> >
> > > diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
> >
> > ...
> >
> > > @@ -1535,9 +1537,18 @@ int wilc_wlan_init(struct net_device *dev)
> > > if (!wilc->hif_func->hif_is_init(wilc)) {
> > > acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY);
> > > ret = wilc->hif_func->hif_init(wilc, false);
> > > + if (!ret)
> > > + chipid = wilc_get_chipid(wilc);
> > > release_bus(wilc, WILC_BUS_RELEASE_ONLY);
> > > if (ret)
> > > goto fail;
> > > +
> > > + if (!is_wilc1000(chipid)) {
> > > + netdev_err(dev, "Unsupported chipid: %x\n", chipid);
> > > + return -EINVAL;
> >
> > Hi Marek,
> >
> > Should this unwind as is the case elsewhere in this function?
>
> It should, will fix in V3, thanks.
>
> > ret = -EINVAL;
> > goto fail;
> >
> > Flagged by Smatch.
>
> What's the trick here ?
Smatch is here. I don't think there is much of a trick other than running it :)
https://github.com/error27/smatch
next prev parent reply other threads:[~2024-08-24 12:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 16:08 [PATCH v2 1/4] dt-bindings: wireless: wilc1000: Document WILC3000 compatible string Marek Vasut
2024-08-23 16:08 ` [PATCH v2 2/4] wifi: wilc1000: Fold wilc_get_chipid() into wlan.c Marek Vasut
2024-08-23 17:46 ` Simon Horman
2024-08-23 20:38 ` Marek Vasut
2024-08-24 12:44 ` Simon Horman [this message]
2024-08-24 21:18 ` Marek Vasut
2024-08-27 7:51 ` Alexis Lothoré
2024-08-27 15:34 ` Marek Vasut
2024-08-28 7:48 ` Alexis Lothoré
2024-08-23 16:08 ` [PATCH v2 3/4] wifi: wilc1000: Fold chip_allow_sleep()/chip_wakeup() " Marek Vasut
2024-08-27 8:14 ` Alexis Lothoré
2024-08-27 16:23 ` Marek Vasut
2024-08-23 16:08 ` [PATCH v2 4/4] wifi: wilc1000: Add WILC3000 support Marek Vasut
2024-08-27 8:28 ` Alexis Lothoré
2024-08-27 16:31 ` Marek Vasut
2024-08-24 6:22 ` [PATCH v2 1/4] dt-bindings: wireless: wilc1000: Document WILC3000 compatible string Krzysztof Kozlowski
2024-08-24 21:21 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240824124430.GI2164@kernel.org \
--to=horms@kernel.org \
--cc=adham.abozaeid@microchip.com \
--cc=ajay.kathat@microchip.com \
--cc=alexis.lothore@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=conor+dt@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).