[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbZo2A3qU9RIz568@smile.fi.intel.com>
Date: Sun, 28 Jan 2024 16:46:48 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Raag Jadav <raag.jadav@...el.com>
Cc: u.kleine-koenig@...gutronix.de, jarkko.nikula@...ux.intel.com,
mika.westerberg@...ux.intel.com, lakshmi.sowjanya.d@...el.com,
linux-pwm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 3/3] pwm: dwc: use to_pci_dev() helper
On Mon, Jan 22, 2024 at 08:32:38AM +0530, Raag Jadav wrote:
> Use to_pci_dev() helper to get pci device reference.
PCI
..
> static int dwc_pwm_suspend(struct device *dev)
> {
> - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
> + struct pci_dev *pdev = to_pci_dev(dev);
> struct dwc_pwm *dwc = pci_get_drvdata(pdev);
> int i;
>
> @@ -120,7 +120,7 @@ static int dwc_pwm_suspend(struct device *dev)
>
> static int dwc_pwm_resume(struct device *dev)
> {
> - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
> + struct pci_dev *pdev = to_pci_dev(dev);
> struct dwc_pwm *dwc = pci_get_drvdata(pdev);
> int i;
I don't see how pdev is being used. That said, why dev_get_drvdata() is not
suffice?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists