mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 18:23:53 +08:00
regulator/ab8500: move dereference below the check for NULL
I moved the dereference of "ab8500" below the check for NULL. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
parent
2bfc96a127
commit
af54decd6a
@ -344,13 +344,14 @@ static inline struct ab8500_regulator_info *find_regulator_info(int id)
|
|||||||
static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
|
static __devinit int ab8500_regulator_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
|
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
|
||||||
struct ab8500_platform_data *pdata = dev_get_platdata(ab8500->dev);
|
struct ab8500_platform_data *pdata;
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
if (!ab8500) {
|
if (!ab8500) {
|
||||||
dev_err(&pdev->dev, "null mfd parent\n");
|
dev_err(&pdev->dev, "null mfd parent\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
pdata = dev_get_platdata(ab8500->dev);
|
||||||
|
|
||||||
/* register all regulators */
|
/* register all regulators */
|
||||||
for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
|
for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user