Commit 04944997 authored by Sebastian Reichel's avatar Sebastian Reichel Committed by Lee Jones
Browse files

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.

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: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20230504173618.142075-5-sebastian.reichel@collabora.com


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent e714b50b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;