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.

Merge tag 'gpio-v5.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
"Here is a (hopefully last) set of GPIO fixes for the v5.3 kernel
cycle. Two are pretty core:

- Fix not reporting open drain/source lines to userspace as "input"

- Fix a minor build error found in randconfigs

- Fix a chip select quirk on the Freescale SPI

- Fix the irqchip initialization semantic order to reflect what it
was using the old API"

* tag 'gpio-v5.3-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
gpio: Fix irqchip initialization order
gpio: of: fix Freescale SPI CS quirk handling
gpio: Fix build error of function redefinition
gpiolib: never report open-drain/source lines as 'input' to user-space

+20 -42
+1 -1
drivers/gpio/gpiolib-of.c
··· 363 363 /* Special handling for SPI GPIOs if used */ 364 364 if (IS_ERR(desc)) 365 365 desc = of_find_spi_gpio(dev, con_id, &of_flags); 366 - if (IS_ERR(desc)) { 366 + if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) { 367 367 /* This quirk looks up flags and all */ 368 368 desc = of_find_spi_cs_gpio(dev, con_id, idx, flags); 369 369 if (!IS_ERR(desc))
+19 -17
drivers/gpio/gpiolib.c
··· 1091 1091 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) 1092 1092 lineinfo.flags |= GPIOLINE_FLAG_ACTIVE_LOW; 1093 1093 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) 1094 - lineinfo.flags |= GPIOLINE_FLAG_OPEN_DRAIN; 1094 + lineinfo.flags |= (GPIOLINE_FLAG_OPEN_DRAIN | 1095 + GPIOLINE_FLAG_IS_OUT); 1095 1096 if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) 1096 - lineinfo.flags |= GPIOLINE_FLAG_OPEN_SOURCE; 1097 + lineinfo.flags |= (GPIOLINE_FLAG_OPEN_SOURCE | 1098 + GPIOLINE_FLAG_IS_OUT); 1097 1099 1098 1100 if (copy_to_user(ip, &lineinfo, sizeof(lineinfo))) 1099 1101 return -EFAULT; ··· 1373 1371 if (status) 1374 1372 goto err_remove_from_list; 1375 1373 1376 - status = gpiochip_irqchip_init_valid_mask(chip); 1374 + status = gpiochip_alloc_valid_mask(chip); 1377 1375 if (status) 1378 1376 goto err_remove_from_list; 1379 1377 1380 - status = gpiochip_alloc_valid_mask(chip); 1381 - if (status) 1382 - goto err_remove_irqchip_mask; 1383 - 1384 - status = gpiochip_add_irqchip(chip, lock_key, request_key); 1385 - if (status) 1386 - goto err_free_gpiochip_mask; 1387 - 1388 1378 status = of_gpiochip_add(chip); 1389 1379 if (status) 1390 - goto err_remove_chip; 1380 + goto err_free_gpiochip_mask; 1391 1381 1392 1382 status = gpiochip_init_valid_mask(chip); 1393 1383 if (status) ··· 1405 1411 1406 1412 machine_gpiochip_add(chip); 1407 1413 1414 + status = gpiochip_irqchip_init_valid_mask(chip); 1415 + if (status) 1416 + goto err_remove_acpi_chip; 1417 + 1418 + status = gpiochip_add_irqchip(chip, lock_key, request_key); 1419 + if (status) 1420 + goto err_remove_irqchip_mask; 1421 + 1408 1422 /* 1409 1423 * By first adding the chardev, and then adding the device, 1410 1424 * we get a device node entry in sysfs under ··· 1424 1422 if (gpiolib_initialized) { 1425 1423 status = gpiochip_setup_dev(gdev); 1426 1424 if (status) 1427 - goto err_remove_acpi_chip; 1425 + goto err_remove_irqchip; 1428 1426 } 1429 1427 return 0; 1430 1428 1429 + err_remove_irqchip: 1430 + gpiochip_irqchip_remove(chip); 1431 + err_remove_irqchip_mask: 1432 + gpiochip_irqchip_free_valid_mask(chip); 1431 1433 err_remove_acpi_chip: 1432 1434 acpi_gpiochip_remove(chip); 1433 1435 err_remove_of_chip: 1434 1436 gpiochip_free_hogs(chip); 1435 1437 of_gpiochip_remove(chip); 1436 - err_remove_chip: 1437 - gpiochip_irqchip_remove(chip); 1438 1438 err_free_gpiochip_mask: 1439 1439 gpiochip_free_valid_mask(chip); 1440 - err_remove_irqchip_mask: 1441 - gpiochip_irqchip_free_valid_mask(chip); 1442 1440 err_remove_from_list: 1443 1441 spin_lock_irqsave(&gpio_lock, flags); 1444 1442 list_del(&gdev->list);
-24
include/linux/gpio.h
··· 241 241 return -EINVAL; 242 242 } 243 243 244 - static inline int 245 - gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, 246 - unsigned int gpio_offset, unsigned int pin_offset, 247 - unsigned int npins) 248 - { 249 - WARN_ON(1); 250 - return -EINVAL; 251 - } 252 - 253 - static inline int 254 - gpiochip_add_pingroup_range(struct gpio_chip *chip, 255 - struct pinctrl_dev *pctldev, 256 - unsigned int gpio_offset, const char *pin_group) 257 - { 258 - WARN_ON(1); 259 - return -EINVAL; 260 - } 261 - 262 - static inline void 263 - gpiochip_remove_pin_ranges(struct gpio_chip *chip) 264 - { 265 - WARN_ON(1); 266 - } 267 - 268 244 static inline int devm_gpio_request(struct device *dev, unsigned gpio, 269 245 const char *label) 270 246 {