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

regulator: pfuze100: Convert the driver to DT-only

Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code
by removing the unused non-DT support.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201210212748.5849-1-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Fabio Estevam and committed by
Mark Brown
6a6939d5 0da6736e

+2 -40
+1 -1
drivers/regulator/Kconfig
··· 830 830 831 831 config REGULATOR_PFUZE100 832 832 tristate "Freescale PFUZE100/200/3000/3001 regulator driver" 833 - depends on I2C 833 + depends on I2C && OF 834 834 select REGMAP_I2C 835 835 help 836 836 Say y here to support the regulators found on the Freescale
+1 -33
drivers/regulator/pfuze100-regulator.c
··· 105 105 2500000, 2800000, 2850000, 3000000, 3100000, 3150000, 3200000, 3300000, 106 106 }; 107 107 108 - static const struct i2c_device_id pfuze_device_id[] = { 109 - {.name = "pfuze100", .driver_data = PFUZE100}, 110 - {.name = "pfuze200", .driver_data = PFUZE200}, 111 - {.name = "pfuze3000", .driver_data = PFUZE3000}, 112 - {.name = "pfuze3001", .driver_data = PFUZE3001}, 113 - { } 114 - }; 115 - MODULE_DEVICE_TABLE(i2c, pfuze_device_id); 116 - 117 108 static const struct of_device_id pfuze_dt_ids[] = { 118 109 { .compatible = "fsl,pfuze100", .data = (void *)PFUZE100}, 119 110 { .compatible = "fsl,pfuze200", .data = (void *)PFUZE200}, ··· 431 440 PFUZE100_VGEN_REG(PFUZE3001, VLDO4, PFUZE100_VGEN6VOL, 1800000, 3300000, 100000), 432 441 }; 433 442 434 - #ifdef CONFIG_OF 435 443 /* PFUZE100 */ 436 444 static struct of_regulator_match pfuze100_matches[] = { 437 445 { .name = "sw1ab", }, ··· 568 578 { 569 579 return pfuze_matches[index].of_node; 570 580 } 571 - #else 572 - static int pfuze_parse_regulators_dt(struct pfuze_chip *chip) 573 - { 574 - return 0; 575 - } 576 - 577 - static inline struct regulator_init_data *match_init_data(int index) 578 - { 579 - return NULL; 580 - } 581 - 582 - static inline struct device_node *match_of_node(int index) 583 - { 584 - return NULL; 585 - } 586 - #endif 587 581 588 582 static struct pfuze_chip *syspm_pfuze_chip; 589 583 ··· 682 708 const struct i2c_device_id *id) 683 709 { 684 710 struct pfuze_chip *pfuze_chip; 685 - struct pfuze_regulator_platform_data *pdata = 686 - dev_get_platdata(&client->dev); 687 711 struct regulator_config config = { }; 688 712 int i, ret; 689 713 const struct of_device_id *match; ··· 774 802 775 803 desc = &pfuze_chip->regulator_descs[i].desc; 776 804 777 - if (pdata) 778 - init_data = pdata->init_data[i]; 779 - else 780 - init_data = match_init_data(i); 805 + init_data = match_init_data(i); 781 806 782 807 /* SW2~SW4 high bit check and modify the voltage value table */ 783 808 if (i >= sw_check_start && i <= sw_check_end) { ··· 845 876 } 846 877 847 878 static struct i2c_driver pfuze_driver = { 848 - .id_table = pfuze_device_id, 849 879 .driver = { 850 880 .name = "pfuze100-regulator", 851 881 .of_match_table = pfuze_dt_ids,
-6
include/linux/regulator/pfuze100.h
··· 63 63 #define PFUZE3001_VLDO3 8 64 64 #define PFUZE3001_VLDO4 9 65 65 66 - struct regulator_init_data; 67 - 68 - struct pfuze_regulator_platform_data { 69 - struct regulator_init_data *init_data[PFUZE100_MAX_REGULATOR]; 70 - }; 71 - 72 66 #endif /* __LINUX_REG_PFUZE100_H */