• Linus Walleij's avatar
    gpio: sx150x: use container_of() to get state container · 218f1f8b
    Linus Walleij authored
    The state container of the sx150x GPIO driver is sometimes
    extracted from the gpio_chip exploiting the fact that offsetof()
    the struct gpio_chip inside the struct sx150x_chip is 0, so
    the container_of() is in practice a noop. However if a member
    is added to struct sx150_chip in front of struct gpio_chip, things
    will break. Using proper container_of() avoids this problem.
    
    Semantically this is a noop, the compiler will optimize it away,
    but syntactically it makes me happier.
    
    Cc: Wei Chen <Wei.Chen@csr.com>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    218f1f8b
gpio-sx150x.c 16.3 KB