diff mbox series

[1/7] pwm: change &pci->dev to dev in probe

Message ID 20220712100113.569042-2-ben.dooks@sifive.com
State Superseded
Headers show
Series [1/7] pwm: change &pci->dev to dev in probe | expand

Commit Message

Ben Dooks July 12, 2022, 10:01 a.m. UTC
The dwc_pwm_probe() assignes dev to be &pci->dev but then uses
&pci->dev throughout the function. Change these all to the be
'dev' variable to make lines shorter.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
---
 drivers/pwm/pwm-dwc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Uwe Kleine-König July 13, 2022, 8:16 a.m. UTC | #1
On Tue, Jul 12, 2022 at 11:01:07AM +0100, Ben Dooks wrote:
> The dwc_pwm_probe() assignes dev to be &pci->dev but then uses
> &pci->dev throughout the function. Change these all to the be
> 'dev' variable to make lines shorter.

Looks reasonable.

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Ben Dooks July 13, 2022, 10:54 a.m. UTC | #2
On 13/07/2022 09:16, Uwe Kleine-König wrote:
> On Tue, Jul 12, 2022 at 11:01:07AM +0100, Ben Dooks wrote:
>> The dwc_pwm_probe() assignes dev to be &pci->dev but then uses
>> &pci->dev throughout the function. Change these all to the be
>> 'dev' variable to make lines shorter.
> 
> Looks reasonable.
> 
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks for the reviews, I'll get a new series out tomorrow.

I might avoid the last patch about number of pwms for now
and just get the basic driver updates sorted.
Ben Dooks July 18, 2022, 7:19 a.m. UTC | #3
On 13/07/2022 09:16, Uwe Kleine-König wrote:
> On Tue, Jul 12, 2022 at 11:01:07AM +0100, Ben Dooks wrote:
>> The dwc_pwm_probe() assignes dev to be &pci->dev but then uses
>> &pci->dev throughout the function. Change these all to the be
>> 'dev' variable to make lines shorter.
> 
> Looks reasonable.
> 
> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ack for 1/7 or the series?
I'll repost v2 this week once we've dealt with polarity.

>
Uwe Kleine-König July 18, 2022, 7:49 a.m. UTC | #4
On Mon, Jul 18, 2022 at 08:19:16AM +0100, Ben Dooks wrote:
> On 13/07/2022 09:16, Uwe Kleine-König wrote:
> > On Tue, Jul 12, 2022 at 11:01:07AM +0100, Ben Dooks wrote:
> > > The dwc_pwm_probe() assignes dev to be &pci->dev but then uses
> > > &pci->dev throughout the function. Change these all to the be
> > > 'dev' variable to make lines shorter.
> > 
> > Looks reasonable.
> > 
> > Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> ack for 1/7 or the series?

The former. For the other patches I assume they will change in v2.

Best regards
Uwe
Uwe Kleine-König July 18, 2022, 7:54 a.m. UTC | #5
Hello,

On Mon, Jul 18, 2022 at 09:49:54AM +0200, Uwe Kleine-König wrote:
> On Mon, Jul 18, 2022 at 08:19:16AM +0100, Ben Dooks wrote:
> > On 13/07/2022 09:16, Uwe Kleine-König wrote:
> > > On Tue, Jul 12, 2022 at 11:01:07AM +0100, Ben Dooks wrote:
> > > > The dwc_pwm_probe() assignes dev to be &pci->dev but then uses
> > > > &pci->dev throughout the function. Change these all to the be
> > > > 'dev' variable to make lines shorter.
> > > 
> > > Looks reasonable.
> > > 
> > > Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > 
> > ack for 1/7 or the series?
> 
> The former. For the other patches I assume they will change in v2.

Oh well, and 2/7 is so obviously a preparation patch that I'll wait to
see v2 for that one, too.

Best regards
Uwe
diff mbox series

Patch

diff --git a/drivers/pwm/pwm-dwc.c b/drivers/pwm/pwm-dwc.c
index 7568300bb11e..c706ef9a7ba1 100644
--- a/drivers/pwm/pwm-dwc.c
+++ b/drivers/pwm/pwm-dwc.c
@@ -202,14 +202,13 @@  static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id)
 	struct dwc_pwm *dwc;
 	int ret;
 
-	dwc = devm_kzalloc(&pci->dev, sizeof(*dwc), GFP_KERNEL);
+	dwc = devm_kzalloc(dev, sizeof(*dwc), GFP_KERNEL);
 	if (!dwc)
 		return -ENOMEM;
 
 	ret = pcim_enable_device(pci);
 	if (ret) {
-		dev_err(&pci->dev,
-			"Failed to enable device (%pe)\n", ERR_PTR(ret));
+		dev_err(dev, "Failed to enable device (%pe)\n", ERR_PTR(ret));
 		return ret;
 	}
 
@@ -217,14 +216,13 @@  static int dwc_pwm_probe(struct pci_dev *pci, const struct pci_device_id *id)
 
 	ret = pcim_iomap_regions(pci, BIT(0), pci_name(pci));
 	if (ret) {
-		dev_err(&pci->dev,
-			"Failed to iomap PCI BAR (%pe)\n", ERR_PTR(ret));
+		dev_err(dev, "Failed to iomap PCI BAR (%pe)\n", ERR_PTR(ret));
 		return ret;
 	}
 
 	dwc->base = pcim_iomap_table(pci)[0];
 	if (!dwc->base) {
-		dev_err(&pci->dev, "Base address missing\n");
+		dev_err(dev, "Base address missing\n");
 		return -ENOMEM;
 	}