All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qing Xu <qingx@marvell.com>
To: Qing Xu <qingx@marvell.com>
Cc: Qiao Zhou <zhouqiao@marvell.com>,
	"sameo@linux.intel.com" <sameo@linux.intel.com>,
	Chao Xie <cxie4@marvell.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] mfd: 88pm80x: fix regmap not init before used
Date: Wed, 12 Dec 2012 14:25:14 +0800	[thread overview]
Message-ID: <50C8234A.4090400@marvell.com> (raw)
In-Reply-To: <1354513117-20464-1-git-send-email-qingx@marvell.com>

On 12/03/2012 01:38 PM, Qing Xu wrote:
> From: Qing Xu <qingx@marvell.com>
>
> 1.put the pm800_page_init before 800_init, otherwise power and
> gpadc regmap handle are not inited before being used.
> 2.remove regmap exit, as it will be called in driver release
> 3.add lost "return 0" in probe()
> 4.update driver's name
>
> Signed-off-by: Qiao Zhou <zhouqiao@marvell.com>
> Signed-off-by: Qing Xu <qingx@marvell.com>
> ---
>   drivers/mfd/88pm800.c |   25 ++++++++++++-------------
>   drivers/mfd/88pm805.c |    5 +++--
>   drivers/mfd/88pm80x.c |    2 +-
>   3 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c
> index ce229ea..73b2c9f 100644
> --- a/drivers/mfd/88pm800.c
> +++ b/drivers/mfd/88pm800.c
> @@ -401,9 +401,6 @@ static void pm800_pages_exit(struct pm80x_chip *chip)
>   {
>   	struct pm80x_subchip *subchip;
>   
> -	regmap_exit(chip->regmap);
> -	i2c_unregister_device(chip->client);
> -
>   	subchip = chip->subchip;
>   	if (subchip->power_page) {
>   		regmap_exit(subchip->regmap_power);
> @@ -413,6 +410,7 @@ static void pm800_pages_exit(struct pm80x_chip *chip)
>   		regmap_exit(subchip->regmap_gpadc);
>   		i2c_unregister_device(subchip->gpadc_page);
>   	}
> +	i2c_unregister_device(chip->client);
>   }
>   
>   static int __devinit device_800_init(struct pm80x_chip *chip,
> @@ -528,25 +526,26 @@ static int __devinit pm800_probe(struct i2c_client *client,
>   	subchip->gpadc_page_addr = pdata->gpadc_page_addr;
>   	chip->subchip = subchip;
>   
> -	ret = device_800_init(chip, pdata);
> -	if (ret) {
> -		dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id);
> -		goto err_800_init;
> -	}
> -
>   	ret = pm800_pages_init(chip);
>   	if (ret) {
>   		dev_err(&client->dev, "pm800_pages_init failed!\n");
>   		goto err_page_init;
>   	}
>   
> +	ret = device_800_init(chip, pdata);
> +	if (ret) {
> +		dev_err(chip->dev, "%s id 0x%x failed!\n", __func__, chip->id);
> +		goto err_800_init;
> +	}
> +
>   	if (pdata->plat_config)
>   		pdata->plat_config(chip, pdata);
>   
> -err_page_init:
> -	mfd_remove_devices(chip->dev);
> -	device_irq_exit_800(chip);
> +	return 0;
> +
>   err_800_init:
> +	pm800_pages_exit(chip);
> +err_page_init:
>   	devm_kfree(&client->dev, subchip);
>   err_subchip_alloc:
>   	pm80x_deinit(client);
> @@ -571,7 +570,7 @@ static int __devexit pm800_remove(struct i2c_client *client)
>   
>   static struct i2c_driver pm800_driver = {
>   	.driver = {
> -		.name = "88PM80X",
> +		.name = "88PM800",
>   		.owner = THIS_MODULE,
>   		.pm = &pm80x_pm_ops,
>   		},
> diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c
> index c20a311..7878013 100644
> --- a/drivers/mfd/88pm805.c
> +++ b/drivers/mfd/88pm805.c
> @@ -168,7 +168,6 @@ static int __devinit device_irq_init_805(struct pm80x_chip *chip)
>   	ret =
>   	    regmap_add_irq_chip(chip->regmap, chip->irq, flags, -1,
>   				chip->regmap_irq_chip, &chip->irq_data);
> -
>   out:
>   	return ret;
>   }
> @@ -256,6 +255,8 @@ static int __devinit pm805_probe(struct i2c_client *client,
>   	if (pdata->plat_config)
>   		pdata->plat_config(chip, pdata);
>   
> +	return 0;
> +
>   err_805_init:
>   	pm80x_deinit(client);
>   out_init:
> @@ -276,7 +277,7 @@ static int __devexit pm805_remove(struct i2c_client *client)
>   
>   static struct i2c_driver pm805_driver = {
>   	.driver = {
> -		.name = "88PM80X",
> +		.name = "88PM805",
>   		.owner = THIS_MODULE,
>   		.pm = &pm80x_pm_ops,
>   		},
> diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c
> index cd0bf52..1adb355 100644
> --- a/drivers/mfd/88pm80x.c
> +++ b/drivers/mfd/88pm80x.c
> @@ -31,7 +31,7 @@ const struct regmap_config pm80x_regmap_config = {
>   };
>   EXPORT_SYMBOL_GPL(pm80x_regmap_config);
>   
> -int __devinit pm80x_init(struct i2c_client *client,
> +int pm80x_init(struct i2c_client *client,
>   				 const struct i2c_device_id *id)
>   {
>   	struct pm80x_chip *chip;


Samuel,

Could you help to review the patch? Thanks a lot!

Qing


      reply	other threads:[~2012-12-12  6:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03  5:38 [PATCH 1/4] mfd: 88pm80x: fix regmap not init before used Qing Xu
2012-12-12  6:25 ` Qing Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50C8234A.4090400@marvell.com \
    --to=qingx@marvell.com \
    --cc=cxie4@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=zhouqiao@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.