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