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

mfd: tps65218: Use mfd_add_devices instead of of_platform_populate

mfd_add_devices enables parsing device tree nodes without compatibles
for regulators and gpio modules. Replace of_platform_populate with
mfd_add_devices. mfd_cell currently is populated with regulators,
gpio and powerbutton.

Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Keerthy and committed by
Lee Jones
4531156d 77aa9926

+16 -2
+16 -2
drivers/mfd/tps65218.c
··· 33 33 34 34 #define TPS65218_PASSWORD_REGS_UNLOCK 0x7D 35 35 36 + static const struct mfd_cell tps65218_cells[] = { 37 + { 38 + .name = "tps65218-pwrbutton", 39 + .of_compatible = "ti,tps65218-pwrbutton", 40 + }, 41 + { 42 + .name = "tps65218-gpio", 43 + .of_compatible = "ti,tps65218-gpio", 44 + }, 45 + { .name = "tps65218-regulator", }, 46 + }; 47 + 36 48 /** 37 49 * tps65218_reg_write: Write a single tps65218 register. 38 50 * ··· 257 245 258 246 tps->rev = chipid & TPS65218_CHIPID_REV_MASK; 259 247 260 - ret = of_platform_populate(client->dev.of_node, NULL, NULL, 261 - &client->dev); 248 + ret = mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO, tps65218_cells, 249 + ARRAY_SIZE(tps65218_cells), NULL, 0, 250 + regmap_irq_get_domain(tps->irq_data)); 251 + 262 252 if (ret < 0) 263 253 goto err_irq; 264 254