Skip to content

Commit 7eee64e

Browse files
author
Bartosz Golaszewski
committed
gpio: use more common syntax for compound literals
The (typeof(foo)) construct is unusual in the kernel, use a more typical syntax by explicitly spelling out the type. Link: https://lore.kernel.org/all/20250909-gpio-mmio-gpio-conv-part4-v1-13-9f723dc3524a@linaro.org/ Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://lore.kernel.org/r/20250910-make-compound-literals-normal-again-v1-3-076ee7738a0b@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 4c91b0e commit 7eee64e

24 files changed

Lines changed: 24 additions & 24 deletions

drivers/gpio/gpio-amdpt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
8888
return PTR_ERR(pt_gpio->reg_base);
8989
}
9090

91-
config = (typeof(config)){
91+
config = (struct gpio_generic_chip_config) {
9292
.dev = dev,
9393
.sz = 4,
9494
.dat = pt_gpio->reg_base + PT_INPUTDATA_REG,

drivers/gpio/gpio-blzp1600.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int blzp1600_gpio_probe(struct platform_device *pdev)
230230
if (IS_ERR(chip->base))
231231
return PTR_ERR(chip->base);
232232

233-
config = (typeof(config)){
233+
config = (struct gpio_generic_chip_config) {
234234
.dev = &pdev->dev,
235235
.sz = 4,
236236
.dat = chip->base + GPIO_IDATA_REG,

drivers/gpio/gpio-dwapb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
525525
set = gpio->regs + GPIO_SWPORTA_DR + pp->idx * GPIO_SWPORT_DR_STRIDE;
526526
dirout = gpio->regs + GPIO_SWPORTA_DDR + pp->idx * GPIO_SWPORT_DDR_STRIDE;
527527

528-
config = (typeof(config)){
528+
config = (struct gpio_generic_chip_config) {
529529
.dev = gpio->dev,
530530
.sz = 4,
531531
.dat = dat,

drivers/gpio/gpio-ep93xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int ep93xx_gpio_probe(struct platform_device *pdev)
352352

353353
gc = &egc->chip.gc;
354354

355-
config = (typeof(config)){
355+
config = (struct gpio_generic_chip_config) {
356356
.dev = &pdev->dev,
357357
.sz = 1,
358358
.dat = data,

drivers/gpio/gpio-ftgpio010.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static int ftgpio_gpio_probe(struct platform_device *pdev)
264264
*/
265265
return PTR_ERR(g->clk);
266266

267-
config = (typeof(config)){
267+
config = (struct gpio_generic_chip_config) {
268268
.dev = dev,
269269
.sz = 4,
270270
.dat = g->base + GPIO_DATA_IN,

drivers/gpio/gpio-ge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
6767
if (IS_ERR(regs))
6868
return PTR_ERR(regs);
6969

70-
config = (typeof(config)){
70+
config = (struct gpio_generic_chip_config) {
7171
.dev = dev,
7272
.sz = 4,
7373
.dat = regs + GEF_GPIO_IN,

drivers/gpio/gpio-grgpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int grgpio_probe(struct platform_device *ofdev)
353353
if (IS_ERR(regs))
354354
return PTR_ERR(regs);
355355

356-
config = (typeof(config)){
356+
config = (struct gpio_generic_chip_config) {
357357
.dev = dev,
358358
.sz = 4,
359359
.dat = regs + GRGPIO_DATA,

drivers/gpio/gpio-hisi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ static int hisi_gpio_probe(struct platform_device *pdev)
292292

293293
hisi_gpio->dev = dev;
294294

295-
config = (typeof(config)){
295+
config = (struct gpio_generic_chip_config) {
296296
.dev = hisi_gpio->dev,
297297
.sz = 4,
298298
.dat = hisi_gpio->reg_base + HISI_GPIO_EXT_PORT_WX,

drivers/gpio/gpio-idt3243x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static int idt_gpio_probe(struct platform_device *pdev)
147147

148148
ctrl->chip.gc.parent = dev;
149149

150-
config = (typeof(config)){
150+
config = (struct gpio_generic_chip_config) {
151151
.dev = &pdev->dev,
152152
.sz = 4,
153153
.dat = ctrl->gpio + IDT_GPIO_DATA,

drivers/gpio/gpio-ixp4xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
294294
flags = 0;
295295
#endif
296296

297-
config = (typeof(config)){
297+
config = (struct gpio_generic_chip_config) {
298298
.dev = dev,
299299
.sz = 4,
300300
.dat = g->base + IXP4XX_REG_GPIN,

0 commit comments

Comments
 (0)