LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mihai Carabas <mihai.carabas@oracle.com>
To: arnd@arndb.de, gregkh@linuxfoundation.org,
	andriy.shevchenko@linux.intel.com, christophe.jaillet@wanadoo.fr,
	mihai.carabas@oracle.com, linux-kernel@vger.kernel.org
Subject: [PATCH] misc/pvpanic: fix set driver data
Date: Wed, 18 Aug 2021 18:38:30 +0300	[thread overview]
Message-ID: <1629301110-2714-2-git-send-email-mihai.carabas@oracle.com> (raw)
In-Reply-To: <1629301110-2714-1-git-send-email-mihai.carabas@oracle.com>

Add again dev_set_drvdata in order for dev_get_drvdata to not return NULL.

Fixes: 394febc9d0a6 ("misc/pvpanic: Make 'pvpanic_probe()' resource managed")

Signed-off-by: Mihai Carabas <mihai.carabas@oracle.com>
---
 drivers/misc/pvpanic/pvpanic-mmio.c | 2 ++
 drivers/misc/pvpanic/pvpanic-pci.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/misc/pvpanic/pvpanic-mmio.c b/drivers/misc/pvpanic/pvpanic-mmio.c
index be40160..874f94e 100644
--- a/drivers/misc/pvpanic/pvpanic-mmio.c
+++ b/drivers/misc/pvpanic/pvpanic-mmio.c
@@ -104,6 +104,8 @@ static int pvpanic_mmio_probe(struct platform_device *pdev)
 	pi->capability &= ioread8(base);
 	pi->events = pi->capability;
 
+	dev_set_drvdata(dev, pi);
+
 	return devm_pvpanic_probe(dev, pi);
 }
 
diff --git a/drivers/misc/pvpanic/pvpanic-pci.c b/drivers/misc/pvpanic/pvpanic-pci.c
index a43c401..2a26db8 100644
--- a/drivers/misc/pvpanic/pvpanic-pci.c
+++ b/drivers/misc/pvpanic/pvpanic-pci.c
@@ -96,6 +96,8 @@ static int pvpanic_pci_probe(struct pci_dev *pdev,
 	pi->capability &= ioread8(base);
 	pi->events = pi->capability;
 
+	dev_set_drvdata(dev, pi);
+
 	return devm_pvpanic_probe(&pdev->dev, pi);
 }
 
-- 
1.8.3.1


  reply	other threads:[~2021-08-18 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 15:38 [PATCH] misc/pvpanic: fix panic on accessing sysfs entries Mihai Carabas
2021-08-18 15:38 ` Mihai Carabas [this message]
2021-08-18 21:59   ` [PATCH] misc/pvpanic: fix set driver data kernel test robot
2021-08-19 12:30   ` Andy Shevchenko

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=1629301110-2714-2-git-send-email-mihai.carabas@oracle.com \
    --to=mihai.carabas@oracle.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] misc/pvpanic: fix set driver data' \
    /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

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).