gpio/pinctrl: replace gpiochip_is_requested() with a safer interface
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest10 patches 8 repliesIn review
- v210 patches 16 repliesSuperseded
- v110 patches 6 repliesSuperseded
Changes in v3 from the cover letter
- rename a local variable cpy -> copy
- use unsigned int to loop over GPIO lines
- use an unscoped guard in patch 10/10 instead of the scoped variant
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | gpiolib: provide gpiochip_dup_line_label()drivers/ include/ | +30 | 0 replies | |
| 2/10 | gpio: wm831x: use gpiochip_dup_line_label()drivers/ | +9 | 2 replies | |
| 3/10 | gpio: wm8994: use gpiochip_dup_line_label()drivers/ | +8 | 0 replies | |
| 4/10 | gpio: stmpe: use gpiochip_dup_line_label()drivers/ | +5 | 0 replies | |
| 5/10 | pinctrl: abx500: use gpiochip_dup_line_label()drivers/ | +7 | 0 replies | |
| 6/10 | pinctrl: nomadik: use gpiochip_dup_line_label()drivers/ | +5 | 0 replies | |
| 7/10 | pinctrl: baytrail: use gpiochip_dup_line_label()drivers/ | +6 | 2 replies | |
| 8/10 | pinctrl: sppctl: use gpiochip_dup_line_label()drivers/ | +5 | 0 replies | |
| 9/10 | gpiolib: use gpiochip_dup_line_label() in for_each helpersinclude/ | +29 | 2 replies | |
| 10/10 | gpiolib: remove gpiochip_is_requested()drivers/ include/ | +13 | 1 reply |
Reviews trailers per patch
1 of 10 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Andy Shevchenko | Linus Walleij |
|---|---|---|
| Series | A-b | |
| 1/10 | ||
| 2/10 | ||
| 3/10 | ||
| 4/10 | ||
| 5/10 | ||
| 6/10 | ||
| 7/10 | R-b | |
| 8/10 | ||
| 9/10 | ||
| 10/10 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 00/10] gpio/pinctrl: replace gpiochip_is_requested() with a safer interface
From: Bartosz Golaszewski <[email protected]>
While reworking the locking in GPIOLIB I realized that locking the descriptor with users still calling gpiochip_is_requested() will still be buggy as it returns a pointer to a string that can be freed whenever the descriptor is released. Let's provide a safer alternative in the form of a function that returns a copy of the label.
Use it in all drivers and remove gpiochip_is_requested().
I plan to provide this series in an immutable branch for the pinctrl and baytrail trees to pull.
v2 -> v3:
- rename a local variable cpy -> copy
- use unsigned int to loop over GPIO lines
- use an unscoped guard in patch 10/10 instead of the scoped variant
v1 -> v2:
- use DEFINE_CLASS() to register a destructor for making sure that the duplicated label doesn't leak out of the for_each loops even with break;
Bartosz Golaszewski (10):
gpiolib: provide gpiochip_dup_line_label()
gpio: wm831x: use gpiochip_dup_line_label()
gpio: wm8994: use gpiochip_dup_line_label()
gpio: stmpe: use gpiochip_dup_line_label()
pinctrl: abx500: use gpiochip_dup_line_label()
pinctrl: nomadik: use gpiochip_dup_line_label()
pinctrl: baytrail: use gpiochip_dup_line_label()
pinctrl: sppctl: use gpiochip_dup_line_label()
gpiolib: use gpiochip_dup_line_label() in for_each helpers
gpiolib: remove gpiochip_is_requested()
drivers/gpio/gpio-stmpe.c | 6 +++- drivers/gpio/gpio-wm831x.c | 14 +++++--- drivers/gpio/gpio-wm8994.c | 13 +++++--- drivers/gpio/gpiolib.c | 35 ++++++++++++-------- drivers/pinctrl/intel/pinctrl-baytrail.c | 11 ++++--- drivers/pinctrl/nomadik/pinctrl-abx500.c | 9 ++++-- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 6 +++- drivers/pinctrl/sunplus/sppctl.c | 10 +++--- include/linux/gpio/driver.h | 39 +++++++++++++++++------ 9 files changed, 96 insertions(+), 47 deletions(-)
Signature · 1 line
2.40.1