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-fixes-for-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fix from Bartosz Golaszewski:

- fix a configfs attribute of the gpio-sim module

* tag 'gpio-fixes-for-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
gpio: sim: fix the chip_name configfs item

+5 -11
+5 -11
drivers/gpio/gpio-sim.c
··· 991 991 }; 992 992 993 993 struct gpio_sim_chip_name_ctx { 994 - struct gpio_sim_device *dev; 994 + struct fwnode_handle *swnode; 995 995 char *page; 996 996 }; 997 997 998 998 static int gpio_sim_emit_chip_name(struct device *dev, void *data) 999 999 { 1000 1000 struct gpio_sim_chip_name_ctx *ctx = data; 1001 - struct fwnode_handle *swnode; 1002 - struct gpio_sim_bank *bank; 1003 1001 1004 1002 /* This would be the sysfs device exported in /sys/class/gpio. */ 1005 1003 if (dev->class) 1006 1004 return 0; 1007 1005 1008 - swnode = dev_fwnode(dev); 1006 + if (device_match_fwnode(dev, ctx->swnode)) 1007 + return sprintf(ctx->page, "%s\n", dev_name(dev)); 1009 1008 1010 - list_for_each_entry(bank, &ctx->dev->bank_list, siblings) { 1011 - if (bank->swnode == swnode) 1012 - return sprintf(ctx->page, "%s\n", dev_name(dev)); 1013 - } 1014 - 1015 - return -ENODATA; 1009 + return 0; 1016 1010 } 1017 1011 1018 1012 static ssize_t gpio_sim_bank_config_chip_name_show(struct config_item *item, ··· 1014 1020 { 1015 1021 struct gpio_sim_bank *bank = to_gpio_sim_bank(item); 1016 1022 struct gpio_sim_device *dev = gpio_sim_bank_get_device(bank); 1017 - struct gpio_sim_chip_name_ctx ctx = { dev, page }; 1023 + struct gpio_sim_chip_name_ctx ctx = { bank->swnode, page }; 1018 1024 int ret; 1019 1025 1020 1026 mutex_lock(&dev->lock);