Skip to content

Commit 154b2b9

Browse files
committed
input: pat912x: fix build with default cpi setting
Fix up the BUILD_ASSERT so that it does not trigger if the resolution cpi is not specified in the devicetree and left to the default value. Also use the correct spelling for "cpi". Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 752079a commit 154b2b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/input/input_pat912x.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ static int pat912x_pm_action(const struct device *dev,
325325
#endif
326326

327327
#define PAT912X_INIT(n) \
328-
BUILD_ASSERT(IN_RANGE(DT_INST_PROP(n, res_x_cpi), 0, RES_MAX), \
329-
"invalid res-x-cpy"); \
330-
BUILD_ASSERT(IN_RANGE(DT_INST_PROP(n, res_y_cpi), 0, RES_MAX), \
331-
"invalid res-y-cpy"); \
328+
BUILD_ASSERT(IN_RANGE(DT_INST_PROP_OR(n, res_x_cpi, 0), 0, RES_MAX), \
329+
"invalid res-x-cpi"); \
330+
BUILD_ASSERT(IN_RANGE(DT_INST_PROP_OR(n, res_y_cpi, 0), 0, RES_MAX), \
331+
"invalid res-y-cpi"); \
332332
BUILD_ASSERT(DT_INST_PROP(n, sleep1_enable) || \
333333
!DT_INST_PROP(n, sleep2_enable), \
334334
"invalid sleep configuration"); \

0 commit comments

Comments
 (0)