From: "Krzysztof Wilczyński" <kw@linux.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Zhang Zekun <zhangzekun11@huawei.com>,
songxiaowei@hisilicon.com, wangbinghui@hisilicon.com,
lpieralisi@kernel.org, robh@kernel.org, bhelgaas@google.com,
linux-pci@vger.kernel.org, ryder.lee@mediatek.com,
jianjun.wang@mediatek.com, sergio.paracuellos@gmail.com,
angelogioacchino.delregno@collabora.com, matthias.bgg@gmail.com,
alyssa@rosenzweig.io, maz@kernel.org, thierry.reding@gmail.com,
Jonathan.Cameron@huawei.com
Subject: Re: [PATCH v3 2/6] PCI: kirin: Tidy up _probe() related function with dev_err_probe()
Date: Wed, 5 Mar 2025 20:24:45 +0900 [thread overview]
Message-ID: <20250305112445.GF847772@rocinante> (raw)
In-Reply-To: <20250305055431.ugiwvydrdw4rszte@thinkpad>
Hello,
[...]
> > usleep_range(PIPE_CLK_WAIT_MIN, PIPE_CLK_WAIT_MAX);
> > reg_val = kirin_apb_phy_readl(phy, PCIE_APB_PHY_STATUS0);
> > - if (reg_val & PIPE_CLK_STABLE) {
> > - dev_err(dev, "PIPE clk is not stable\n");
> > - return -EINVAL;
> > - }
> > + if (reg_val & PIPE_CLK_STABLE)
> > + return dev_err_probe(dev, -EINVAL,
> > + "PIPE clk is not stable\n");
>
> I guess this is a timeout issue, so -ETIMEDOUT.
I can update this directly on the branch.
[...]
> > - if (!dev->of_node) {
> > - dev_err(dev, "NULL node\n");
> > - return -EINVAL;
> > - }
> > + if (!dev->of_node)
> > + return dev_err_probe(dev, -EINVAL, "NULL node\n");
>
> This check is pointless, so you should drop it.
Some other drivers are also doing this, I suppose, as a precaution.
> > data = of_device_get_match_data(dev);
> > - if (!data) {
> > - dev_err(dev, "OF data missing\n");
> > - return -EINVAL;
> > - }
> > + if (!data)
> > + return dev_err_probe(dev, -EINVAL, "OF data missing\n");
>
> -ENODATA
Almost all of the other drivers return -EINVAL in this case.
We can update this here, but I wonder if a follow-up patch to update other
drivers accordingly where it makes sense of course, would be better here?
Thoughts?
Krzysztof
next prev parent reply other threads:[~2025-03-05 11:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-31 4:04 [PATCH v3 0/6] Simplify code with _scoped() helper functions Zhang Zekun
2024-08-31 4:04 ` [PATCH v3 1/6] PCI: kirin: Use helper function for_each_available_child_of_node_scoped() Zhang Zekun
2025-03-05 5:49 ` Manivannan Sadhasivam
2024-08-31 4:04 ` [PATCH v3 2/6] PCI: kirin: Tidy up _probe() related function with dev_err_probe() Zhang Zekun
2025-03-05 5:54 ` Manivannan Sadhasivam
2025-03-05 11:24 ` Krzysztof Wilczyński [this message]
2025-03-06 9:45 ` Krzysztof Wilczyński
2024-08-31 4:04 ` [PATCH v3 3/6] PCI: mediatek: Use helper function for_each_available_child_of_node_scoped() Zhang Zekun
2025-03-05 5:55 ` Manivannan Sadhasivam
2024-08-31 4:04 ` [PATCH v3 4/6] PCI: mt7621: " Zhang Zekun
2025-03-05 5:56 ` Manivannan Sadhasivam
2024-08-31 4:04 ` [PATCH v3 5/6] PCI: apple: Use helper function for_each_child_of_node_scoped() Zhang Zekun
2025-03-05 5:57 ` Manivannan Sadhasivam
2024-08-31 4:04 ` [PATCH v3 6/6] PCI: tegra: " Zhang Zekun
2025-03-05 5:59 ` Manivannan Sadhasivam
2025-03-02 18:32 ` [PATCH v3 0/6] Simplify code with _scoped() helper functions Krzysztof Wilczyński
2025-03-05 11:25 ` Krzysztof Wilczyński
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=20250305112445.GF847772@rocinante \
--to=kw@linux.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alyssa@rosenzweig.io \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bhelgaas@google.com \
--cc=jianjun.wang@mediatek.com \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=matthias.bgg@gmail.com \
--cc=maz@kernel.org \
--cc=robh@kernel.org \
--cc=ryder.lee@mediatek.com \
--cc=sergio.paracuellos@gmail.com \
--cc=songxiaowei@hisilicon.com \
--cc=thierry.reding@gmail.com \
--cc=wangbinghui@hisilicon.com \
--cc=zhangzekun11@huawei.com \
/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