Skip to content

Commit 17a7ca3

Browse files
author
Bartosz Golaszewski
committed
gpiolib: rename the gpio_device notifier
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
1 parent 38a700e commit 17a7ca3

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

drivers/gpio/gpiolib-cdev.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static long linehandle_set_config(struct linehandle_state *lh,
230230
return ret;
231231
}
232232

233-
blocking_notifier_call_chain(&desc->gdev->notifier,
233+
blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
234234
GPIO_V2_LINE_CHANGED_CONFIG,
235235
desc);
236236
}
@@ -414,7 +414,7 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
414414
goto out_free_lh;
415415
}
416416

417-
blocking_notifier_call_chain(&desc->gdev->notifier,
417+
blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
418418
GPIO_V2_LINE_CHANGED_REQUESTED, desc);
419419

420420
dev_dbg(&gdev->dev, "registered chardev handle for line %d\n",
@@ -1407,7 +1407,7 @@ static long linereq_set_config_unlocked(struct linereq *lr,
14071407

14081408
WRITE_ONCE(line->edflags, edflags);
14091409

1410-
blocking_notifier_call_chain(&desc->gdev->notifier,
1410+
blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
14111411
GPIO_V2_LINE_CHANGED_CONFIG,
14121412
desc);
14131413
}
@@ -1720,7 +1720,7 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip)
17201720

17211721
lr->lines[i].edflags = edflags;
17221722

1723-
blocking_notifier_call_chain(&desc->gdev->notifier,
1723+
blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
17241724
GPIO_V2_LINE_CHANGED_REQUESTED, desc);
17251725

17261726
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)
21172117
if (ret)
21182118
goto out_free_le;
21192119

2120-
blocking_notifier_call_chain(&desc->gdev->notifier,
2120+
blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
21212121
GPIO_V2_LINE_CHANGED_REQUESTED, desc);
21222122

21232123
irq = gpiod_to_irq(desc);
@@ -2671,7 +2671,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
26712671
cdev->gdev = gpio_device_get(gdev);
26722672

26732673
cdev->lineinfo_changed_nb.notifier_call = lineinfo_changed_notify;
2674-
ret = blocking_notifier_chain_register(&gdev->notifier,
2674+
ret = blocking_notifier_chain_register(&gdev->line_state_notifier,
26752675
&cdev->lineinfo_changed_nb);
26762676
if (ret)
26772677
goto out_free_bitmap;
@@ -2687,7 +2687,7 @@ static int gpio_chrdev_open(struct inode *inode, struct file *file)
26872687
return ret;
26882688

26892689
out_unregister_notifier:
2690-
blocking_notifier_chain_unregister(&gdev->notifier,
2690+
blocking_notifier_chain_unregister(&gdev->line_state_notifier,
26912691
&cdev->lineinfo_changed_nb);
26922692
out_free_bitmap:
26932693
gpio_device_put(gdev);
@@ -2711,7 +2711,7 @@ static int gpio_chrdev_release(struct inode *inode, struct file *file)
27112711
struct gpio_device *gdev = cdev->gdev;
27122712

27132713
bitmap_free(cdev->watched_lines);
2714-
blocking_notifier_chain_unregister(&gdev->notifier,
2714+
blocking_notifier_chain_unregister(&gdev->line_state_notifier,
27152715
&cdev->lineinfo_changed_nb);
27162716
gpio_device_put(gdev);
27172717
kfree(cdev);

drivers/gpio/gpiolib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
847847

848848
spin_unlock_irqrestore(&gpio_lock, flags);
849849

850-
BLOCKING_INIT_NOTIFIER_HEAD(&gdev->notifier);
850+
BLOCKING_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);
851851
init_rwsem(&gdev->sem);
852852

853853
#ifdef CONFIG_PINCTRL
@@ -2177,7 +2177,7 @@ static bool gpiod_free_commit(struct gpio_desc *desc)
21772177
}
21782178

21792179
spin_unlock_irqrestore(&gpio_lock, flags);
2180-
blocking_notifier_call_chain(&desc->gdev->notifier,
2180+
blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
21812181
GPIOLINE_CHANGED_RELEASED, desc);
21822182

21832183
return ret;
@@ -4007,7 +4007,7 @@ static struct gpio_desc *gpiod_find_and_request(struct device *consumer,
40074007
return ERR_PTR(ret);
40084008
}
40094009

4010-
blocking_notifier_call_chain(&desc->gdev->notifier,
4010+
blocking_notifier_call_chain(&desc->gdev->line_state_notifier,
40114011
GPIOLINE_CHANGED_REQUESTED, desc);
40124012

40134013
return desc;

drivers/gpio/gpiolib.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
* or name of the IP component in a System on Chip.
4040
* @data: per-instance data assigned by the driver
4141
* @list: links gpio_device:s together for traversal
42-
* @notifier: used to notify subscribers about lines being requested, released
43-
* or reconfigured
42+
* @line_state_notifier: used to notify subscribers about lines being
43+
* requested, released or reconfigured
4444
* @sem: protects the structure from a NULL-pointer dereference of @chip by
4545
* user-space operations when the device gets unregistered during
4646
* a hot-unplug event
@@ -64,7 +64,7 @@ struct gpio_device {
6464
const char *label;
6565
void *data;
6666
struct list_head list;
67-
struct blocking_notifier_head notifier;
67+
struct blocking_notifier_head line_state_notifier;
6868
struct rw_semaphore sem;
6969

7070
#ifdef CONFIG_PINCTRL

0 commit comments

Comments
 (0)