From: Bartosz Golaszewski Date: Thu, 17 Aug 2023 11:42:34 +0000 (+0200) Subject: gpio: cdev: open-code to_gpio_chardev_data() X-Git-Tag: v6.6-rc1~164^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e82bbd6761f7e313141c4033ebb79e3d397b6a9c;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Linus Walleij Reviewed-by: Kent Gibson --- diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index 9ee8604f32e16..91bdd3b928b56 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -2491,16 +2491,11 @@ static long gpio_ioctl_compat(struct file *file, unsigned int cmd, } #endif -static struct gpio_chardev_data * -to_gpio_chardev_data(struct notifier_block *nb) -{ - return container_of(nb, struct gpio_chardev_data, lineinfo_changed_nb); -} - static int lineinfo_changed_notify(struct notifier_block *nb, unsigned long action, void *data) { - struct gpio_chardev_data *cdev = to_gpio_chardev_data(nb); + struct gpio_chardev_data *cdev = + container_of(nb, struct gpio_chardev_data, lineinfo_changed_nb); struct gpio_v2_line_info_changed chg; struct gpio_desc *desc = data; int ret;