Skip to content

Commit 13e856b

Browse files
andy-shevBartosz Golaszewski
authored andcommitted
gpio: xilinx: Remove duplicate assignment of of_gpio_n_cells
The of_gpio_n_cells default is 2 when ->of_xlate() callback is not defined. No need to assign it explicitly in the driver. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 3c0c7b1 commit 13e856b

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

drivers/gpio/gpio-xilinx.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,6 @@ static int xgpio_probe(struct platform_device *pdev)
558558
int status = 0;
559559
struct device_node *np = pdev->dev.of_node;
560560
u32 is_dual = 0;
561-
u32 cells = 2;
562561
u32 width[2];
563562
u32 state[2];
564563
u32 dir[2];
@@ -591,15 +590,6 @@ static int xgpio_probe(struct platform_device *pdev)
591590

592591
bitmap_from_arr32(chip->dir, dir, 64);
593592

594-
/* Update cells with gpio-cells value */
595-
if (of_property_read_u32(np, "#gpio-cells", &cells))
596-
dev_dbg(&pdev->dev, "Missing gpio-cells property\n");
597-
598-
if (cells != 2) {
599-
dev_err(&pdev->dev, "#gpio-cells mismatch\n");
600-
return -EINVAL;
601-
}
602-
603593
/*
604594
* Check device node and parent device node for device width
605595
* and assume default width of 32
@@ -630,7 +620,6 @@ static int xgpio_probe(struct platform_device *pdev)
630620
chip->gc.parent = &pdev->dev;
631621
chip->gc.direction_input = xgpio_dir_in;
632622
chip->gc.direction_output = xgpio_dir_out;
633-
chip->gc.of_gpio_n_cells = cells;
634623
chip->gc.get = xgpio_get;
635624
chip->gc.set = xgpio_set;
636625
chip->gc.request = xgpio_request;

0 commit comments

Comments
 (0)