mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] regulator: max77620: Remove unused fields
@ 2016-02-25  6:39 Axel Lin
  2016-02-25  6:40 ` [PATCH 2/3] regulator: max77620: Eliminate duplicate code Axel Lin
  2016-02-25  6:40 ` [PATCH 3/3] regulator: max77620: Remove duplicate module alias Axel Lin
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2016-02-25  6:39 UTC (permalink / raw)
  To: Mark Brown
  Cc: Laxman Dewangan, Mallikarjun Kasoju, Liam Girdwood, linux-kernel

These fields are never used and not required at all, remove them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/max77620-regulator.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c
index fee8ad9..761eb96 100644
--- a/drivers/regulator/max77620-regulator.c
+++ b/drivers/regulator/max77620-regulator.c
@@ -62,13 +62,9 @@ enum max77620_regulator_type {
 
 struct max77620_regulator_info {
 	u8 type;
-	u32 min_uV;
-	u32 max_uV;
-	u32 step_uV;
 	u8 fps_addr;
 	u8 volt_addr;
 	u8 cfg_addr;
-	u8 volt_mask;
 	u8 power_mode_mask;
 	u8 power_mode_shift;
 	u8 remote_sense_addr;
@@ -92,7 +88,6 @@ struct max77620_regulator {
 	struct regmap *rmap;
 	struct max77620_regulator_info *rinfo[MAX77620_NUM_REGS];
 	struct max77620_regulator_pdata reg_pdata[MAX77620_NUM_REGS];
-	struct regulator_desc *rdesc[MAX77620_NUM_REGS];
 	int enable_power_mode[MAX77620_NUM_REGS];
 	int current_power_mode[MAX77620_NUM_REGS];
 	int active_fps_src[MAX77620_NUM_REGS];
@@ -596,15 +591,11 @@ static struct regulator_ops max77620_regulator_ops = {
 		_step_uV, _rs_add, _rs_mask)				\
 	[MAX77620_REGULATOR_ID_##_id] = {				\
 		.type = MAX77620_REGULATOR_TYPE_SD,			\
-		.volt_mask = MAX77620_##_volt_mask##_VOLT_MASK,		\
 		.volt_addr = MAX77620_REG_##_id,			\
 		.cfg_addr = MAX77620_REG_##_id##_CFG,			\
 		.fps_addr = MAX77620_REG_FPS_##_id,			\
 		.remote_sense_addr = _rs_add,				\
 		.remote_sense_mask = MAX77620_SD_CNF2_ROVS_EN_##_rs_mask, \
-		.min_uV = _min_uV,					\
-		.max_uV = _max_uV,					\
-		.step_uV = _step_uV,					\
 		.power_mode_mask = MAX77620_SD_POWER_MODE_MASK,		\
 		.power_mode_shift = MAX77620_SD_POWER_MODE_SHIFT,	\
 		.desc = {						\
@@ -628,14 +619,10 @@ static struct regulator_ops max77620_regulator_ops = {
 #define RAIL_LDO(_id, _name, _sname, _type, _min_uV, _max_uV, _step_uV) \
 	[MAX77620_REGULATOR_ID_##_id] = {				\
 		.type = MAX77620_REGULATOR_TYPE_LDO_##_type,		\
-		.volt_mask = MAX77620_LDO_VOLT_MASK,			\
 		.volt_addr = MAX77620_REG_##_id##_CFG,			\
 		.cfg_addr = MAX77620_REG_##_id##_CFG2,			\
 		.fps_addr = MAX77620_REG_FPS_##_id,			\
 		.remote_sense_addr = 0xFF,				\
-		.min_uV = _min_uV,					\
-		.max_uV = _max_uV,					\
-		.step_uV = _step_uV,					\
 		.power_mode_mask = MAX77620_LDO_POWER_MODE_MASK,	\
 		.power_mode_shift = MAX77620_LDO_POWER_MODE_SHIFT,	\
 		.desc = {						\
@@ -736,7 +723,6 @@ static int max77620_regulator_probe(struct platform_device *pdev)
 		rdesc = &rinfo[id].desc;
 		pmic->rinfo[id] = &max77620_regs_info[id];
 		pmic->enable_power_mode[id] = MAX77620_POWER_MODE_NORMAL;
-		pmic->rdesc[id] = rdesc;
 
 		ret = max77620_read_slew_rate(pmic, id);
 		if (ret < 0)
-- 
2.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/3] regulator: max77620: Eliminate duplicate code
  2016-02-25  6:39 [PATCH 1/3] regulator: max77620: Remove unused fields Axel Lin
@ 2016-02-25  6:40 ` Axel Lin
  2016-02-25  6:40 ` [PATCH 3/3] regulator: max77620: Remove duplicate module alias Axel Lin
  1 sibling, 0 replies; 3+ messages in thread
From: Axel Lin @ 2016-02-25  6:40 UTC (permalink / raw)
  To: Mark Brown
  Cc: Laxman Dewangan, Mallikarjun Kasoju, Liam Girdwood, linux-kernel

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/max77620-regulator.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c
index 761eb96..0eb5d18 100644
--- a/drivers/regulator/max77620-regulator.c
+++ b/drivers/regulator/max77620-regulator.c
@@ -264,15 +264,15 @@ static int max77620_read_slew_rate(struct max77620_regulator *pmic, int id)
 	int slew_rate;
 	int ret;
 
+	ret = regmap_read(pmic->rmap, rinfo->cfg_addr, &rval);
+	if (ret < 0) {
+		dev_err(pmic->dev, "Register 0x%02x read failed: %d\n",
+			rinfo->cfg_addr, ret);
+		return ret;
+	}
+
 	switch (rinfo->type) {
 	case MAX77620_REGULATOR_TYPE_SD:
-		ret = regmap_read(pmic->rmap, rinfo->cfg_addr, &rval);
-		if (ret < 0) {
-			dev_err(pmic->dev, "Register 0x%02x read failed: %d\n",
-				rinfo->cfg_addr, ret);
-			return ret;
-		}
-
 		slew_rate = (rval >> MAX77620_SD_SR_SHIFT) & 0x3;
 		switch (slew_rate) {
 		case 0:
@@ -291,12 +291,6 @@ static int max77620_read_slew_rate(struct max77620_regulator *pmic, int id)
 		rinfo->desc.ramp_delay = slew_rate;
 		break;
 	default:
-		ret = regmap_read(pmic->rmap, rinfo->cfg_addr, &rval);
-		if (ret < 0) {
-			dev_err(pmic->dev, "Register 0x%02x read failed: %d\n",
-				rinfo->cfg_addr, ret);
-			return ret;
-		}
 		slew_rate = rval & 0x1;
 		switch (slew_rate) {
 		case 0:
-- 
2.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3/3] regulator: max77620: Remove duplicate module alias
  2016-02-25  6:39 [PATCH 1/3] regulator: max77620: Remove unused fields Axel Lin
  2016-02-25  6:40 ` [PATCH 2/3] regulator: max77620: Eliminate duplicate code Axel Lin
@ 2016-02-25  6:40 ` Axel Lin
  1 sibling, 0 replies; 3+ messages in thread
From: Axel Lin @ 2016-02-25  6:40 UTC (permalink / raw)
  To: Mark Brown
  Cc: Laxman Dewangan, Mallikarjun Kasoju, Liam Girdwood, linux-kernel

The same alias is already in .id_table.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/max77620-regulator.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c
index 0eb5d18..259e7e1 100644
--- a/drivers/regulator/max77620-regulator.c
+++ b/drivers/regulator/max77620-regulator.c
@@ -801,5 +801,4 @@ module_platform_driver(max77620_regulator_driver);
 MODULE_DESCRIPTION("MAX77620/MAX20024 regulator driver");
 MODULE_AUTHOR("Mallikarjun Kasoju <mkasoju@nvidia.com>");
 MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
-MODULE_ALIAS("platform:max77620-pmic");
 MODULE_LICENSE("GPL v2");
-- 
2.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-25  6:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-25  6:39 [PATCH 1/3] regulator: max77620: Remove unused fields Axel Lin
2016-02-25  6:40 ` [PATCH 2/3] regulator: max77620: Eliminate duplicate code Axel Lin
2016-02-25  6:40 ` [PATCH 3/3] regulator: max77620: Remove duplicate module alias Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome