Re: [PATCH 2/2] counter: intel-qep: Use to_pci_dev() helper

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

 



On 6/13/21 1:36 PM, Andy Shevchenko wrote:
On Fri, Jun 11, 2021 at 2:57 PM Jarkko Nikula
<jarkko.nikula@xxxxxxxxxxxxxxx> wrote:

Use to_pci_dev() helper instead of container_of(d, struct pci_dev, dev);

...

-       struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
+       struct pci_dev *pdev = to_pci_dev(dev);
         struct intel_qep *qep = pci_get_drvdata(pdev);

Why not change both lines to dev_get_drvdata()?

I thought it before and Uwe had a good point why it isn't necessarily a good idea:

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