diff options
| author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2019-02-11 05:36:56 -0500 |
|---|---|---|
| committer | Sekhar Nori <nsekhar@ti.com> | 2019-02-12 02:58:40 -0500 |
| commit | 3d2ab9f35ebda97de7392716022a4ed8ab646861 (patch) | |
| tree | cb40a40292b3c885a9003840248cc4f91371638a | |
| parent | 08e46f18b7d04ce4892c7542e89c2de4ae359987 (diff) | |
usb: ohci-da8xx: add a helper pointer to &pdev->dev
Add a helper pointer to &pdev->dev. This improves readability by
removing all the &pdev->dev dereferencing.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
| -rw-r--r-- | drivers/usb/host/ohci-da8xx.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index c492c7e6f746..e8ede0b5e3f0 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c | |||
| @@ -402,35 +402,35 @@ MODULE_DEVICE_TABLE(of, da8xx_ohci_ids); | |||
| 402 | static int ohci_da8xx_probe(struct platform_device *pdev) | 402 | static int ohci_da8xx_probe(struct platform_device *pdev) |
| 403 | { | 403 | { |
| 404 | struct da8xx_ohci_hcd *da8xx_ohci; | 404 | struct da8xx_ohci_hcd *da8xx_ohci; |
| 405 | struct device *dev = &pdev->dev; | ||
| 405 | struct usb_hcd *hcd; | 406 | struct usb_hcd *hcd; |
| 406 | struct resource *mem; | 407 | struct resource *mem; |
| 407 | int error, irq; | 408 | int error, irq; |
| 408 | 409 | ||
| 409 | hcd = usb_create_hcd(&ohci_da8xx_hc_driver, &pdev->dev, | 410 | hcd = usb_create_hcd(&ohci_da8xx_hc_driver, dev, dev_name(dev)); |
| 410 | dev_name(&pdev->dev)); | ||
| 411 | if (!hcd) | 411 | if (!hcd) |
| 412 | return -ENOMEM; | 412 | return -ENOMEM; |
| 413 | 413 | ||
| 414 | da8xx_ohci = to_da8xx_ohci(hcd); | 414 | da8xx_ohci = to_da8xx_ohci(hcd); |
| 415 | da8xx_ohci->hcd = hcd; | 415 | da8xx_ohci->hcd = hcd; |
| 416 | 416 | ||
| 417 | da8xx_ohci->usb11_clk = devm_clk_get(&pdev->dev, NULL); | 417 | da8xx_ohci->usb11_clk = devm_clk_get(dev, NULL); |
| 418 | if (IS_ERR(da8xx_ohci->usb11_clk)) { | 418 | if (IS_ERR(da8xx_ohci->usb11_clk)) { |
| 419 | error = PTR_ERR(da8xx_ohci->usb11_clk); | 419 | error = PTR_ERR(da8xx_ohci->usb11_clk); |
| 420 | if (error != -EPROBE_DEFER) | 420 | if (error != -EPROBE_DEFER) |
| 421 | dev_err(&pdev->dev, "Failed to get clock.\n"); | 421 | dev_err(dev, "Failed to get clock.\n"); |
| 422 | goto err; | 422 | goto err; |
| 423 | } | 423 | } |
| 424 | 424 | ||
| 425 | da8xx_ohci->usb11_phy = devm_phy_get(&pdev->dev, "usb-phy"); | 425 | da8xx_ohci->usb11_phy = devm_phy_get(dev, "usb-phy"); |
| 426 | if (IS_ERR(da8xx_ohci->usb11_phy)) { | 426 | if (IS_ERR(da8xx_ohci->usb11_phy)) { |
| 427 | error = PTR_ERR(da8xx_ohci->usb11_phy); | 427 | error = PTR_ERR(da8xx_ohci->usb11_phy); |
| 428 | if (error != -EPROBE_DEFER) | 428 | if (error != -EPROBE_DEFER) |
| 429 | dev_err(&pdev->dev, "Failed to get phy.\n"); | 429 | dev_err(dev, "Failed to get phy.\n"); |
| 430 | goto err; | 430 | goto err; |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | da8xx_ohci->vbus_reg = devm_regulator_get_optional(&pdev->dev, "vbus"); | 433 | da8xx_ohci->vbus_reg = devm_regulator_get_optional(dev, "vbus"); |
| 434 | if (IS_ERR(da8xx_ohci->vbus_reg)) { | 434 | if (IS_ERR(da8xx_ohci->vbus_reg)) { |
| 435 | error = PTR_ERR(da8xx_ohci->vbus_reg); | 435 | error = PTR_ERR(da8xx_ohci->vbus_reg); |
| 436 | if (error == -ENODEV) { | 436 | if (error == -ENODEV) { |
| @@ -438,13 +438,13 @@ static int ohci_da8xx_probe(struct platform_device *pdev) | |||
| 438 | } else if (error == -EPROBE_DEFER) { | 438 | } else if (error == -EPROBE_DEFER) { |
| 439 | goto err; | 439 | goto err; |
| 440 | } else { | 440 | } else { |
| 441 | dev_err(&pdev->dev, "Failed to get regulator\n"); | 441 | dev_err(dev, "Failed to get regulator\n"); |
| 442 | goto err; | 442 | goto err; |
| 443 | } | 443 | } |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 446 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 447 | hcd->regs = devm_ioremap_resource(&pdev->dev, mem); | 447 | hcd->regs = devm_ioremap_resource(dev, mem); |
| 448 | if (IS_ERR(hcd->regs)) { | 448 | if (IS_ERR(hcd->regs)) { |
| 449 | error = PTR_ERR(hcd->regs); | 449 | error = PTR_ERR(hcd->regs); |
| 450 | goto err; | 450 | goto err; |
