diff options
Diffstat (limited to 'drivers/input/keyboard/lpc32xx-keys.c')
-rw-r--r-- | drivers/input/keyboard/lpc32xx-keys.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c index 1b8add6cfb9d..42181435fe67 100644 --- a/drivers/input/keyboard/lpc32xx-keys.c +++ b/drivers/input/keyboard/lpc32xx-keys.c | |||
@@ -144,12 +144,13 @@ static int lpc32xx_parse_dt(struct device *dev, | |||
144 | { | 144 | { |
145 | struct device_node *np = dev->of_node; | 145 | struct device_node *np = dev->of_node; |
146 | u32 rows = 0, columns = 0; | 146 | u32 rows = 0, columns = 0; |
147 | int err; | ||
147 | 148 | ||
148 | of_property_read_u32(np, "keypad,num-rows", &rows); | 149 | err = matrix_keypad_parse_of_params(dev, &rows, &columns); |
149 | of_property_read_u32(np, "keypad,num-columns", &columns); | 150 | if (err) |
150 | if (!rows || rows != columns) { | 151 | return err; |
151 | dev_err(dev, | 152 | if (rows != columns) { |
152 | "rows and columns must be specified and be equal!\n"); | 153 | dev_err(dev, "rows and columns must be equal!\n"); |
153 | return -EINVAL; | 154 | return -EINVAL; |
154 | } | 155 | } |
155 | 156 | ||