Merge branch 'for-next' of git://github.com/rydberg/linux into next
[deliverable/linux.git] / drivers / input / keyboard / omap4-keypad.c
index d715c0d10bf20c8a6a640167f040930c74a7a555..f4aa53a1fd69bb70f0e680e95688e251f355f1e9 100644 (file)
@@ -215,18 +215,12 @@ static int omap4_keypad_parse_dt(struct device *dev,
                                 struct omap4_keypad *keypad_data)
 {
        struct device_node *np = dev->of_node;
+       int err;
 
-       if (!np) {
-               dev_err(dev, "missing DT data");
-               return -EINVAL;
-       }
-
-       of_property_read_u32(np, "keypad,num-rows", &keypad_data->rows);
-       of_property_read_u32(np, "keypad,num-columns", &keypad_data->cols);
-       if (!keypad_data->rows || !keypad_data->cols) {
-               dev_err(dev, "number of keypad rows/columns not specified\n");
-               return -EINVAL;
-       }
+       err = matrix_keypad_parse_of_params(dev, &keypad_data->rows,
+                                           &keypad_data->cols);
+       if (err)
+               return err;
 
        if (of_get_property(np, "linux,input-no-autorepeat", NULL))
                keypad_data->no_autorepeat = true;
This page took 0.617344 seconds and 5 git commands to generate.