aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gpio
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-01-22 14:38:52 +0200
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2021-02-15 11:43:32 +0100
commitb2498cb87c4ba87580e5975e049d589b6786ff75 (patch)
treecadfb955b3744f99a5c976852bb3c894bdf6e92a /include/linux/gpio
parentgpio: aggregator: Replace isrange() by using get_options() (diff)
downloadlinux-dev-b2498cb87c4ba87580e5975e049d589b6786ff75.tar.xz
linux-dev-b2498cb87c4ba87580e5975e049d589b6786ff75.zip
gpio: aggregator: Use compound literal from the header
Instead of doing it in place, convert GPIO_LOOKUP_IDX() and GPIO_HOG() to be compund literals that's allow to use them as rvalue in assignments. Due to above conversion, use compound literal from the header in the gpio-aggregator.c. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r--include/linux/gpio/machine.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/gpio/machine.h b/include/linux/gpio/machine.h
index 781a053abbb9..d755e529c1e3 100644
--- a/include/linux/gpio/machine.h
+++ b/include/linux/gpio/machine.h
@@ -75,7 +75,7 @@ struct gpiod_hog {
* gpiod_get_index()
*/
#define GPIO_LOOKUP_IDX(_key, _chip_hwnum, _con_id, _idx, _flags) \
-{ \
+(struct gpiod_lookup) { \
.key = _key, \
.chip_hwnum = _chip_hwnum, \
.con_id = _con_id, \
@@ -87,7 +87,7 @@ struct gpiod_hog {
* Simple definition of a single GPIO hog in an array.
*/
#define GPIO_HOG(_chip_label, _chip_hwnum, _line_name, _lflags, _dflags) \
-{ \
+(struct gpiod_hog) { \
.chip_label = _chip_label, \
.chip_hwnum = _chip_hwnum, \
.line_name = _line_name, \