mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincent Palatin <vpalatin@chromium.org>
To: Samuel Ortiz <sameo@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Cc: Olof Johansson <olofj@chromium.org>,
	Vincent Palatin <vpalatin@chromium.org>
Subject: [PATCH] mfd: tps6586x: Invert GPIO and subdevices initialization
Date: Wed, 19 Jan 2011 09:52:09 -0500	[thread overview]
Message-ID: <1295448729-22821-1-git-send-email-vpalatin@chromium.org> (raw)

When using a fixed voltage regulator triggered by a TPS6586x GPIO,
this allows to declare and initialize it conveniently from the "subdev" list.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
---
 drivers/mfd/tps6586x.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 627cf57..fdb16ed 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -517,19 +517,25 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
 		}
 	}
 
+	tps6586x_gpio_init(tps6586x, pdata->gpio_base);
+
 	ret = tps6586x_add_subdevs(tps6586x, pdata);
 	if (ret) {
 		dev_err(&client->dev, "add devices failed: %d\n", ret);
 		goto err_add_devs;
 	}
 
-	tps6586x_gpio_init(tps6586x, pdata->gpio_base);
-
 	return 0;
 
 err_add_devs:
 	if (client->irq)
 		free_irq(client->irq, tps6586x);
+	if (pdata->gpio_base) {
+		ret = gpiochip_remove(&tps6586x->gpio);
+		if (ret)
+			dev_err(&client->dev, "Can't remove gpio chip: %d\n",
+				ret);
+	}
 err_irq_init:
 	kfree(tps6586x);
 	return ret;
-- 
1.7.3.1


             reply	other threads:[~2011-01-19 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-19 14:52 Vincent Palatin [this message]
2011-01-30 23:37 ` Samuel Ortiz
2011-01-31 15:11   ` Vincent Palatin
2011-01-31 16:31     ` Vincent Palatin

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=1295448729-22821-1-git-send-email-vpalatin@chromium.org \
    --to=vpalatin@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olofj@chromium.org \
    --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®