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>
This commit is contained in:
parent
4c91b0ee35
commit
7eee64e8be
|
@ -88,7 +88,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(pt_gpio->reg_base);
|
||||
}
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = pt_gpio->reg_base + PT_INPUTDATA_REG,
|
||||
|
|
|
@ -230,7 +230,7 @@ static int blzp1600_gpio_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(chip->base))
|
||||
return PTR_ERR(chip->base);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = &pdev->dev,
|
||||
.sz = 4,
|
||||
.dat = chip->base + GPIO_IDATA_REG,
|
||||
|
|
|
@ -525,7 +525,7 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
|
|||
set = gpio->regs + GPIO_SWPORTA_DR + pp->idx * GPIO_SWPORT_DR_STRIDE;
|
||||
dirout = gpio->regs + GPIO_SWPORTA_DDR + pp->idx * GPIO_SWPORT_DDR_STRIDE;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = gpio->dev,
|
||||
.sz = 4,
|
||||
.dat = dat,
|
||||
|
|
|
@ -352,7 +352,7 @@ static int ep93xx_gpio_probe(struct platform_device *pdev)
|
|||
|
||||
gc = &egc->chip.gc;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = &pdev->dev,
|
||||
.sz = 1,
|
||||
.dat = data,
|
||||
|
|
|
@ -264,7 +264,7 @@ static int ftgpio_gpio_probe(struct platform_device *pdev)
|
|||
*/
|
||||
return PTR_ERR(g->clk);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = g->base + GPIO_DATA_IN,
|
||||
|
|
|
@ -67,7 +67,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(regs))
|
||||
return PTR_ERR(regs);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = regs + GEF_GPIO_IN,
|
||||
|
|
|
@ -353,7 +353,7 @@ static int grgpio_probe(struct platform_device *ofdev)
|
|||
if (IS_ERR(regs))
|
||||
return PTR_ERR(regs);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = regs + GRGPIO_DATA,
|
||||
|
|
|
@ -292,7 +292,7 @@ static int hisi_gpio_probe(struct platform_device *pdev)
|
|||
|
||||
hisi_gpio->dev = dev;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = hisi_gpio->dev,
|
||||
.sz = 4,
|
||||
.dat = hisi_gpio->reg_base + HISI_GPIO_EXT_PORT_WX,
|
||||
|
|
|
@ -147,7 +147,7 @@ static int idt_gpio_probe(struct platform_device *pdev)
|
|||
|
||||
ctrl->chip.gc.parent = dev;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = &pdev->dev,
|
||||
.sz = 4,
|
||||
.dat = ctrl->gpio + IDT_GPIO_DATA,
|
||||
|
|
|
@ -294,7 +294,7 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)
|
|||
flags = 0;
|
||||
#endif
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = g->base + IXP4XX_REG_GPIN,
|
||||
|
|
|
@ -292,7 +292,7 @@ static int loongson_gpio_init(struct platform_device *pdev, struct loongson_gpio
|
|||
|
||||
lgpio->reg_base = reg_base;
|
||||
if (lgpio->chip_data->mode == BIT_CTRL_MODE) {
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = &pdev->dev,
|
||||
.sz = 8,
|
||||
.dat = lgpio->reg_base + lgpio->chip_data->in_offset,
|
||||
|
|
|
@ -66,7 +66,7 @@ static int mlxbf_gpio_probe(struct platform_device *pdev)
|
|||
|
||||
gc = &gs->chip.gc;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 8,
|
||||
.dat = gs->base + MLXBF_GPIO_PIN_STATE,
|
||||
|
|
|
@ -377,7 +377,7 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
|
|||
|
||||
gc = &gs->chip.gc;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = gs->gpio_io + YU_GPIO_DATAIN,
|
||||
|
|
|
@ -209,7 +209,7 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
|
|||
return PTR_ERR(gs->gpio_clr_io);
|
||||
gc = &gs->chip.gc;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = gs->gpio_io + MLXBF_GPIO_READ_DATA_IN,
|
||||
|
|
|
@ -345,7 +345,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
|
|||
gc = &mpc8xxx_gc->chip.gc;
|
||||
gc->parent = dev;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = mpc8xxx_gc->regs + GPIO_DAT,
|
||||
|
|
|
@ -321,7 +321,7 @@ static int mxs_gpio_probe(struct platform_device *pdev)
|
|||
irq_set_chained_handler_and_data(port->irq, mxs_gpio_irq_handler,
|
||||
port);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = &pdev->dev,
|
||||
.sz = 4,
|
||||
.dat = port->base + PINCTRL_DIN(port),
|
||||
|
|
|
@ -237,7 +237,7 @@ static int rda_gpio_probe(struct platform_device *pdev)
|
|||
|
||||
spin_lock_init(&rda_gpio->lock);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = rda_gpio->base + RDA_GPIO_VAL,
|
||||
|
|
|
@ -401,7 +401,7 @@ static int realtek_gpio_probe(struct platform_device *pdev)
|
|||
ctrl->line_imr_pos = realtek_gpio_line_imr_pos_swapped;
|
||||
}
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = ctrl->base + REALTEK_GPIO_REG_DATA,
|
||||
|
|
|
@ -135,7 +135,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
|
|||
* the lines, no special set or clear registers and a data direction register
|
||||
* wher 1 means "output".
|
||||
*/
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = tb10x_gpio->base + OFFSET_TO_REG_DATA,
|
||||
|
|
|
@ -39,7 +39,7 @@ static int ts4800_gpio_probe(struct platform_device *pdev)
|
|||
else if (retval)
|
||||
return retval;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 2,
|
||||
.dat = base_addr + INPUT_REG_OFFSET,
|
||||
|
|
|
@ -305,7 +305,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
|
|||
if (port->sdata->have_paddr)
|
||||
flags |= BGPIOF_READ_OUTPUT_REG_SET;
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = port->gpio_base + GPIO_PDIR,
|
||||
|
|
|
@ -191,7 +191,7 @@ static int visconti_gpio_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = priv->base + GPIO_IDATA,
|
||||
|
|
|
@ -265,7 +265,7 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = &pdev->dev,
|
||||
.sz = 4,
|
||||
.dat = regs + MPA_GPIO_IN_ADDR,
|
||||
|
|
|
@ -233,7 +233,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
|
|||
if (IS_ERR(chip->base))
|
||||
return PTR_ERR(chip->base);
|
||||
|
||||
config = (typeof(config)){
|
||||
config = (struct gpio_generic_chip_config) {
|
||||
.dev = dev,
|
||||
.sz = 4,
|
||||
.dat = chip->base + IPROC_GPIO_CCA_DIN,
|
||||
|
|
Loading…
Reference in New Issue