mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-01 10:45:49 +00:00
mfd: palmas: Constify .data in OF table and {palmas,tps65917}_irq_chip
Constify .data in OF table and {palmas,tps65917}_irq_chip and replace the variable *features->features in struct palmas_driver_data and drop the {palmas,tps659038}_features variables and use their values directly in the named initialization. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230831183153.63750-3-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
3f9a06dc79
commit
93ec3d0e02
@ -296,7 +296,7 @@ static const struct regmap_irq palmas_irqs[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static struct regmap_irq_chip palmas_irq_chip = {
|
||||
static const struct regmap_irq_chip palmas_irq_chip = {
|
||||
.name = "palmas",
|
||||
.irqs = palmas_irqs,
|
||||
.num_irqs = ARRAY_SIZE(palmas_irqs),
|
||||
@ -309,7 +309,7 @@ static struct regmap_irq_chip palmas_irq_chip = {
|
||||
PALMAS_INT1_MASK),
|
||||
};
|
||||
|
||||
static struct regmap_irq_chip tps65917_irq_chip = {
|
||||
static const struct regmap_irq_chip tps65917_irq_chip = {
|
||||
.name = "tps65917",
|
||||
.irqs = tps65917_irqs,
|
||||
.num_irqs = ARRAY_SIZE(tps65917_irqs),
|
||||
@ -463,26 +463,21 @@ static void palmas_power_off(void)
|
||||
__func__, ret);
|
||||
}
|
||||
|
||||
static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST;
|
||||
static unsigned int tps659038_features;
|
||||
|
||||
struct palmas_driver_data {
|
||||
unsigned int *features;
|
||||
struct regmap_irq_chip *irq_chip;
|
||||
unsigned int features;
|
||||
const struct regmap_irq_chip *irq_chip;
|
||||
};
|
||||
|
||||
static struct palmas_driver_data palmas_data = {
|
||||
.features = &palmas_features,
|
||||
static const struct palmas_driver_data palmas_data = {
|
||||
.features = PALMAS_PMIC_FEATURE_SMPS10_BOOST,
|
||||
.irq_chip = &palmas_irq_chip,
|
||||
};
|
||||
|
||||
static struct palmas_driver_data tps659038_data = {
|
||||
.features = &tps659038_features,
|
||||
static const struct palmas_driver_data tps659038_data = {
|
||||
.irq_chip = &palmas_irq_chip,
|
||||
};
|
||||
|
||||
static struct palmas_driver_data tps65917_data = {
|
||||
.features = &tps659038_features,
|
||||
static const struct palmas_driver_data tps65917_data = {
|
||||
.irq_chip = &tps65917_irq_chip,
|
||||
};
|
||||
|
||||
@ -507,7 +502,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c)
|
||||
{
|
||||
struct palmas *palmas;
|
||||
struct palmas_platform_data *pdata;
|
||||
struct palmas_driver_data *driver_data;
|
||||
const struct palmas_driver_data *driver_data;
|
||||
struct device_node *node = i2c->dev.of_node;
|
||||
int ret = 0, i;
|
||||
unsigned int reg, addr;
|
||||
@ -535,8 +530,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c)
|
||||
palmas->dev = &i2c->dev;
|
||||
palmas->irq = i2c->irq;
|
||||
|
||||
driver_data = (struct palmas_driver_data *) device_get_match_data(&i2c->dev);
|
||||
palmas->features = *driver_data->features;
|
||||
driver_data = device_get_match_data(&i2c->dev);
|
||||
palmas->features = driver_data->features;
|
||||
|
||||
for (i = 0; i < PALMAS_NUM_CLIENTS; i++) {
|
||||
if (i == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user