linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: mturquette@baylibre.com, robh+dt@kernel.org, sboyd@kernel.org,
	mark.rutland@arm.com, lgirdwood@gmail.com, broonie@kernel.org,
	mazziesaccount@gmail.com, arnd@arndb.de,
	dmitry.torokhov@gmail.com, sre@kernel.org, chenjh@rock-chips.com,
	andrew.smirnov@gmail.com, linus.walleij@linaro.org,
	kstewart@linuxfoundation.org, heiko@sntech.de,
	gregkh@linuxfoundation.org, eballetbo@gmail.com,
	linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	mikko.mutanen@fi.rohmeurope.com,
	heikki.haikola@fi.rohmeurope.com
Subject: Re: [PATCH v10 1/2] mfd: bd71837: mfd driver for ROHM BD71837 PMIC
Date: Mon, 30 Jul 2018 09:52:00 +0300	[thread overview]
Message-ID: <20180730065200.GA8862@localhost.localdomain> (raw)
In-Reply-To: <20180712130013.GJ4641@dell>

Hello Lee & All others,

I'm physically back from my vacations so I can once again reach the
keyboard. So it's time to try address these issues =)

On Thu, Jul 12, 2018 at 02:00:13PM +0100, Lee Jones wrote:
> On Thu, 05 Jul 2018, Matti Vaittinen wrote:
> 
> > +	ret = regmap_read(bd71837->regmap, BD71837_REG_REV, &val);
> > +	if (ret) {
> > +		dev_err(&i2c->dev, "Read BD71837_REG_DEVICE failed\n");
> > +		return ret;
> > +	}
> 
> You never do anything with the value here.
> 
> Please either utilise it, read something useful or remove it.

Right. I'll add check that the chip revision is known and supported by
driver. Later I'll also use this value to distinguish between BD71837
and BD71847.

> > +struct bd71837_pmic;
> > +struct bd71837_clk;
> > +
> > +struct bd71837 {
> > +	struct device *dev;
> > +	struct i2c_client *i2c_client;
> 
> Are these both being used?
> 
> If you save one, you tend not to need the other.
> 

That's what I would call experience. I indeed only use the dev pointer
in subdevices - and what's even more ugly is that I use
dev_get_drvdata(pdev->dev.parent) - in regulator while I use
i2c_set_clientdata(i2c, bd71837); in MFD. This works because
i2c_set_clientdata actually calls dev_set_drvdata - buit that's not
pretty.

I think it would be more appropriate to drop the i2c_client because
subdevices need not to know the chip is connected via i2c. I'll do that
and also replace the call to i2c_set_clientdata with direct use of
dev_set_drvdata. Thanks!

> > +	struct regmap *regmap;
> > +	unsigned long int id;
> > +
> > +	int chip_irq;
> > +	struct regmap_irq_chip_data *irq_data;
> > +
> > +	struct bd71837_pmic *pmic;
> > +	struct bd71837_clk *clk;
> > +};
> > +
> > +#endif /* __LINUX_MFD_BD71837_H__ */
> 
> -- 
> Lee Jones [李琼斯]
> Linaro Services Technical Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2018-07-30  6:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05 14:31 [PATCH v10 0/2] mfd/regulator/clk/input: bd71837: ROHM BD71837 PMIC driver Matti Vaittinen
2018-07-05 14:32 ` [PATCH v10 1/2] mfd: bd71837: mfd driver for ROHM BD71837 PMIC Matti Vaittinen
2018-07-05 14:41   ` Enric Balletbo Serra
2018-07-06  6:09     ` Lee Jones
2018-07-06 10:23       ` Matti Vaittinen
2018-07-06 10:56         ` Lee Jones
2018-07-12 13:00   ` Lee Jones
2018-07-30  6:52     ` Matti Vaittinen [this message]
2018-07-05 14:32 ` [PATCH v10 2/2] mfd: bd71837: Devicetree bindings " Matti Vaittinen
2018-07-05 20:39   ` Rob Herring
2018-07-12 12:32   ` Lee Jones

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=20180730065200.GA8862@localhost.localdomain \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=chenjh@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eballetbo@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.haikola@fi.rohmeurope.com \
    --cc=heiko@sntech.de \
    --cc=kstewart@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mazziesaccount@gmail.com \
    --cc=mikko.mutanen@fi.rohmeurope.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sre@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).