Skip to content

Commit e82bbd6

Browse files
author
Bartosz Golaszewski
committed
gpio: cdev: open-code to_gpio_chardev_data()
This function is a wrapper around container_of(). It's used only once and we will have a second notifier soon, so instead of having two flavors of this helper, let's just open-code where needed. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Reviewed-by: Kent Gibson <[email protected]>
1 parent 17a7ca3 commit e82bbd6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/gpio/gpiolib-cdev.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,16 +2491,11 @@ static long gpio_ioctl_compat(struct file *file, unsigned int cmd,
24912491
}
24922492
#endif
24932493

2494-
static struct gpio_chardev_data *
2495-
to_gpio_chardev_data(struct notifier_block *nb)
2496-
{
2497-
return container_of(nb, struct gpio_chardev_data, lineinfo_changed_nb);
2498-
}
2499-
25002494
static int lineinfo_changed_notify(struct notifier_block *nb,
25012495
unsigned long action, void *data)
25022496
{
2503-
struct gpio_chardev_data *cdev = to_gpio_chardev_data(nb);
2497+
struct gpio_chardev_data *cdev =
2498+
container_of(nb, struct gpio_chardev_data, lineinfo_changed_nb);
25042499
struct gpio_v2_line_info_changed chg;
25052500
struct gpio_desc *desc = data;
25062501
int ret;

0 commit comments

Comments
 (0)