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.

gpio: tegra186: Simplify GPIO line name prefix handling

Introduce TEGRA_GPIO_PREFIX() to define the Tegra SoC GPIO name
prefix in one place. Use it for the Tegra410 COMPUTE and SYSTEM
controllers so the prefix is "COMPUTE-" and "SYSTEM-" respectively.

Signed-off-by: Prathamesh Shete <pshete@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/20260217081431.1208351-1-pshete@nvidia.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Prathamesh Shete and committed by
Bartosz Golaszewski
2423e336 96c02c90

+7 -8
+7 -8
drivers/gpio/gpio-tegra186.c
··· 942 942 char *name; 943 943 944 944 for (j = 0; j < port->pins; j++) { 945 - if (gpio->soc->prefix) 946 - name = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL, "%s-P%s.%02x", 947 - gpio->soc->prefix, port->name, j); 948 - else 949 - name = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL, "P%s.%02x", 950 - port->name, j); 945 + name = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL, "%sP%s.%02x", 946 + gpio->soc->prefix ?: "", port->name, j); 951 947 if (!name) 952 948 return -ENOMEM; 953 949 ··· 1369 1373 .has_vm_support = true, 1370 1374 }; 1371 1375 1376 + /* Macro to define GPIO name prefix with separator */ 1377 + #define TEGRA_GPIO_PREFIX(_x) _x "-" 1378 + 1372 1379 #define TEGRA410_COMPUTE_GPIO_PORT(_name, _bank, _port, _pins) \ 1373 1380 TEGRA_GPIO_PORT(TEGRA410_COMPUTE, _name, _bank, _port, _pins) 1374 1381 ··· 1387 1388 .num_ports = ARRAY_SIZE(tegra410_compute_ports), 1388 1389 .ports = tegra410_compute_ports, 1389 1390 .name = "tegra410-gpio-compute", 1390 - .prefix = "COMPUTE", 1391 + .prefix = TEGRA_GPIO_PREFIX("COMPUTE"), 1391 1392 .num_irqs_per_bank = 8, 1392 1393 .instance = 0, 1393 1394 }; ··· 1417 1418 .num_ports = ARRAY_SIZE(tegra410_system_ports), 1418 1419 .ports = tegra410_system_ports, 1419 1420 .name = "tegra410-gpio-system", 1420 - .prefix = "SYSTEM", 1421 + .prefix = TEGRA_GPIO_PREFIX("SYSTEM"), 1421 1422 .num_irqs_per_bank = 8, 1422 1423 .instance = 0, 1423 1424 };