Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Biju Das and committed by
Lee Jones
93ec3d0e 3f9a06dc

+11 -16
+11 -16
drivers/mfd/palmas.c
··· 296 296 }, 297 297 }; 298 298 299 - static struct regmap_irq_chip palmas_irq_chip = { 299 + static const struct regmap_irq_chip palmas_irq_chip = { 300 300 .name = "palmas", 301 301 .irqs = palmas_irqs, 302 302 .num_irqs = ARRAY_SIZE(palmas_irqs), ··· 309 309 PALMAS_INT1_MASK), 310 310 }; 311 311 312 - static struct regmap_irq_chip tps65917_irq_chip = { 312 + static const struct regmap_irq_chip tps65917_irq_chip = { 313 313 .name = "tps65917", 314 314 .irqs = tps65917_irqs, 315 315 .num_irqs = ARRAY_SIZE(tps65917_irqs), ··· 463 463 __func__, ret); 464 464 } 465 465 466 - static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST; 467 - static unsigned int tps659038_features; 468 - 469 466 struct palmas_driver_data { 470 - unsigned int *features; 471 - struct regmap_irq_chip *irq_chip; 467 + unsigned int features; 468 + const struct regmap_irq_chip *irq_chip; 472 469 }; 473 470 474 - static struct palmas_driver_data palmas_data = { 475 - .features = &palmas_features, 471 + static const struct palmas_driver_data palmas_data = { 472 + .features = PALMAS_PMIC_FEATURE_SMPS10_BOOST, 476 473 .irq_chip = &palmas_irq_chip, 477 474 }; 478 475 479 - static struct palmas_driver_data tps659038_data = { 480 - .features = &tps659038_features, 476 + static const struct palmas_driver_data tps659038_data = { 481 477 .irq_chip = &palmas_irq_chip, 482 478 }; 483 479 484 - static struct palmas_driver_data tps65917_data = { 485 - .features = &tps659038_features, 480 + static const struct palmas_driver_data tps65917_data = { 486 481 .irq_chip = &tps65917_irq_chip, 487 482 }; 488 483 ··· 502 507 { 503 508 struct palmas *palmas; 504 509 struct palmas_platform_data *pdata; 505 - struct palmas_driver_data *driver_data; 510 + const struct palmas_driver_data *driver_data; 506 511 struct device_node *node = i2c->dev.of_node; 507 512 int ret = 0, i; 508 513 unsigned int reg, addr; ··· 530 535 palmas->dev = &i2c->dev; 531 536 palmas->irq = i2c->irq; 532 537 533 - driver_data = (struct palmas_driver_data *) device_get_match_data(&i2c->dev); 534 - palmas->features = *driver_data->features; 538 + driver_data = device_get_match_data(&i2c->dev); 539 + palmas->features = driver_data->features; 535 540 536 541 for (i = 0; i < PALMAS_NUM_CLIENTS; i++) { 537 542 if (i == 0)