mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Kyle Manna <kyle.manna@fuel7.com>
Cc: linux-kernel@vger.kernel.org,
	Samuel Ortiz <sameo@linux.intel.com>, Liam Girdwood <lrg@ti.com>,
	Jorge Eduardo Candelaria <jedu@slimlogic.co.uk>,
	Graeme Gregory <gg@slimlogic.co.uk>
Subject: Re: [PATCH 6/6] mfd: TPS65910: Improve regulator init data
Date: Wed, 19 Oct 2011 15:00:28 +0100	[thread overview]
Message-ID: <20111019140027.GH18713@sirena.org.uk> (raw)
In-Reply-To: <1318962388-26151-7-git-send-email-kyle.manna@fuel7.com>

On Tue, Oct 18, 2011 at 01:26:28PM -0500, Kyle Manna wrote:
> Improve the interface between platform code/board files to the TPS65910

Again, *always* CC maintainers on patches.

> regulators.  The TWL4030/6030 code was used as an example interface.

This isn't a good sign...

> This improved interface will allow use of the regulators without
> specifying all the constraints. Also gets rid of an assumption that
> the platform pass in an array of correct size and was unchecked.

You've not described the changes between the two interfaces.  Note that
empty constraints should be absolutely fine with the API.

> +	if (init_data->constraints.name)
> +		pmic->desc[i].name = init_data->constraints.name;
> +	else
> +		pmic->desc[i].name = info[i].name;

No, this is broken.  The name of the regulator is a fixed property of
the device and isn't something that ought to be overridden per system.

> +	/* TPS65910 and TPS65911 Regulators */
> +	rdev = add_regulator(pmic, info, TPS65910_REG_VRTC,
> +			pmic_plat_data->vrtc);
> +	if (IS_ERR(rdev))
> +		return PTR_ERR(rdev);
> +	rdev = add_regulator(pmic, info, TPS65910_REG_VIO,
> +			pmic_plat_data->vio);
> +
> +	if (IS_ERR(rdev))
> +		return PTR_ERR(rdev);
> +
> +	rdev = add_regulator(pmic, info, TPS65910_REG_VDD1,
> +			pmic_plat_data->vdd1);
> +	if (IS_ERR(rdev))
> +		return PTR_ERR(rdev);

This looks like a regression - we've gone from looping over an array
which is nice and simple to explicit code for each individual regulator
giving us lots of repetitive code...

> -err_unregister_regulator:
> -	while (--i >= 0)
> -		regulator_unregister(pmic->rdev[i]);
> -	kfree(pmic->rdev);

...and loosing all our cleanup if things go wrong which isn't great
either.

  reply	other threads:[~2011-10-19 14:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18 18:26 [PATCH 0/6] mfd: TPS65910 bug fixes and enhancements Kyle Manna
2011-10-18 18:26 ` [PATCH 1/6] mfd: TPS65910: Handle non-existent devices Kyle Manna
2011-10-18 18:26 ` [PATCH 2/6] mfd: TPS65910: Add I2C slave address macros Kyle Manna
2011-10-18 18:26 ` [PATCH 3/6] mfd: TPS65910: Fix typo that clobbers genirq Kyle Manna
2011-10-18 18:26 ` [PATCH 4/6] mfd: TPS65910: Move linux/gpio.h include to header Kyle Manna
2011-10-18 18:26 ` [PATCH 5/6] mfd: TPS65910: Fix tps65910_set_voltage Kyle Manna
2011-10-19 13:32   ` Mark Brown
2011-10-20 15:21     ` Kyle Manna
2011-10-18 18:26 ` [PATCH 6/6] mfd: TPS65910: Improve regulator init data Kyle Manna
2011-10-19 14:00   ` Mark Brown [this message]
2011-10-24 16:13     ` Kyle Manna
2011-10-18 18:42 ` [PATCH 0/6] mfd: TPS65910 bug fixes and enhancements Graeme Gregory

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=20111019140027.GH18713@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=gg@slimlogic.co.uk \
    --cc=jedu@slimlogic.co.uk \
    --cc=kyle.manna@fuel7.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=sameo@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®