pinctrl: cherryview: Utilize temporary variable to hold device pointer
Subsystems (3)
PATCH 1/1 pinctrl: cherryview: Utilize temporary variable to hold device pointer
By one of the previous clean up change we got a temporary variable to hold a device pointer. It can be utilized in other calls in the ->probe() and save a bit of LOCs.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/pinctrl/intel/pinctrl-cherryview.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/pinctrl/intel/pinctrl-cherryview.c +5 -6
@@ -1621,7 +1621,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev)if (!pctrl)return -ENOMEM ; - pctrl->dev = &pdev->dev; + pctrl->dev = dev; pctrl->soc = soc_data; pctrl->ncommunities = pctrl->soc->ncommunities;
@@ -1657,14 +1657,13 @@ static int chv_pinctrl_probe(struct platform_device *pdev)return irq; pctrl->pctldesc = chv_pinctrl_desc; - pctrl->pctldesc.name =dev_name (&pdev->dev); + pctrl->pctldesc.name =dev_name (dev); pctrl->pctldesc.pins = pctrl->soc->pins; pctrl->pctldesc.npins = pctrl->soc->npins; - pctrl->pctldev =devm_pinctrl_register (&pdev->dev, &pctrl->pctldesc, - pctrl); + pctrl->pctldev =devm_pinctrl_register (dev, &pctrl->pctldesc, pctrl);if (IS_ERR (pctrl->pctldev)) { -dev_err (&pdev->dev,"failed to register pinctrl driver\n" ); +dev_err (dev,"failed to register pinctrl driver\n" );return PTR_ERR (pctrl->pctldev); }
@@ -1677,7 +1676,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev) chv_pinctrl_mmio_access_handler, NULL, pctrl);if (ACPI_FAILURE (status)) -dev_err (&pdev->dev,"failed to install ACPI addr space handler\n" ); +dev_err (dev,"failed to install ACPI addr space handler\n" );platform_set_drvdata (pdev, pctrl);
Signature · 1 line
2.27.0
Quoted 5 lines · Andy Shevchenko
By one of the previous clean up change we got a temporary variable to hold a device pointer. It can be utilized in other calls in the ->probe() and save a bit of LOCs.
Signed-off-by Andy Shevchenko <[email protected]>
Acked-by Mika Westerberg <[email protected]>
Quoted 8 lines · Mika Westerberg
Quoted 5 lines · Andy Shevchenko
By one of the previous clean up change we got a temporary variable to hold a device pointer. It can be utilized in other calls in the ->probe() and save a bit of LOCs.
Signed-off-by Andy Shevchenko <[email protected]>Acked-by Mika Westerberg <[email protected]>
Applied to my review and testing queue, thanks!
Signature · 2 lines
With Best Regards, Andy Shevchenko