public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: "Verma, Vishal L" <vishal.l.verma@intel.com>
Cc: "Jiang, Dave" <dave.jiang@intel.com>,
	"Schofield, Alison" <alison.schofield@intel.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"Weight, Russell H" <russell.h.weight@intel.com>,
	"bwidawsk@kernel.org" <bwidawsk@kernel.org>,
	"Weiny, Ira" <ira.weiny@intel.com>,
	"dave@stgolabs.net" <dave@stgolabs.net>
Subject: Re: [PATCH v2 1/4] cxl: add a firmware update mechanism using the sysfs firmware loader
Date: Fri, 9 Jun 2023 12:08:52 +0100	[thread overview]
Message-ID: <20230609120852.00003c6c@Huawei.com> (raw)
In-Reply-To: <298ed811de7148da70609ac2c6ef81f025690620.camel@intel.com>

On Thu, 8 Jun 2023 20:26:43 +0000
"Verma, Vishal L" <vishal.l.verma@intel.com> wrote:

> On Thu, 2023-06-08 at 20:15 +0000, Verma, Vishal L wrote:
> >   
> > > > +
> > > > +       fwl = firmware_upload_register(THIS_MODULE, &cxlmd->dev,
> > > > +                                      dev_name(&cxlmd->dev),
> > > > +                                      &cxl_memdev_fw_ops, cxlds);
> > > > +       if (IS_ERR(fwl)) {
> > > > +               dev_err(&cxlmd->dev, "Failed to register firmware loader\n");
> > > > +               return PTR_ERR(fwl);  
> > > 
> > > It's called from probe only so could use dev_err_probe() for slight
> > > simplification.  
> > 
> > From what I can tell, this ends up looking like:
> > 
> >         fwl = firmware_upload_register(THIS_MODULE, dev, dev_name(dev),
> >                                        &cxl_memdev_fw_ops, cxlds);
> >         rc = dev_err_probe(dev, PTR_ERR(fwl),
> >                            "Failed to register firmware loader\n");
> >         if (rc)
> >                 return rc;
> > 
> > Is that what you meant? Happy to make the change if so.
> > 
> >   
> Actually I can't drop the IS_ERR() check - so unless I'm missing
> something, this doesn't look like much of a simplification:
> 
> 
> 	if (IS_ERR(fwl)) {
> 		rc = dev_err_probe(dev, PTR_ERR(fwl),
> 				   "Failed to register firmware loader\n");
> 		if (rc)
> 			return rc;
> 	}
> 

Ah. I replied to previous. It's simpler than that as you know rc != 0 as
it's IS_ERR(fwl)

dev_err_probe() does two helpful things over dev_err()
1. Handles stashing the debug messages for the deferred probe cases (not
   relevant here but harmless)
2. Returns the variable you pass in as second argument to allow
   return dev_err_probe()


Jonathan

  reply	other threads:[~2023-06-09 11:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 20:20 [PATCH v2 0/4] cxl: Add a firmware update mechanism and cxl_test emulation Vishal Verma
2023-06-05 20:20 ` [PATCH v2 1/4] cxl: add a firmware update mechanism using the sysfs firmware loader Vishal Verma
2023-06-08 14:49   ` Jonathan Cameron
2023-06-08 20:15     ` Verma, Vishal L
2023-06-08 20:26       ` Verma, Vishal L
2023-06-09 11:08         ` Jonathan Cameron [this message]
2023-06-09 11:06       ` Jonathan Cameron
2023-06-05 20:20 ` [PATCH v2 2/4] tools/testing/cxl: Fix command effects for inject/clear poison Vishal Verma
2023-06-07 19:18   ` Alison Schofield
2023-06-08 11:01     ` Jonathan Cameron
2023-06-05 20:20 ` [PATCH v2 3/4] tools/testing/cxl: Use named effects for the Command Effect Log Vishal Verma
2023-06-07 19:19   ` Alison Schofield
2023-06-08 13:31   ` Jonathan Cameron
2023-06-05 20:20 ` [PATCH v2 4/4] tools/testing/cxl: add firmware update emulation to CXL memdevs Vishal Verma
2023-06-08 14:54   ` Jonathan Cameron

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=20230609120852.00003c6c@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alison.schofield@intel.com \
    --cc=bwidawsk@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=russell.h.weight@intel.com \
    --cc=vishal.l.verma@intel.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