67 lines
2.1 KiB
Diff
67 lines
2.1 KiB
Diff
|
From 97b038542bbb35fb83f33db81015f2b600ded641 Mon Sep 17 00:00:00 2001
|
||
|
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||
|
Date: Tue, 12 Jul 2022 14:17:54 +0200
|
||
|
Subject: [PATCH 302/469] mfd: rk808: replace 'struct i2c_client' with 'struct
|
||
|
device'
|
||
|
|
||
|
Put 'struct device' pointer into the MFD platform_data instead
|
||
|
of the 'struct i2c_client' pointer. This simplifies the code
|
||
|
and prepares the MFD for SPI support.
|
||
|
|
||
|
Acked-for-MFD-by: Lee Jones <lee@kernel.org>
|
||
|
Tested-by: Diederik de Haas <didi.debian@cknow.org> # Rock64, Quartz64 Model A + B
|
||
|
Tested-by: Vincent Legoll <vincent.legoll@gmail.com> # Pine64 QuartzPro64
|
||
|
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
||
|
---
|
||
|
drivers/mfd/rk808.c | 6 +++---
|
||
|
include/linux/mfd/rk808.h | 2 +-
|
||
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
|
||
|
index f42e09e3a3f5..ce52307cbaea 100644
|
||
|
--- a/drivers/mfd/rk808.c
|
||
|
+++ b/drivers/mfd/rk808.c
|
||
|
@@ -577,7 +577,7 @@ static int rk808_power_off(struct sys_off_data *data)
|
||
|
}
|
||
|
ret = regmap_update_bits(rk808->regmap, reg, bit, bit);
|
||
|
if (ret)
|
||
|
- dev_err(&rk808->i2c->dev, "Failed to shutdown device!\n");
|
||
|
+ dev_err(rk808->dev, "Failed to shutdown device!\n");
|
||
|
|
||
|
return NOTIFY_DONE;
|
||
|
}
|
||
|
@@ -600,7 +600,7 @@ static int rk808_restart(struct sys_off_data *data)
|
||
|
}
|
||
|
ret = regmap_update_bits(rk808->regmap, reg, bit, bit);
|
||
|
if (ret)
|
||
|
- dev_err(&rk808->i2c->dev, "Failed to restart device!\n");
|
||
|
+ dev_err(rk808->dev, "Failed to restart device!\n");
|
||
|
|
||
|
return NOTIFY_DONE;
|
||
|
}
|
||
|
@@ -720,7 +720,7 @@ static int rk808_probe(struct i2c_client *client)
|
||
|
return -EINVAL;
|
||
|
}
|
||
|
|
||
|
- rk808->i2c = client;
|
||
|
+ rk808->dev = &client->dev;
|
||
|
i2c_set_clientdata(client, rk808);
|
||
|
|
||
|
rk808->regmap = devm_regmap_init_i2c(client, rk808->regmap_cfg);
|
||
|
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
|
||
|
index 9af1f3105f80..a89ddd9ba68e 100644
|
||
|
--- a/include/linux/mfd/rk808.h
|
||
|
+++ b/include/linux/mfd/rk808.h
|
||
|
@@ -787,7 +787,7 @@ enum {
|
||
|
};
|
||
|
|
||
|
struct rk808 {
|
||
|
- struct i2c_client *i2c;
|
||
|
+ struct device *dev;
|
||
|
struct regmap_irq_chip_data *irq_data;
|
||
|
struct regmap *regmap;
|
||
|
long variant;
|
||
|
--
|
||
|
2.34.1
|
||
|
|