gpiolib: rename the gpio_device notifier
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 17 Aug 2023 08:52:28 +0000 (10:52 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 21 Aug 2023 13:57:05 +0000 (15:57 +0200)
Change the generic "notifier" name to "line_state_notifier" in order to
reflect its purpose in preparation for adding a second notifier which
will be used to notify wait queues about device unregistering.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
drivers/gpio/gpiolib-cdev.c
drivers/gpio/gpiolib.c
drivers/gpio/gpiolib.h

index 0a33971c964c5768555ffce3b4d6eb60e797aae3..9ee8604f32e163d62e9a65dce202264e734eb243 100644 (file)
@@ -230,7 +230,7 @@ static long linehandle_set_config(struct linehandle_state *lh,
                                return ret;
                }
 
-               blocking_notifier_call_chain(&desc->gdev->notifier,
+               blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
                                             GPIO_V2_LINE_CHANGED_CONFIG,
                                             desc);
        }
@@ -414,7 +414,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
                                goto out_free_lh;
                }
 
-               blocking_notifier_call_chain(&desc->gdev->notifier,
+               blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
                                             GPIO_V2_LINE_CHANGED_REQUESTED, desc);
 
                dev_dbg(&gdev->dev, "registered chardev handle for line %d\n",
@@ -1407,7 +1407,7 @@ static long linereq_set_config_unlocked(struct linereq *lr,
 
                WRITE_ONCE(line->edflags, edflags);
 
-               blocking_notifier_call_chain(&desc->gdev->notifier,
+               blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
                                             GPIO_V2_LINE_CHANGED_CONFIG,
                                             desc);
        }
@@ -1720,7 +1720,7 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip)
 
                lr->lines[i].edflags = edflags;
 
-               blocking_notifier_call_chain(&desc->gdev->notifier,
+               blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
                                             GPIO_V2_LINE_CHANGED_REQUESTED, desc);
 
                dev_dbg(&gdev->dev, "registered chardev handle for line %d\n",
@@ -2117,7 +2117,7 @@ static int lineevent_create(struct gpio_device *gdev, void __user *ip)
        if (ret)
                goto out_free_le;
 
-       blocking_notifier_call_chain(&desc->gdev->notifier,
+       blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
                                     GPIO_V2_LINE_CHANGED_REQUESTED, desc);
 
        irq = gpiod_to_irq(desc);
@@ -2671,7 +2671,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
        cdev->gdev = gpio_device_get(gdev);
 
        cdev->lineinfo_changed_nb.notifier_call = lineinfo_changed_notify;
-       ret = blocking_notifier_chain_register(&gdev->notifier,
+       ret = blocking_notifier_chain_register(&gdev->line_state_notifier,
                                               &cdev->lineinfo_changed_nb);
        if (ret)
                goto out_free_bitmap;
@@ -2687,7 +2687,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
        return ret;
 
 out_unregister_notifier:
-       blocking_notifier_chain_unregister(&gdev->notifier,
+       blocking_notifier_chain_unregister(&gdev->line_state_notifier,
                                           &cdev->lineinfo_changed_nb);
 out_free_bitmap:
        gpio_device_put(gdev);
@@ -2711,7 +2711,7 @@ static int gpio_chrdev_release(struct inode *inode, struct file *file)
        struct gpio_device *gdev = cdev->gdev;
 
        bitmap_free(cdev->watched_lines);
-       blocking_notifier_chain_unregister(&gdev->notifier,
+       blocking_notifier_chain_unregister(&gdev->line_state_notifier,
                                           &cdev->lineinfo_changed_nb);
        gpio_device_put(gdev);
        kfree(cdev);
index edab00c9cb3c4425cb0c103f2974d8624b225b5f..38640df1d7988928ad1fe23a02fbfa3e38257b94 100644 (file)
@@ -847,7 +847,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
 
        spin_unlock_irqrestore(&gpio_lock, flags);
 
-       BLOCKING_INIT_NOTIFIER_HEAD(&gdev->notifier);
+       BLOCKING_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);
        init_rwsem(&gdev->sem);
 
 #ifdef CONFIG_PINCTRL
@@ -2177,7 +2177,7 @@ static bool gpiod_free_commit(struct gpio_desc *desc)
        }
 
        spin_unlock_irqrestore(&gpio_lock, flags);
-       blocking_notifier_call_chain(&desc->gdev->notifier,
+       blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
                                     GPIOLINE_CHANGED_RELEASED, desc);
 
        return ret;
@@ -4007,7 +4007,7 @@ static struct gpio_desc *gpiod_find_and_request(struct device *consumer,
                return ERR_PTR(ret);
        }
 
-       blocking_notifier_call_chain(&desc->gdev->notifier,
+       blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
                                     GPIOLINE_CHANGED_REQUESTED, desc);
 
        return desc;
index 08e8e827488390af42ccbd6327ebd14a8100113f..11a5e02f317d5f3b8cd7503e3743d1639ab3aecc 100644 (file)
@@ -39,8 +39,8 @@
  * or name of the IP component in a System on Chip.
  * @data: per-instance data assigned by the driver
  * @list: links gpio_device:s together for traversal
- * @notifier: used to notify subscribers about lines being requested, released
- *            or reconfigured
+ * @line_state_notifier: used to notify subscribers about lines being
+ *                       requested, released or reconfigured
  * @sem: protects the structure from a NULL-pointer dereference of @chip by
  *       user-space operations when the device gets unregistered during
  *       a hot-unplug event
@@ -64,7 +64,7 @@ struct gpio_device {
        const char              *label;
        void                    *data;
        struct list_head        list;
-       struct blocking_notifier_head notifier;
+       struct blocking_notifier_head line_state_notifier;
        struct rw_semaphore     sem;
 
 #ifdef CONFIG_PINCTRL