Skip to content

Commit

Permalink
pwm: dwc: Change &pci->dev to dev in probe
Browse files Browse the repository at this point in the history
The dwc_pwm_probe() assigns dev to be &pci->dev but then uses &pci->dev
throughout the function. Change these all to the 'dev' variable to make
lines shorter.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Ben Dooks authored and Thierry Reding committed Feb 20, 2023
1 parent 0f03bf3 commit f7c843d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/pwm/pwm-dwc.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,29 +204,27 @@ 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;
}

pci_set_master(pci);

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;
}

Expand Down

0 comments on commit f7c843d

Please sign in to comment.