Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: auo-pixcir-ts - switch to using generic device properties

Let's use generic device properties API instead of OF-specific one.

Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20220914141428.2201784-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+10 -30
+10 -30
drivers/input/touchscreen/auo-pixcir-ts.c
··· 22 22 #include <linux/delay.h> 23 23 #include <linux/gpio/consumer.h> 24 24 #include <linux/of.h> 25 + #include <linux/property.h> 25 26 26 27 /* 27 28 * Coordinate calculation: ··· 475 474 static SIMPLE_DEV_PM_OPS(auo_pixcir_pm_ops, 476 475 auo_pixcir_suspend, auo_pixcir_resume); 477 476 478 - #ifdef CONFIG_OF 479 - static int auo_pixcir_parse_dt(struct device *dev, struct auo_pixcir_ts *ts) 480 - { 481 - struct device_node *np = dev->of_node; 482 - 483 - if (!np) 484 - return -ENOENT; 485 - 486 - if (of_property_read_u32(np, "x-size", &ts->x_max)) { 487 - dev_err(dev, "failed to get x-size property\n"); 488 - return -EINVAL; 489 - } 490 - 491 - if (of_property_read_u32(np, "y-size", &ts->y_max)) { 492 - dev_err(dev, "failed to get y-size property\n"); 493 - return -EINVAL; 494 - } 495 - 496 - return 0; 497 - } 498 - #else 499 - static int auo_pixcir_parse_dt(struct device *dev, struct auo_pixcir_ts *ts) 500 - { 501 - return -EINVAL; 502 - } 503 - #endif 504 - 505 477 static void auo_pixcir_reset(void *data) 506 478 { 507 479 struct auo_pixcir_ts *ts = data; ··· 509 535 snprintf(ts->phys, sizeof(ts->phys), 510 536 "%s/input0", dev_name(&client->dev)); 511 537 512 - error = auo_pixcir_parse_dt(&client->dev, ts); 513 - if (error) 514 - return error; 538 + if (device_property_read_u32(&client->dev, "x-size", &ts->x_max)) { 539 + dev_err(&client->dev, "failed to get x-size property\n"); 540 + return -EINVAL; 541 + } 542 + 543 + if (device_property_read_u32(&client->dev, "y-size", &ts->y_max)) { 544 + dev_err(&client->dev, "failed to get y-size property\n"); 545 + return -EINVAL; 546 + } 515 547 516 548 input_dev->name = "AUO-Pixcir touchscreen"; 517 549 input_dev->phys = ts->phys;