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

Merge remote-tracking branches 'regulator/topic/sky81452' and 'regulator/topic/stub' into regulator-next

+17 -43
+6 -4
Documentation/devicetree/bindings/regulator/sky81452-regulator.txt
··· 1 1 SKY81452 voltage regulator 2 2 3 3 Required properties: 4 + - regulator node named lout. 4 5 - any required generic properties defined in regulator.txt 5 6 6 7 Optional properties: ··· 10 9 Example: 11 10 12 11 regulator { 13 - /* generic regulator properties */ 14 - regulator-name = "touch_en"; 15 - regulator-min-microvolt = <4500000>; 16 - regulator-max-microvolt = <8000000>; 12 + lout { 13 + regulator-name = "sky81452-lout"; 14 + regulator-min-microvolt = <4500000>; 15 + regulator-max-microvolt = <8000000>; 16 + }; 17 17 };
+1 -1
drivers/regulator/Kconfig
··· 555 555 556 556 config REGULATOR_SKY81452 557 557 tristate "Skyworks Solutions SKY81452 voltage regulator" 558 - depends on SKY81452 558 + depends on MFD_SKY81452 559 559 help 560 560 This driver supports Skyworks SKY81452 voltage output regulator 561 561 via I2C bus. SKY81452 has one voltage linear regulator can be
+9 -37
drivers/regulator/sky81452-regulator.c
··· 5 5 * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com> 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify it 8 - * under the terms of the GNU General Public License as published by the 9 - * Free Software Foundation; either version 2, or (at your option) any 10 - * later version. 8 + * under the terms of the GNU General Public License version 2 9 + * as published by the Free Software Foundation. 11 10 * 12 11 * This program is distributed in the hope that it will be useful, but 13 12 * WITHOUT ANY WARRANTY; without even the implied warranty of ··· 51 52 52 53 static const struct regulator_desc sky81452_reg = { 53 54 .name = "LOUT", 55 + .of_match = of_match_ptr("lout"), 56 + .regulators_node = of_match_ptr("regulator"), 54 57 .ops = &sky81452_reg_ops, 55 58 .type = REGULATOR_VOLTAGE, 56 59 .owner = THIS_MODULE, ··· 65 64 .enable_mask = SKY81452_LEN, 66 65 }; 67 66 68 - #ifdef CONFIG_OF 69 - static struct regulator_init_data *sky81452_reg_parse_dt(struct device *dev) 70 - { 71 - struct regulator_init_data *init_data; 72 - struct device_node *np; 73 - 74 - np = of_get_child_by_name(dev->parent->of_node, "regulator"); 75 - if (unlikely(!np)) { 76 - dev_err(dev, "regulator node not found"); 77 - return NULL; 78 - } 79 - 80 - init_data = of_get_regulator_init_data(dev, np, &sky81452_reg); 81 - 82 - of_node_put(np); 83 - return init_data; 84 - } 85 - #else 86 - static struct regulator_init_data *sky81452_reg_parse_dt(struct device *dev) 87 - { 88 - return ERR_PTR(-EINVAL); 89 - } 90 - #endif 91 - 92 67 static int sky81452_reg_probe(struct platform_device *pdev) 93 68 { 94 69 struct device *dev = &pdev->dev; ··· 72 95 struct regulator_config config = { }; 73 96 struct regulator_dev *rdev; 74 97 75 - if (!init_data) { 76 - init_data = sky81452_reg_parse_dt(dev); 77 - if (IS_ERR(init_data)) 78 - return PTR_ERR(init_data); 79 - } 80 - 81 - config.dev = dev; 98 + config.dev = dev->parent; 82 99 config.init_data = init_data; 83 100 config.of_node = dev->of_node; 84 101 config.regmap = dev_get_drvdata(dev->parent); 85 102 86 103 rdev = devm_regulator_register(dev, &sky81452_reg, &config); 87 - if (IS_ERR(rdev)) 104 + if (IS_ERR(rdev)) { 105 + dev_err(dev, "failed to register. err=%ld\n", PTR_ERR(rdev)); 88 106 return PTR_ERR(rdev); 107 + } 89 108 90 109 platform_set_drvdata(pdev, rdev); 91 110 ··· 99 126 100 127 MODULE_DESCRIPTION("Skyworks SKY81452 Regulator driver"); 101 128 MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>"); 102 - MODULE_LICENSE("GPL"); 103 - MODULE_VERSION("1.0"); 129 + MODULE_LICENSE("GPL v2");
+1 -1
include/linux/regulator/consumer.h
··· 288 288 static inline struct regulator *__must_check 289 289 regulator_get_exclusive(struct device *dev, const char *id) 290 290 { 291 - return NULL; 291 + return ERR_PTR(-ENODEV); 292 292 } 293 293 294 294 static inline struct regulator *__must_check