Re: [PATCH v4] counter: Add support for Intel Quadrature Encoder Peripheral

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/3/21 7:12 PM, Jonathan Cameron wrote:
On Wed,  2 Jun 2021 14:32:59 +0300
Jarkko Nikula <jarkko.nikula@xxxxxxxxxxxxxxx> wrote:
+static int intel_qep_suspend(struct device *dev)
+{
+	struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);

to_pci_dev()
Though if all you are doing is using it to then get the drvdata
avoid the round trip.  There have been a few patch sets tidying this up
in recent years and good not to add the noise of having that happen here.

struct intel_qep *qep = dev_get_drvdata(dev);

Now I remember, I got this dev_get_drvdata() idea here earlier but implemented it first to another driver and Uwe had a good point about kind of layer violation of relying dev_get_drvdata() to return what pci_set_drvdata() set:

https://www.spinics.net/lists/linux-pwm/msg15325.html

Jarkko



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux