lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210806091058.141-6-alistair@alistair23.me>
Date:   Fri,  6 Aug 2021 19:10:51 +1000
From:   Alistair Francis <alistair@...stair23.me>
To:     lee.jones@...aro.org, robh+dt@...nel.org, lgirdwood@...il.com,
        broonie@...nel.org, linux-imx@....com, kernel@...gutronix.de
Cc:     devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        alistair23@...il.com, Alistair Francis <alistair@...stair23.me>
Subject: [PATCH v9 05/12] regulator: sy7636a: Use the regmap directly

Signed-off-by: Alistair Francis <alistair@...stair23.me>
---
 drivers/regulator/sy7636a-regulator.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c
index 37bf2a3c06b7..8360b3947ead 100644
--- a/drivers/regulator/sy7636a-regulator.c
+++ b/drivers/regulator/sy7636a-regulator.c
@@ -14,7 +14,7 @@
 #include <linux/mfd/sy7636a.h>
 
 struct sy7636a_data {
-	struct sy7636a *sy7636a;
+	struct regmap *regmap;
 	struct gpio_desc *pgood_gpio;
 };
 
@@ -70,14 +70,14 @@ static const struct regulator_desc desc = {
 
 static int sy7636a_regulator_probe(struct platform_device *pdev)
 {
-	struct sy7636a *sy7636a = dev_get_drvdata(pdev->dev.parent);
+	struct regmap *regmap = dev_get_drvdata(pdev->dev.parent);
 	struct regulator_config config = { };
 	struct regulator_dev *rdev;
 	struct gpio_desc *gdp;
 	struct sy7636a_data *data;
 	int ret;
 
-	if (!sy7636a)
+	if (!regmap)
 		return -EPROBE_DEFER;
 
 	gdp = devm_gpiod_get(pdev->dev.parent, "epd-pwr-good", GPIOD_IN);
@@ -90,12 +90,12 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
 	if (!data)
 		return -ENOMEM;
 
-	data->sy7636a = sy7636a;
+	data->regmap = regmap;
 	data->pgood_gpio = gdp;
 
 	platform_set_drvdata(pdev, data);
 
-	ret = regmap_write(sy7636a->regmap, SY7636A_REG_POWER_ON_DELAY_TIME, 0x0);
+	ret = regmap_write(regmap, SY7636A_REG_POWER_ON_DELAY_TIME, 0x0);
 	if (ret) {
 		dev_err(pdev->dev.parent, "Failed to initialize regulator: %d\n", ret);
 		return ret;
@@ -103,8 +103,7 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
 
 	config.dev = &pdev->dev;
 	config.dev->of_node = pdev->dev.parent->of_node;
-	config.driver_data = sy7636a;
-	config.regmap = sy7636a->regmap;
+	config.regmap = regmap;
 
 	rdev = devm_regulator_register(&pdev->dev, &desc, &config);
 	if (IS_ERR(rdev)) {
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ