2010-08-14 09:03:49

by Dan Carpenter

[permalink] [raw]
Subject: [patch] 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 <[email protected]>

diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index dc3f1a4..cc7cbaf 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -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)
{
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;

if (!ab8500) {
dev_err(&pdev->dev, "null mfd parent\n");
return -EINVAL;
}
+ pdata = dev_get_platdata(ab8500->dev);

/* register all regulators */
for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) {


2010-08-14 09:36:18

by Mark Brown

[permalink] [raw]
Subject: Re: [patch] regulator/ab8500: move dereference below the check for NULL

On 14 Aug 2010, at 10:03, Dan Carpenter wrote:

> I moved the dereference of "ab8500" below the check for NULL.
>
> Signed-off-by: Dan Carpenter <[email protected]>

Acked-by: Mark Brown <[email protected]>

2010-08-14 09:57:42

by Sundar R IYER

[permalink] [raw]
Subject: Re: [patch] regulator/ab8500: move dereference below the check for NULL

On Sat, Aug 14, 2010 at 11:36:13 +0200, Mark Brown wrote:
> On 14 Aug 2010, at 10:03, Dan Carpenter wrote:
>
> > I moved the dereference of "ab8500" below the check for NULL.
> >
> > Signed-off-by: Dan Carpenter <[email protected]>
>
> Acked-by: Mark Brown <[email protected]>

Thanx!

Regards,
Sundar

2010-08-14 11:16:05

by Liam Girdwood

[permalink] [raw]
Subject: Re: [patch] regulator/ab8500: move dereference below the check for NULL

On Sat, 2010-08-14 at 10:36 +0100, Mark Brown wrote:
> On 14 Aug 2010, at 10:03, Dan Carpenter wrote:
>
> > I moved the dereference of "ab8500" below the check for NULL.
> >
> > Signed-off-by: Dan Carpenter <[email protected]>
>
> Acked-by: Mark Brown <[email protected]>

Applied.

Thanks

Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk