[PATCH v3 5/5] pwm: dwc: access driver_data using dev_get_drvdata()
From: Raag Jadav
Date: Mon Feb 12 2024 - 08:03:19 EST
Now that we're setting driver_data using dev_set_drvdata(), we can use
dev_get_drvdata() for accessing it.
Signed-off-by: Raag Jadav <raag.jadav@xxxxxxxxx>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/pwm/pwm-dwc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c
index 56fac8655c7b..ed56b796b670 100644
--- a/drivers/pwm/pwm-dwc.c
+++ b/drivers/pwm/pwm-dwc.c
@@ -82,8 +82,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 dwc_pwm *dwc = pci_get_drvdata(pdev);
+ struct dwc_pwm *dwc = dev_get_drvdata(dev);
int i;
for (i = 0; i < DWC_TIMERS_TOTAL; i++) {
@@ -102,8 +101,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 dwc_pwm *dwc = pci_get_drvdata(pdev);
+ struct dwc_pwm *dwc = dev_get_drvdata(dev);
int i;
for (i = 0; i < DWC_TIMERS_TOTAL; i++) {
--
2.35.3