Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: lpc_ich: Separate device cells for clarity

The lpc_ich_cells array gives the wrong impression about the
relationship between the watchdog and GPIO devices. They are
completely distinct devices, so this patch separates the
array into distinct mfd_cell structs per device.

A side effect of removing the array, is that the lpc_cells enum
is no longer needed.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Aaron Sierra and committed by
Lee Jones
3dab794f 39d047c0

+18 -24
+18 -24
drivers/mfd/lpc_ich.c
··· 132 132 }, 133 133 }; 134 134 135 - enum lpc_cells { 136 - LPC_WDT = 0, 137 - LPC_GPIO, 135 + static struct mfd_cell lpc_ich_wdt_cell = { 136 + .name = "iTCO_wdt", 137 + .num_resources = ARRAY_SIZE(wdt_ich_res), 138 + .resources = wdt_ich_res, 139 + .ignore_resource_conflicts = true, 138 140 }; 139 141 140 - static struct mfd_cell lpc_ich_cells[] = { 141 - [LPC_WDT] = { 142 - .name = "iTCO_wdt", 143 - .num_resources = ARRAY_SIZE(wdt_ich_res), 144 - .resources = wdt_ich_res, 145 - .ignore_resource_conflicts = true, 146 - }, 147 - [LPC_GPIO] = { 148 - .name = "gpio_ich", 149 - .num_resources = ARRAY_SIZE(gpio_ich_res), 150 - .resources = gpio_ich_res, 151 - .ignore_resource_conflicts = true, 152 - }, 142 + static struct mfd_cell lpc_ich_gpio_cell = { 143 + .name = "gpio_ich", 144 + .num_resources = ARRAY_SIZE(gpio_ich_res), 145 + .resources = gpio_ich_res, 146 + .ignore_resource_conflicts = true, 153 147 }; 154 148 155 149 /* chipset related info */ ··· 835 841 struct itco_wdt_platform_data *pdata; 836 842 struct lpc_ich_priv *priv = pci_get_drvdata(dev); 837 843 struct lpc_ich_info *info; 838 - struct mfd_cell *cell = &lpc_ich_cells[LPC_WDT]; 844 + struct mfd_cell *cell = &lpc_ich_wdt_cell; 839 845 840 846 pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL); 841 847 if (!pdata) ··· 854 860 static void lpc_ich_finalize_gpio_cell(struct pci_dev *dev) 855 861 { 856 862 struct lpc_ich_priv *priv = pci_get_drvdata(dev); 857 - struct mfd_cell *cell = &lpc_ich_cells[LPC_GPIO]; 863 + struct mfd_cell *cell = &lpc_ich_gpio_cell; 858 864 859 865 cell->platform_data = &lpc_chipset_info[priv->chipset]; 860 866 cell->pdata_size = sizeof(struct lpc_ich_info); ··· 898 904 base_addr = base_addr_cfg & 0x0000ff80; 899 905 if (!base_addr) { 900 906 dev_notice(&dev->dev, "I/O space for ACPI uninitialized\n"); 901 - lpc_ich_cells[LPC_GPIO].num_resources--; 907 + lpc_ich_gpio_cell.num_resources--; 902 908 goto gpe0_done; 903 909 } 904 910 ··· 912 918 * the platform_device subsystem doesn't see this resource 913 919 * or it will register an invalid region. 914 920 */ 915 - lpc_ich_cells[LPC_GPIO].num_resources--; 921 + lpc_ich_gpio_cell.num_resources--; 916 922 acpi_conflict = true; 917 923 } else { 918 924 lpc_ich_enable_acpi_space(dev); ··· 952 958 953 959 lpc_ich_finalize_gpio_cell(dev); 954 960 ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, 955 - &lpc_ich_cells[LPC_GPIO], 1, NULL, 0, NULL); 961 + &lpc_ich_gpio_cell, 1, NULL, 0, NULL); 956 962 957 963 gpio_done: 958 964 if (acpi_conflict) 959 965 pr_warn("Resource conflict(s) found affecting %s\n", 960 - lpc_ich_cells[LPC_GPIO].name); 966 + lpc_ich_gpio_cell.name); 961 967 return ret; 962 968 } 963 969 ··· 1001 1007 */ 1002 1008 if (lpc_chipset_info[priv->chipset].iTCO_version == 1) { 1003 1009 /* Don't register iomem for TCO ver 1 */ 1004 - lpc_ich_cells[LPC_WDT].num_resources--; 1010 + lpc_ich_wdt_cell.num_resources--; 1005 1011 } else if (lpc_chipset_info[priv->chipset].iTCO_version == 2) { 1006 1012 pci_read_config_dword(dev, RCBABASE, &base_addr_cfg); 1007 1013 base_addr = base_addr_cfg & 0xffffc000; ··· 1029 1035 goto wdt_done; 1030 1036 1031 1037 ret = mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO, 1032 - &lpc_ich_cells[LPC_WDT], 1, NULL, 0, NULL); 1038 + &lpc_ich_wdt_cell, 1, NULL, 0, NULL); 1033 1039 1034 1040 wdt_done: 1035 1041 return ret;