Skip to content

Commit a35c62b

Browse files
committed
pinctrl: intel: Refactor intel_pinctrl_get_soc_data()
Refactor intel_pinctrl_get_soc_data() to drop initial assignment of the data variable. It's only used in ACPI case and instead we may always assign it there as the ACPI ID table has the terminator entry that has driver data set to NULL. Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 6217728 commit a35c62b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ EXPORT_SYMBOL_NS_GPL(intel_pinctrl_probe_by_uid, PINCTRL_INTEL);
16511651
const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_device *pdev)
16521652
{
16531653
const struct intel_pinctrl_soc_data * const *table;
1654-
const struct intel_pinctrl_soc_data *data = NULL;
1654+
const struct intel_pinctrl_soc_data *data;
16551655
struct device *dev = &pdev->dev;
16561656

16571657
table = device_get_match_data(dev);
@@ -1660,11 +1660,10 @@ const struct intel_pinctrl_soc_data *intel_pinctrl_get_soc_data(struct platform_
16601660
unsigned int i;
16611661

16621662
for (i = 0; table[i]; i++) {
1663-
if (acpi_dev_uid_match(adev, table[i]->uid)) {
1664-
data = table[i];
1663+
if (acpi_dev_uid_match(adev, table[i]->uid))
16651664
break;
1666-
}
16671665
}
1666+
data = table[i];
16681667
} else {
16691668
const struct platform_device_id *id;
16701669

0 commit comments

Comments
 (0)