diff mbox

[1/3] twl4030-madc: copy the device pointer

Message ID 1313033272-16774-2-git-send-email-kyle@kylemanna.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kyle Manna Aug. 11, 2011, 3:27 a.m. UTC
Worst case this fixes the following error:
[   72.086212] (NULL device *): conversion timeout!

Best case it prevents a crash

Signed-off-by: Kyle Manna <kyle@kylemanna.com>
---
 drivers/mfd/twl4030-madc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

Grazvydas Ignotas Aug. 11, 2011, 9:50 a.m. UTC | #1
You need to send this one to mfd maintainer, separate from this series
perhaps (see MAINTAINERS or just use ./scripts/get_maintainer.pl).

On Thu, Aug 11, 2011 at 6:27 AM, Kyle Manna <kyle@kylemanna.com> wrote:
> Worst case this fixes the following error:
> [   72.086212] (NULL device *): conversion timeout!
>
> Best case it prevents a crash
>
> Signed-off-by: Kyle Manna <kyle@kylemanna.com>
> ---
>  drivers/mfd/twl4030-madc.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
> index b5d598c..8ef7801 100644
> --- a/drivers/mfd/twl4030-madc.c
> +++ b/drivers/mfd/twl4030-madc.c
> @@ -706,6 +706,9 @@ static int __devinit twl4030_madc_probe(struct platform_device *pdev)
>        if (!madc)
>                return -ENOMEM;
>
> +       /* Copy the pointer to device struct */
> +       madc->dev = &pdev->dev;
> +

This comment is not useful, it's already clear you are copying a pointer.

>        /*
>         * Phoenix provides 2 interrupt lines. The first one is connected to
>         * the OMAP. The other one can be connected to the other processor such
> @@ -733,7 +736,7 @@ static int __devinit twl4030_madc_probe(struct platform_device *pdev)
>        ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
>                               regval, TWL4030_BCI_BCICTL1);
>        if (ret) {
> -               dev_err(&pdev->dev, "unable to write reg BCI Ctl1 0x%X\n",
> +               dev_err(&pdev->dev, "unable to write reg BCI CTL1 0x%X\n",
>                        TWL4030_BCI_BCICTL1);

Stray change (no mention in commit message), should not be part of this patch.

>                goto err_i2c;
>        }
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
diff mbox

Patch

diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
index b5d598c..8ef7801 100644
--- a/drivers/mfd/twl4030-madc.c
+++ b/drivers/mfd/twl4030-madc.c
@@ -706,6 +706,9 @@  static int __devinit twl4030_madc_probe(struct platform_device *pdev)
 	if (!madc)
 		return -ENOMEM;
 
+	/* Copy the pointer to device struct */
+	madc->dev = &pdev->dev;
+
 	/*
 	 * Phoenix provides 2 interrupt lines. The first one is connected to
 	 * the OMAP. The other one can be connected to the other processor such
@@ -733,7 +736,7 @@  static int __devinit twl4030_madc_probe(struct platform_device *pdev)
 	ret = twl_i2c_write_u8(TWL4030_MODULE_MAIN_CHARGE,
 			       regval, TWL4030_BCI_BCICTL1);
 	if (ret) {
-		dev_err(&pdev->dev, "unable to write reg BCI Ctl1 0x%X\n",
+		dev_err(&pdev->dev, "unable to write reg BCI CTL1 0x%X\n",
 			TWL4030_BCI_BCICTL1);
 		goto err_i2c;
 	}