Skip to content

Commit d0ef631

Browse files
andy-shevbrgl
authored andcommitted
gpio: mlxbf2: Use DEFINE_RES_MEM_NAMED() helper macro
Use DEFINE_RES_MEM_NAMED() to save a couple of lines of code, which makes the code a bit shorter and easier to read. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Asmaa Mnebhi <asmaa@nvidia.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
1 parent 4e6864f commit d0ef631

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/gpio/gpio-mlxbf2.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,8 @@ struct mlxbf2_gpio_param {
6969
struct mutex *lock;
7070
};
7171

72-
static struct resource yu_arm_gpio_lock_res = {
73-
.start = YU_ARM_GPIO_LOCK_ADDR,
74-
.end = YU_ARM_GPIO_LOCK_ADDR + YU_ARM_GPIO_LOCK_SIZE - 1,
75-
.name = "YU_ARM_GPIO_LOCK",
76-
};
72+
static struct resource yu_arm_gpio_lock_res =
73+
DEFINE_RES_MEM_NAMED(YU_ARM_GPIO_LOCK_ADDR, YU_ARM_GPIO_LOCK_SIZE, "YU_ARM_GPIO_LOCK");
7774

7875
static DEFINE_MUTEX(yu_arm_gpio_lock_mutex);
7976

0 commit comments

Comments
 (0)