From: Krzysztof Kozlowski <krzk@kernel.org>
To: Lee Jones <lee.jones@linaro.org>,
Chanwoo Choi <cw00.choi@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [RFT 4/4] mfd: max14577: Remove platform data and instantiation from I2C
Date: Fri, 17 Feb 2017 22:02:00 +0200 [thread overview]
Message-ID: <20170217200200.4521-5-krzk@kernel.org> (raw)
In-Reply-To: <20170217200200.4521-1-krzk@kernel.org>
max14577 family of drivers can be now instantiated only from DeviceTree
thus we can remove any I2C device id code and platform data. This
simplifies the driver a little bit.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/mfd/max14577.c | 22 ----------------------
include/linux/mfd/max14577.h | 20 --------------------
2 files changed, 42 deletions(-)
diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c
index f6772d64a6a4..a6ec1451af94 100644
--- a/drivers/mfd/max14577.c
+++ b/drivers/mfd/max14577.c
@@ -373,7 +373,6 @@ static int max14577_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
struct max14577 *max14577;
- struct max14577_platform_data *pdata = dev_get_platdata(&i2c->dev);
struct device_node *np = i2c->dev.of_node;
int ret = 0;
const struct regmap_irq_chip *irq_chip;
@@ -381,18 +380,6 @@ static int max14577_i2c_probe(struct i2c_client *i2c,
unsigned int mfd_devs_size;
int irq_flags;
- if (np) {
- pdata = devm_kzalloc(&i2c->dev, sizeof(*pdata), GFP_KERNEL);
- if (!pdata)
- return -ENOMEM;
- i2c->dev.platform_data = pdata;
- }
-
- if (!pdata) {
- dev_err(&i2c->dev, "No platform data found.\n");
- return -EINVAL;
- }
-
max14577 = devm_kzalloc(&i2c->dev, sizeof(*max14577), GFP_KERNEL);
if (!max14577)
return -ENOMEM;
@@ -486,13 +473,6 @@ static int max14577_i2c_remove(struct i2c_client *i2c)
return 0;
}
-static const struct i2c_device_id max14577_i2c_id[] = {
- { "max14577", MAXIM_DEVICE_TYPE_MAX14577, },
- { "max77836", MAXIM_DEVICE_TYPE_MAX77836, },
- { }
-};
-MODULE_DEVICE_TABLE(i2c, max14577_i2c_id);
-
#ifdef CONFIG_PM_SLEEP
static int max14577_suspend(struct device *dev)
{
@@ -538,12 +518,10 @@ static struct i2c_driver max14577_i2c_driver = {
},
.probe = max14577_i2c_probe,
.remove = max14577_i2c_remove,
- .id_table = max14577_i2c_id,
};
static int __init max14577_i2c_init(void)
{
- BUILD_BUG_ON(ARRAY_SIZE(max14577_i2c_id) != MAXIM_DEVICE_TYPE_NUM);
BUILD_BUG_ON(ARRAY_SIZE(max14577_dt_match) != MAXIM_DEVICE_TYPE_NUM);
/* Valid charger current values must be provided for each chipset */
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h
index d81b52bb8bee..a97155662713 100644
--- a/include/linux/mfd/max14577.h
+++ b/include/linux/mfd/max14577.h
@@ -62,26 +62,6 @@ struct max14577_charger_platform_data {
};
/*
- * MAX14577 MFD platform data
- */
-struct max14577_platform_data {
- /* IRQ */
- int irq_base;
-
- /* current control GPIOs */
- int gpio_pogo_vbatt_en;
- int gpio_pogo_vbus_en;
-
- /* current control GPIO control function */
- int (*set_gpio_pogo_vbatt_en) (int gpio_val);
- int (*set_gpio_pogo_vbus_en) (int gpio_val);
-
- int (*set_gpio_pogo_cb) (int new_dev);
-
- struct max14577_regulator_platform_data *regulators;
-};
-
-/*
* Valid limits of current for max14577 and max77836 chargers.
* They must correspond to MBCICHWRCL and MBCICHWRCH fields in CHGCTRL4
* register for given chipset.
--
2.9.3
next prev parent reply other threads:[~2017-02-17 20:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170217200214epcas3p4d72abd10d1ce7dbbbcd626bcf452fa37@epcas3p4.samsung.com>
2017-02-17 20:01 ` [RFT 0/4] mfd: regulator: max14577: Remove support for platform data Krzysztof Kozlowski
2017-02-17 20:01 ` [RFT 1/4] mfd: max14577: Explicitly depend on OF Krzysztof Kozlowski
2017-02-17 20:01 ` [RFT 2/4] mfd: max14577: Export OF module alias information Krzysztof Kozlowski
2017-02-17 20:01 ` [RFT 3/4] regulator: max14577: Remove support for platform data Krzysztof Kozlowski
2017-02-18 0:02 ` Mark Brown
2017-02-17 20:02 ` Krzysztof Kozlowski [this message]
2017-02-27 12:55 ` [RFT 0/4] mfd: " Bartlomiej Zolnierkiewicz
2017-02-27 15:32 ` Krzysztof Kozlowski
2017-02-27 15:52 ` Bartlomiej Zolnierkiewicz
2017-02-28 9:47 ` Mark Brown
2017-02-28 11:34 ` Bartlomiej Zolnierkiewicz
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=20170217200200.4521-5-krzk@kernel.org \
--to=krzk@kernel.org \
--cc=b.zolnierkie@samsung.com \
--cc=broonie@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.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