diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-03-23 14:34:32 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2021-04-14 16:06:31 +0100 |
commit | 98d6e7fce6b0174c701dc596539dc7bc1e96f8ce (patch) | |
tree | 7a67d0c2ea4d9a909569ef47910a6858bba34329 /drivers/mfd | |
parent | d1157530d476ffce4485182eea5b492065362a09 (diff) |
mfd: intel_quark_i2c_gpio: Reuse BAR definitions for MFD cell indexing
It's convenient and less error prone to use definitions to address
different cells in an array. For this purpose we may reuse existing
BAR definitions.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/intel_quark_i2c_gpio.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c index f7e1634e43b3..d63427876210 100644 --- a/drivers/mfd/intel_quark_i2c_gpio.c +++ b/drivers/mfd/intel_quark_i2c_gpio.c @@ -96,15 +96,7 @@ static struct mfd_cell_acpi_match intel_quark_acpi_match_gpio = { }; static struct mfd_cell intel_quark_mfd_cells[] = { - { - .id = MFD_GPIO_BAR, - .name = "gpio-dwapb", - .acpi_match = &intel_quark_acpi_match_gpio, - .num_resources = ARRAY_SIZE(intel_quark_gpio_res), - .resources = intel_quark_gpio_res, - .ignore_resource_conflicts = true, - }, - { + [MFD_I2C_BAR] = { .id = MFD_I2C_BAR, .name = "i2c_designware", .acpi_match = &intel_quark_acpi_match_i2c, @@ -112,6 +104,14 @@ static struct mfd_cell intel_quark_mfd_cells[] = { .resources = intel_quark_i2c_res, .ignore_resource_conflicts = true, }, + [MFD_GPIO_BAR] = { + .id = MFD_GPIO_BAR, + .name = "gpio-dwapb", + .acpi_match = &intel_quark_acpi_match_gpio, + .num_resources = ARRAY_SIZE(intel_quark_gpio_res), + .resources = intel_quark_gpio_res, + .ignore_resource_conflicts = true, + }, }; static const struct pci_device_id intel_quark_mfd_ids[] = { @@ -244,11 +244,11 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev, if (ret) return ret; - ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_cells[1]); + ret = intel_quark_i2c_setup(pdev, &intel_quark_mfd_cells[MFD_I2C_BAR]); if (ret) goto err_unregister_i2c_clk; - ret = intel_quark_gpio_setup(pdev, &intel_quark_mfd_cells[0]); + ret = intel_quark_gpio_setup(pdev, &intel_quark_mfd_cells[MFD_GPIO_BAR]); if (ret) goto err_unregister_i2c_clk; |