public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uio/uio_pci_generic: remove unneeded pci_set_drvdata()
@ 2020-11-19 14:59 Alexandru Ardelean
  2020-11-20 15:46 ` Greg KH
  2020-11-23 14:34 ` [PATCH v2] " Alexandru Ardelean
  0 siblings, 2 replies; 5+ messages in thread
From: Alexandru Ardelean @ 2020-11-19 14:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: gregkh, Alexandru Ardelean

The pci_get_drvdata() was moved during commit ef84928cff58
("uio/uio_pci_generic: use device-managed function equivalents").

I should have notice that the pci_set_drvdata() requires a
pci_get_drvdata() for it to make sense.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---

Apologies for not noticing this sooner.
If this can be squashed into commit ef84928cff58 , then it's also fine.
I've started seeing that there actually more xxx_set_drvdata() leftovers
in the entire kernel, and I pinged the checkpatch crew to add a check
for this.

https://lore.kernel.org/lkml/CA+U=Dspy5+RE9agcLr6eY9DCMa1c5+++0JLeugMMBRXz4YLj1w@mail.gmail.com/T/#u

 drivers/uio/uio_pci_generic.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/uio/uio_pci_generic.c b/drivers/uio/uio_pci_generic.c
index 1c6c09e1280d..b8e44d16279f 100644
--- a/drivers/uio/uio_pci_generic.c
+++ b/drivers/uio/uio_pci_generic.c
@@ -101,13 +101,7 @@ static int probe(struct pci_dev *pdev,
 			 "no support for interrupts?\n");
 	}
 
-	err = devm_uio_register_device(&pdev->dev, &gdev->info);
-	if (err)
-		return err;
-
-	pci_set_drvdata(pdev, gdev);
-
-	return 0;
+	return devm_uio_register_device(&pdev->dev, &gdev->info);
 }
 
 static struct pci_driver uio_pci_driver = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-24  6:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-19 14:59 [PATCH] uio/uio_pci_generic: remove unneeded pci_set_drvdata() Alexandru Ardelean
2020-11-20 15:46 ` Greg KH
2020-11-21  7:56   ` Ardelean, Alexandru
2020-11-23 14:34 ` [PATCH v2] " Alexandru Ardelean
2020-11-24  6:59   ` Ardelean, Alexandru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox