[PATCH v1 3/3] pwm: dwc: use to_pci_dev() helper

From: Raag Jadav
Date: Sun Jan 21 2024 - 22:03:42 EST


Use to_pci_dev() helper to get pci device reference.

Signed-off-by: Raag Jadav <raag.jadav@xxxxxxxxx>
---
drivers/pwm/pwm-dwc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c
index 8f8035b047c1..f5fcea4e69e2 100644
--- a/drivers/pwm/pwm-dwc.c
+++ b/drivers/pwm/pwm-dwc.c
@@ -100,7 +100,7 @@ static void dwc_pwm_remove(struct pci_dev *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;

--
2.35.3