diff options
| author | Raag Jadav <[email protected]> | 2024-02-08 07:05:28 +0000 |
|---|---|---|
| committer | Uwe Kleine-König <[email protected]> | 2024-02-15 11:29:20 +0000 |
| commit | 3ee35fd12b018e15ed540c921ce0bbb6254f4c2a (patch) | |
| tree | f9c4349077a3fcda19087de0353166e90809b6ce /drivers/pwm/pwm-dwc.c | |
| parent | dt-bindings: atmel,hlcdc: convert pwm bindings to json-schema (diff) | |
| download | kernel-3ee35fd12b018e15ed540c921ce0bbb6254f4c2a.tar.gz kernel-3ee35fd12b018e15ed540c921ce0bbb6254f4c2a.zip | |
pwm: dwc: access driver_data using dev_get_drvdata()
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 <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
Diffstat (limited to 'drivers/pwm/pwm-dwc.c')
| -rw-r--r-- | drivers/pwm/pwm-dwc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c index a4a057ae03ea..9a1b156ead26 100644 --- a/drivers/pwm/pwm-dwc.c +++ b/drivers/pwm/pwm-dwc.c @@ -73,8 +73,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++) { @@ -93,8 +92,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++) { |
