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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
regulator: Fix default constraints for fixed voltage regulators
regulator/bq24022: fix bug in is_enabled function
regulator/virtual: fix strings compare predicates
regulator core: fix double-free in regulator_register() error path
drivers/regulator: fix when type is different from REGULATOR_VOLTAGE or REGULATOR_CURRENT
unreachable code in drms_uA_update()
regulator: fix header file missing kernel-doc

+19 -12
+1 -2
drivers/regulator/bq24022.c
··· 61 61 62 62 static int bq24022_is_enabled(struct regulator_dev *rdev) 63 63 { 64 - struct platform_device *pdev = rdev_get_drvdata(rdev); 65 - struct bq24022_mach_info *pdata = pdev->dev.platform_data; 64 + struct bq24022_mach_info *pdata = rdev_get_drvdata(rdev); 66 65 67 66 return !gpio_get_value(pdata->gpio_nce); 68 67 }
+13 -6
drivers/regulator/core.c
··· 540 540 541 541 err = regulator_check_drms(rdev); 542 542 if (err < 0 || !rdev->desc->ops->get_optimum_mode || 543 - !rdev->desc->ops->get_voltage || !rdev->desc->ops->set_mode); 544 - return; 543 + !rdev->desc->ops->get_voltage || !rdev->desc->ops->set_mode) 544 + return; 545 545 546 546 /* get output voltage */ 547 547 output_uV = rdev->desc->ops->get_voltage(rdev); ··· 703 703 int cmin = constraints->min_uV; 704 704 int cmax = constraints->max_uV; 705 705 706 - /* it's safe to autoconfigure fixed-voltage supplies */ 706 + /* it's safe to autoconfigure fixed-voltage supplies 707 + and the constraints are used by list_voltage. */ 707 708 if (count == 1 && !cmin) { 708 - cmin = INT_MIN; 709 + cmin = 1; 709 710 cmax = INT_MAX; 711 + constraints->min_uV = cmin; 712 + constraints->max_uV = cmax; 710 713 } 711 714 712 715 /* voltage constraints are optional */ ··· 2004 2001 if (regulator_desc->name == NULL || regulator_desc->ops == NULL) 2005 2002 return ERR_PTR(-EINVAL); 2006 2003 2007 - if (!regulator_desc->type == REGULATOR_VOLTAGE && 2008 - !regulator_desc->type == REGULATOR_CURRENT) 2004 + if (regulator_desc->type != REGULATOR_VOLTAGE && 2005 + regulator_desc->type != REGULATOR_CURRENT) 2009 2006 return ERR_PTR(-EINVAL); 2010 2007 2011 2008 if (!init_data) ··· 2083 2080 2084 2081 scrub: 2085 2082 device_unregister(&rdev->dev); 2083 + /* device core frees rdev */ 2084 + rdev = ERR_PTR(ret); 2085 + goto out; 2086 + 2086 2087 clean: 2087 2088 kfree(rdev); 2088 2089 rdev = ERR_PTR(ret);
+4 -4
drivers/regulator/virtual.c
··· 230 230 * sysfs_streq() doesn't need the \n's, but we add them so the strings 231 231 * will be shared with show_mode(), above. 232 232 */ 233 - if (sysfs_streq(buf, "fast\n") == 0) 233 + if (sysfs_streq(buf, "fast\n")) 234 234 mode = REGULATOR_MODE_FAST; 235 - else if (sysfs_streq(buf, "normal\n") == 0) 235 + else if (sysfs_streq(buf, "normal\n")) 236 236 mode = REGULATOR_MODE_NORMAL; 237 - else if (sysfs_streq(buf, "idle\n") == 0) 237 + else if (sysfs_streq(buf, "idle\n")) 238 238 mode = REGULATOR_MODE_IDLE; 239 - else if (sysfs_streq(buf, "standby\n") == 0) 239 + else if (sysfs_streq(buf, "standby\n")) 240 240 mode = REGULATOR_MODE_STANDBY; 241 241 else { 242 242 dev_err(dev, "Configuring invalid mode\n");
+1
include/linux/regulator/driver.h
··· 50 50 * @set_current_limit: Configure a limit for a current-limited regulator. 51 51 * @get_current_limit: Get the configured limit for a current-limited regulator. 52 52 * 53 + * @set_mode: Set the configured operating mode for the regulator. 53 54 * @get_mode: Get the configured operating mode for the regulator. 54 55 * @get_status: Return actual (not as-configured) status of regulator, as a 55 56 * REGULATOR_STATUS value (or negative errno)