History

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

Linus Torvalds committed 7 years ago

Commit 083f0f22 parents 3614692 48057ed3 files · +20 −42Browse files

Unified · Split

3 files
  1. drivers/gpio/gpiolib-of.c +1 −1
  2. drivers/gpio/gpiolib.c +19 −17
  3. include/linux/gpio.h +0 −24
drivers/gpio/gpiolib-of.c+1−1
@@ -363,7 +363,7 @@ struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id, · 362 unmodified lines
363 /* Special handling for SPI GPIOs if used */363 /* Special handling for SPI GPIOs if used */
364 if (IS_ERR(desc))364 if (IS_ERR(desc))
365 desc = of_find_spi_gpio(dev, con_id, &of_flags);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 /* This quirk looks up flags and all */367 /* This quirk looks up flags and all */
368 desc = of_find_spi_cs_gpio(dev, con_id, idx, flags);368 desc = of_find_spi_cs_gpio(dev, con_id, idx, flags);
369 if (!IS_ERR(desc))369 if (!IS_ERR(desc))
drivers/gpio/gpiolib.c+19−17
@@ -1091,9 +1091,11 @@ static long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 1090 unmodified lines
1091 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags))1091 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags))
1092 lineinfo.flags |= GPIOLINE_FLAG_ACTIVE_LOW;1092 lineinfo.flags |= GPIOLINE_FLAG_ACTIVE_LOW;
1093 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags))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 if (test_bit(FLAG_OPEN_SOURCE, &desc->flags))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 if (copy_to_user(ip, &lineinfo, sizeof(lineinfo)))1100 if (copy_to_user(ip, &lineinfo, sizeof(lineinfo)))
1099 return -EFAULT;1101 return -EFAULT;
@@ -1371,21 +1373,13 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 271 unmodified lines
1371 if (status)1373 if (status)
1372 goto err_remove_from_list;1374 goto err_remove_from_list;
1373 1375
1374 status = gpiochip_irqchip_init_valid_mask(chip);
1375 if (status)
1376 goto err_remove_from_list;
1377
1378 status = gpiochip_alloc_valid_mask(chip);1376 status = gpiochip_alloc_valid_mask(chip);
1379 if (status)1377 if (status)
1380 goto err_remove_irqchip_mask;1378 goto err_remove_from_list;
1381
1382 status = gpiochip_add_irqchip(chip, lock_key, request_key);
1383 if (status)
1384 goto err_free_gpiochip_mask;
1385 1379
1386 status = of_gpiochip_add(chip);1380 status = of_gpiochip_add(chip);
1387 if (status)1381 if (status)
1388 goto err_remove_chip;1382 goto err_free_gpiochip_mask;
1389 1383
1390 status = gpiochip_init_valid_mask(chip);1384 status = gpiochip_init_valid_mask(chip);
1391 if (status)1385 if (status)
@@ -1411,6 +1405,14 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 19 unmodified lines
1411 1405
1412 machine_gpiochip_add(chip);1406 machine_gpiochip_add(chip);
1413 1407
1408 status = gpiochip_irqchip_init_valid_mask(chip);
1409 if (status)
1410 goto err_remove_acpi_chip;
1411
1412 status = gpiochip_add_irqchip(chip, lock_key, request_key);
1413 if (status)
1414 goto err_remove_irqchip_mask;
1415
1414 /*1416 /*
1415 * By first adding the chardev, and then adding the device,1417 * By first adding the chardev, and then adding the device,
1416 * we get a device node entry in sysfs under1418 * we get a device node entry in sysfs under
@@ -1422,21 +1424,21 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 5 unmodified lines
1422 if (gpiolib_initialized) {1424 if (gpiolib_initialized) {
1423 status = gpiochip_setup_dev(gdev);1425 status = gpiochip_setup_dev(gdev);
1424 if (status)1426 if (status)
1425 goto err_remove_acpi_chip;1427 goto err_remove_irqchip;
1426 }1428 }
1427 return 0;1429 return 0;
1428 1430
1431err_remove_irqchip:
1432 gpiochip_irqchip_remove(chip);
1433err_remove_irqchip_mask:
1434 gpiochip_irqchip_free_valid_mask(chip);
1429err_remove_acpi_chip:1435err_remove_acpi_chip:
1430 acpi_gpiochip_remove(chip);1436 acpi_gpiochip_remove(chip);
1431err_remove_of_chip:1437err_remove_of_chip:
1432 gpiochip_free_hogs(chip);1438 gpiochip_free_hogs(chip);
1433 of_gpiochip_remove(chip);1439 of_gpiochip_remove(chip);
1434err_remove_chip:
1435 gpiochip_irqchip_remove(chip);
1436err_free_gpiochip_mask:1440err_free_gpiochip_mask:
1437 gpiochip_free_valid_mask(chip);1441 gpiochip_free_valid_mask(chip);
1438err_remove_irqchip_mask:
1439 gpiochip_irqchip_free_valid_mask(chip);
1440err_remove_from_list:1442err_remove_from_list:
1441 spin_lock_irqsave(&gpio_lock, flags);1443 spin_lock_irqsave(&gpio_lock, flags);
1442 list_del(&gdev->list);1444 list_del(&gdev->list);
include/linux/gpio.h+0−24
@@ -241,30 +241,6 @@ static inline int irq_to_gpio(unsigned irq) · 240 unmodified lines
241 return -EINVAL;241 return -EINVAL;
242}242}
243 243
244static inline int
245gpiochip_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
253static inline int
254gpiochip_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
262static inline void
263gpiochip_remove_pin_ranges(struct gpio_chip *chip)
264{
265 WARN_ON(1);
266}
267
268static inline int devm_gpio_request(struct device *dev, unsigned gpio,244static inline int devm_gpio_request(struct device *dev, unsigned gpio,
269 const char *label)245 const char *label)
270{246{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t