Devicetree
 help / color / mirror / Atom feed
From: "Duje Mihanović" <dujemihanovic32@gmail.com>
To: Karel Balej <balejk@matfyz.cz>
Cc: devicetree@vger.kernel.org, phone-devel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht,
	linux-kernel@vger.kernel.org, Lee Jones <lee@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 2/3] mfd: 88pm886: Initialize battery page
Date: Sun, 07 Jun 2026 16:19:40 +0200	[thread overview]
Message-ID: <uME6Hy8mQeKxnZAg1Q4aPA@gmail.com> (raw)
In-Reply-To: <DJ2QONQXFUDK.22S5350HOO2N6@matfyz.cz>

On Sunday, 7 June 2026 12:19:21 Central European Summer Time Karel Balej 
wrote:
> Duje Mihanović, 2026-05-26T21:14:48+02:00:

[...]

> > @@ -88,7 +94,8 @@ static int pm886_probe(struct i2c_client *client)
> > 
> >  	struct regmap_irq_chip_data *irq_data;
> >  	struct device *dev = &client->dev;
> >  	struct pm886_chip *chip;
> > 
> > -	struct regmap *regmap;
> > +	struct regmap *regmap, *regmap_battery;
> > +	struct i2c_client *battery_page;
> 
> Not sure if this should be reordered to preserve the "reverse Christmas
> tree", but maybe it's fine if checkpatch didn't complain.

I opted not to move the declarations around in this case as IMO it would 
present noise in the diff, but on second thought it may have been the better 
choice.

Lee, do you by chance know how to proceed here?

[...]

> > +	battery_page = devm_i2c_new_dummy_device(dev, client->adapter,
> > +						 client->addr + 
PM886_PAGE_OFFSET_BATTERY);
> > +	if (IS_ERR(battery_page))
> > +		return dev_err_probe(dev, PTR_ERR(battery_page),
> > +				     "Failed to initialize battery 
page\n");
> > +
> > +	regmap_battery = devm_regmap_init_i2c(battery_page,
> > &pm886_regmap_battery_config); +	if (IS_ERR(regmap_battery))
> > +		return dev_err_probe(dev, PTR_ERR(regmap_battery),
> > +				     "Failed to initialize battery 
regmap\n");
> > +	chip->regmap_battery = regmap_battery;
> > +
> 
> Nit: maybe this could go below the chip ID check so that it's not
> executed if the check subsequently fails?

Good catch, I'll do that in v2.

> Also, I think the error messages are missing either a definite article
> or an underscore. Same in the commit message title.

I agree for the commit message, but adding one to the error messages would IMO 
make them inconsistent with the existing ones.

[...]

Regards,
--
Duje




  reply	other threads:[~2026-06-07 14:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 19:14 [PATCH 0/3] 88PM886 Vbus regulator support Duje Mihanović
2026-05-26 19:14 ` [PATCH 1/3] dt-bindings: mfd: 88pm886: Allow vbus regulator Duje Mihanović
2026-05-27 15:05   ` Conor Dooley
2026-06-07 11:03   ` Karel Balej
2026-05-26 19:14 ` [PATCH 2/3] mfd: 88pm886: Initialize battery page Duje Mihanović
2026-06-07 10:19   ` Karel Balej
2026-06-07 14:19     ` Duje Mihanović [this message]
2026-05-26 19:14 ` [PATCH 3/3] regulator: 88pm886: Add Vbus regulator Duje Mihanović
2026-05-26 20:02   ` sashiko-bot
2026-06-07 10:44   ` Karel Balej
2026-06-07 14:02     ` Duje Mihanović

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=uME6Hy8mQeKxnZAg1Q4aPA@gmail.com \
    --to=dujemihanovic32@gmail.com \
    --cc=balejk@matfyz.cz \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox