All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Brian Masney <masneyb@onstation.org>
Cc: andy.gross@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com,
	david.brown@linaro.org, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	jonathan@marek.ca
Subject: Re: [PATCH RFC 2/5] power: supply: bq24190_charger: add support for bq24192 variant
Date: Mon, 22 Oct 2018 00:17:51 +0200	[thread overview]
Message-ID: <20181021221751.kaq3tib5mpppoepf@earth.universe> (raw)
In-Reply-To: <20181001053005.18906-3-masneyb@onstation.org>

[-- Attachment #1: Type: text/plain, Size: 1824 bytes --]

Hi,

On Mon, Oct 01, 2018 at 01:30:02AM -0400, Brian Masney wrote:
> From: Jonathan Marek <jonathan@marek.ca>
> 
> This patch adds support for the bq24192 variant to bq24190_charger.
> 
> Signed-off-by: Jonathan Marek <jonathan@marek.ca>
> Signed-off-by: Brian Masney <masneyb@onstation.org>
> ---
>  drivers/power/supply/bq24190_charger.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
> index b58df04d03b3..e3836145286d 100644
> --- a/drivers/power/supply/bq24190_charger.c
> +++ b/drivers/power/supply/bq24190_charger.c
> @@ -1638,7 +1638,8 @@ static int bq24190_hw_init(struct bq24190_dev_info *bdi)
>  		return ret;
>  
>  	if (v != BQ24190_REG_VPRS_PN_24190 &&
> -	    v != BQ24190_REG_VPRS_PN_24192I) {
> +		v != BQ24190_REG_VPRS_PN_24192 &&
> +		v != BQ24190_REG_VPRS_PN_24192I) {
>  		dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v);
>  		return -ENODEV;
>  	}

This becomes too ugly. Do it like this instead:

switch(v) {
case BQ24190_REG_VPRS_PN_24190:
case BQ24190_REG_VPRS_PN_24192:
case BQ24190_REG_VPRS_PN_24192I:
    break;
default:
    dev_err(bdi->dev, "Error unknown model: 0x%02x\n", v);
    return -ENODEV;
}

-- Sebastian

> @@ -1931,6 +1932,7 @@ static const struct dev_pm_ops bq24190_pm_ops = {
>  
>  static const struct i2c_device_id bq24190_i2c_ids[] = {
>  	{ "bq24190" },
> +	{ "bq24192" },
>  	{ "bq24192i" },
>  	{ },
>  };
> @@ -1939,6 +1941,7 @@ MODULE_DEVICE_TABLE(i2c, bq24190_i2c_ids);
>  #ifdef CONFIG_OF
>  static const struct of_device_id bq24190_of_match[] = {
>  	{ .compatible = "ti,bq24190", },
> +	{ .compatible = "ti,bq24192", },
>  	{ .compatible = "ti,bq24192i", },
>  	{ },
>  };
> -- 
> 2.17.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-10-21 22:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-01  5:30 [PATCH RFC 0/5] treewide: add USB OTG support for hammerhead Brian Masney
2018-10-01  5:30 ` [PATCH RFC 1/5] dt-bindings: power: supply: bq24190_charger: add bq24192 and usb-otg-vbus Brian Masney
2018-10-15 18:52   ` Rob Herring
2018-10-23  0:04     ` Brian Masney
2018-10-01  5:30 ` [PATCH RFC 2/5] power: supply: bq24190_charger: add support for bq24192 variant Brian Masney
2018-10-21 22:17   ` Sebastian Reichel [this message]
2018-10-01  5:30 ` [PATCH RFC 3/5] power: supply: bq24190_charger: add of_match for usb-otg-vbus regulator Brian Masney
2018-10-01  5:30 ` [PATCH RFC 4/5] power: supply: bq24190_charger: add support for extcon and GPIO for USB OTG support Brian Masney
2018-10-01  5:30 ` [PATCH RFC 5/5] ARM: dts: qcom: msm8974-hammerhead: add " Brian Masney

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=20181021221751.kaq3tib5mpppoepf@earth.universe \
    --to=sre@kernel.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathan@marek.ca \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=masneyb@onstation.org \
    --cc=robh+dt@kernel.org \
    --subject='Re: [PATCH RFC 2/5] power: supply: bq24190_charger: add support for bq24192 variant' \
    /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

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.