public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: u.kleine-koenig@pengutronix.de, jarkko.nikula@linux.intel.com,
	mika.westerberg@linux.intel.com,
	andriy.shevchenko@linux.intel.com, lakshmi.sowjanya.d@intel.com
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Raag Jadav <raag.jadav@intel.com>
Subject: [PATCH v2 4/5] pwm: dwc: access driver_data using dev_get_drvdata()
Date: Thu,  8 Feb 2024 12:35:28 +0530	[thread overview]
Message-ID: <20240208070529.28562-5-raag.jadav@intel.com> (raw)
In-Reply-To: <20240208070529.28562-1-raag.jadav@intel.com>

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@intel.com>
---
 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 e1e3c62ecc56..cc5bba977f47 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


  parent reply	other threads:[~2024-02-08  7:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08  7:05 [PATCH v2 0/5] DesignWare PWM improvements Raag Jadav
2024-02-08  7:05 ` [PATCH v2 1/5] pwm: dwc: drop redundant error check Raag Jadav
2024-02-08  7:46   ` Uwe Kleine-König
2024-02-08 17:04     ` Andy Shevchenko
2024-02-08 17:06       ` Andy Shevchenko
2024-02-14 17:45       ` Uwe Kleine-König
2024-02-14 17:54         ` Andy Shevchenko
2024-02-15  9:22           ` Uwe Kleine-König
2024-02-15 13:36             ` Andy Shevchenko
2024-02-15 17:20               ` Uwe Kleine-König
2024-02-15 19:25                 ` Andy Shevchenko
2024-02-08  7:05 ` [PATCH v2 2/5] pwm: dwc: Add 16 channel support for Intel Elkhart Lake Raag Jadav
2024-02-08 17:20   ` Andy Shevchenko
2024-02-09 19:18     ` Raag Jadav
2024-02-09 19:41       ` Andy Shevchenko
2024-02-10 17:19         ` Uwe Kleine-König
2024-02-12 11:53           ` Andy Shevchenko
2024-02-08  7:05 ` [PATCH v2 3/5] pwm: dwc: simplify error handling Raag Jadav
2024-02-08 17:22   ` Andy Shevchenko
2024-02-09 20:33     ` Raag Jadav
2024-02-12 11:52       ` Andy Shevchenko
2024-02-08  7:05 ` Raag Jadav [this message]
2024-02-08  7:05 ` [PATCH v2 5/5] pwm: dwc: use pm_sleep_ptr() macro Raag Jadav
2024-02-08 17:22   ` Andy Shevchenko
2024-02-15 11:22     ` Uwe Kleine-König
2024-02-08 17:23 ` [PATCH v2 0/5] DesignWare PWM improvements Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240208070529.28562-5-raag.jadav@intel.com \
    --to=raag.jadav@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=lakshmi.sowjanya.d@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox