devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Daniel Schultz <d.schultz@phytec.de>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [RFCv1 5/8] mfd: rk808: cleanup unused function pointer
Date: Fri,  6 Dec 2019 18:45:33 +0000	[thread overview]
Message-ID: <20191206184536.2507-6-linux.amoon@gmail.com> (raw)
In-Reply-To: <20191206184536.2507-1-linux.amoon@gmail.com>

Cleanup unused pm_poweroff_fn and pm_pwroff_prep_fn function,
drop the unused rockchip,system-power-controller dts binding.

Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
 drivers/mfd/rk808.c       | 28 ++--------------------------
 include/linux/mfd/rk808.h |  2 --
 2 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index 4b3b90dad4f8..9a7be379946a 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -521,7 +521,7 @@ static int rk808_probe(struct i2c_client *client,
 	const struct mfd_cell *cells;
 	int nr_pre_init_regs;
 	int nr_cells;
-	int pm_off = 0, msb, lsb;
+	int msb, lsb;
 	unsigned char pmic_id_msb, pmic_id_lsb;
 	int ret;
 	int i;
@@ -641,18 +641,8 @@ static int rk808_probe(struct i2c_client *client,
 		goto err_irq;
 	}
 
-	pm_off = of_property_read_bool(np,
-				"rockchip,system-power-controller");
-	if (pm_off && !pm_power_off) {
+	if (!rk808_i2c_client)
 		rk808_i2c_client = client;
-		pm_power_off = rk808->pm_pwroff_fn;
-	}
-
-	if (pm_off && !pm_power_off_prepare) {
-		if (!rk808_i2c_client)
-			rk808_i2c_client = client;
-		pm_power_off_prepare = rk808->pm_pwroff_prep_fn;
-	}
 
 	return 0;
 
@@ -667,20 +657,6 @@ static int rk808_remove(struct i2c_client *client)
 
 	regmap_del_irq_chip(client->irq, rk808->irq_data);
 
-	/**
-	 * pm_power_off may points to a function from another module.
-	 * Check if the pointer is set by us and only then overwrite it.
-	 */
-	if (rk808->pm_pwroff_fn && pm_power_off == rk808->pm_pwroff_fn)
-		pm_power_off = NULL;
-
-	/**
-	 * As above, check if the pointer is set by us before overwrite.
-	 */
-	if (rk808->pm_pwroff_prep_fn &&
-	    pm_power_off_prepare == rk808->pm_pwroff_prep_fn)
-		pm_power_off_prepare = NULL;
-
 	return 0;
 }
 
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
index a59bf323f713..e07f6e61cd38 100644
--- a/include/linux/mfd/rk808.h
+++ b/include/linux/mfd/rk808.h
@@ -620,7 +620,5 @@ struct rk808 {
 	long				variant;
 	const struct regmap_config	*regmap_cfg;
 	const struct regmap_irq_chip	*regmap_irq_chip;
-	void				(*pm_pwroff_fn)(void);
-	void				(*pm_pwroff_prep_fn)(void);
 };
 #endif /* __LINUX_REGULATOR_RK808_H */
-- 
2.24.0


  parent reply	other threads:[~2019-12-06 18:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 18:45 [RFCv1 0/8] RK3399 clean shutdown issue Anand Moon
2019-12-06 18:45 ` [RFCv1 1/8] mfd: rk808: Refactor shutdown functions Anand Moon
2019-12-16 11:11   ` Lee Jones
2019-12-06 18:45 ` [RFCv1 2/8] mfd: rk808: use syscore for RK805 PMIC shutdown Anand Moon
2019-12-09 13:34   ` Robin Murphy
2019-12-09 15:38     ` Anand Moon
2019-12-06 18:45 ` [RFCv1 3/8] mfd: rk808: use syscore for RK808 " Anand Moon
2019-12-06 18:45 ` [RFCv1 4/8] mfd: rk808: use syscore for RK818 " Anand Moon
2019-12-06 18:45 ` Anand Moon [this message]
2019-12-06 18:45 ` [RFCv1 6/8] mfd: rk808: use common syscore for all PMCI for clean shutdown Anand Moon
2019-12-06 18:45 ` [RFCv1 7/8] arm64: rockchip: drop unused field from rk8xx i2c node Anand Moon
2019-12-06 18:45 ` [RFCv1 8/8] arm: " Anand Moon
2019-12-06 22:32 ` [RFCv1 0/8] RK3399 clean shutdown issue Heiko Stuebner
2019-12-07  5:07   ` Anand Moon
2019-12-07 11:45     ` Heiko Stuebner
2019-12-09 13:29 ` Robin Murphy
2019-12-09 13:37   ` Peter Geis
2019-12-09 13:53     ` Heiko Stübner
2019-12-09 13:58     ` Robin Murphy
2019-12-09 14:51     ` Tobias Schramm
2019-12-09 14:56   ` Anand Moon

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=20191206184536.2507-6-linux.amoon@gmail.com \
    --to=linux.amoon@gmail.com \
    --cc=d.schultz@phytec.de \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=jagan@amarulasolutions.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.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;
as well as URLs for NNTP newsgroup(s).