Re: [PATCH 2/2] PCI: endpoint: Improve error messages

From: Manivannan Sadhasivam

Date: Thu Mar 26 2026 - 13:16:39 EST


On Fri, Mar 06, 2026 at 05:25:49PM +0530, ALOK TIWARI wrote:
>
>
> On 3/5/2026 12:42 PM, Manivannan Sadhasivam wrote:
> > From: Manivannan Sadhasivam<manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
> >
> > Include errno in the error prints and also use dev_err() where applicable.
> >
> > Signed-off-by: Manivannan Sadhasivam<manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/pci/endpoint/pci-ep-cfs.c | 15 ++++++++++-----
> > 1 file changed, 10 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
> > index a19db22b7991..2d2efd444b02 100644
> > --- a/drivers/pci/endpoint/pci-ep-cfs.c
> > +++ b/drivers/pci/endpoint/pci-ep-cfs.c
> > @@ -565,7 +565,8 @@ static void pci_ep_cfs_add_type_group(struct pci_epf_group *epf_group)
> > if (IS_ERR(group)) {
> > dev_err(&epf_group->epf->dev,
> > - "failed to create epf type specific attributes\n");
> > + "failed to create epf type specific attributes: %d\n",
> > + (int)PTR_ERR(group));
> > return;
> > }
> > @@ -578,13 +579,17 @@ static void pci_epf_cfs_add_sub_groups(struct pci_epf_group *epf_group)
> > group = pci_ep_cfs_add_primary_group(epf_group);
> > if (IS_ERR(group)) {
> > - pr_err("failed to create 'primary' EPC interface\n");
> > + dev_err(&epf_group->epf->dev,
> > + "failed to create 'primary' EPC interface: %d\n",
> > + (int)PTR_ERR(group));
>
> using (int) not wrong but it is a bit unusual, in this case can we use "%pe"
> instead ?
> "failed to create 'primary' EPC interface: %pe\n", group)
>

Agree. Amended this change while applying, thanks!

- Mani

--
மணிவண்ணன் சதாசிவம்