diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-11 05:19:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-11 05:19:12 -0400 |
commit | 32c8fad438200b523ec44a49b40cb8ffdf715f7c (patch) | |
tree | 5470d156542e081920e5ff468da3121918eca3e6 /drivers/regulator/core.c | |
parent | 9eb0c4218aa444f863e7f54909351d5b4f0fac06 (diff) |
regulator: Appease smatch in regulator_register()
We don't support missing configs at all so segfaulting isn't that bad
but since we've got checks in the code move the dereference after them.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 4bb1f8456123..7943fd64988d 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2833,13 +2833,15 @@ regulator_register(const struct regulator_desc *regulator_desc, | |||
2833 | const struct regulator_init_data *init_data; | 2833 | const struct regulator_init_data *init_data; |
2834 | static atomic_t regulator_no = ATOMIC_INIT(0); | 2834 | static atomic_t regulator_no = ATOMIC_INIT(0); |
2835 | struct regulator_dev *rdev; | 2835 | struct regulator_dev *rdev; |
2836 | struct device *dev = config->dev; | 2836 | struct device *dev; |
2837 | int ret, i; | 2837 | int ret, i; |
2838 | const char *supply = NULL; | 2838 | const char *supply = NULL; |
2839 | 2839 | ||
2840 | if (regulator_desc == NULL || config == NULL) | 2840 | if (regulator_desc == NULL || config == NULL) |
2841 | return ERR_PTR(-EINVAL); | 2841 | return ERR_PTR(-EINVAL); |
2842 | 2842 | ||
2843 | dev = config->dev; | ||
2844 | |||
2843 | if (regulator_desc->name == NULL || regulator_desc->ops == NULL) | 2845 | if (regulator_desc->name == NULL || regulator_desc->ops == NULL) |
2844 | return ERR_PTR(-EINVAL); | 2846 | return ERR_PTR(-EINVAL); |
2845 | 2847 | ||