From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] mfd: rk808: Abstracting childs from the interface being used
Date: Fri, 21 Jun 2024 08:33:11 +0300 [thread overview]
Message-ID: <20240621053311.12187-1-eagle.alexander923@gmail.com> (raw)
The patch is part of the preparation for adding the SPI interface support.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
drivers/mfd/rk808.c | 2 +-
drivers/regulator/rk808-regulator.c | 5 ++---
include/linux/mfd/rk808.h | 3 +--
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
index 77493a7b5b..adb9d8ca0a 100644
--- a/drivers/mfd/rk808.c
+++ b/drivers/mfd/rk808.c
@@ -330,7 +330,7 @@ static int rk808_probe(struct device *dev)
return -EINVAL;
}
- rk808->i2c = client;
+ rk808->dev = &client->dev;
i2c_set_clientdata(client, rk808);
rk808->regmap = regmap_init_i2c_smbus(client, rk808->regmap_cfg);
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index adb0262314..b361dae8cf 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -12,7 +12,6 @@
#include <driver.h>
#include <gpio.h>
#include <init.h>
-#include <i2c/i2c.h>
#include <of_device.h>
#include <linux/regmap.h>
#include <linux/regulator/of_regulator.h>
@@ -770,7 +769,7 @@ static int rk808_regulator_register(struct rk808 *rk808, int id,
struct of_regulator_match *match,
struct rk_regulator_cfg *cfg)
{
- struct device *dev = &rk808->i2c->dev;
+ struct device *dev = rk808->dev;
int ret;
if (!match->of_node) {
@@ -935,7 +934,7 @@ static int rk808_regulator_probe(struct device *dev)
return -EINVAL;
}
- ret = rk808_regulator_dt_parse(&rk808->i2c->dev, matches, nregulators);
+ ret = rk808_regulator_dt_parse(rk808->dev, matches, nregulators);
if (ret < 0)
return ret;
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
index d8e465f885..7804ea80f6 100644
--- a/include/linux/mfd/rk808.h
+++ b/include/linux/mfd/rk808.h
@@ -707,12 +707,11 @@ enum {
RK818_ID = 0x8180,
};
-struct i2c_client;
struct regmap;
struct regmap_config;
struct rk808 {
- struct i2c_client *i2c;
+ struct device *dev;
struct regmap *regmap;
long variant;
const struct regmap_config *regmap_cfg;
--
2.39.1
next reply other threads:[~2024-06-21 5:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 5:33 Alexander Shiyan [this message]
2024-07-01 12:46 ` Sascha Hauer
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=20240621053311.12187-1-eagle.alexander923@gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=barebox@lists.infradead.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