From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mihai Carabas <mihai.carabas@oracle.com>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org,
christophe.jaillet@wanadoo.fr, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] misc/pvpanic: fix set driver data
Date: Thu, 19 Aug 2021 18:47:22 +0300 [thread overview]
Message-ID: <YR59CnAXhzECKF3s@smile.fi.intel.com> (raw)
In-Reply-To: <1629380481-4363-2-git-send-email-mihai.carabas@oracle.com>
On Thu, Aug 19, 2021 at 04:41:21PM +0300, Mihai Carabas wrote:
> Add again dev_set_drvdata(), but this time in devm_pvpanic_probe(), in order
> for dev_get_drvdata() to not return NULL.
Thanks, almost good, after addressing below feel free to add
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Fixes: 394febc9d0a6 ("misc/pvpanic: Make 'pvpanic_probe()' resource managed")
> Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
> ---
> drivers/misc/pvpanic/pvpanic.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c
> index 02b807c..6ce48ce 100644
> --- a/drivers/misc/pvpanic/pvpanic.c
> +++ b/drivers/misc/pvpanic/pvpanic.c
> @@ -81,6 +81,8 @@ int devm_pvpanic_probe(struct device *dev, struct pvpanic_instance *pi)
> if (!pi || !pi->base)
> return -EINVAL;
> + dev_set_drvdata(dev, pi);
I believe this should be last (or close enough) operation in the function for
the sake of logical flow.
> spin_lock(&pvpanic_lock);
> list_add(&pi->list, &pvpanic_list);
> spin_unlock(&pvpanic_lock);
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2021-08-19 15:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 13:41 [PATCH v2] misc/pvpanic: fix set driver data Mihai Carabas
2021-08-19 13:41 ` Mihai Carabas
2021-08-19 15:47 ` Andy Shevchenko [this message]
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=YR59CnAXhzECKF3s@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mihai.carabas@oracle.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