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

Revert "of: base: add support to get machine model name"

This reverts commit e5269794d2e9046dd45be15bdb213a229df46b7e.

-38
-32
drivers/of/base.c
··· 546 546 EXPORT_SYMBOL(of_machine_is_compatible); 547 547 548 548 /** 549 - * of_machine_get_model_name - Find and read the model name or the compatible 550 - * value for the machine. 551 - * @model: pointer to null terminated return string, modified only if 552 - * return value is 0. 553 - * 554 - * Returns a string containing either the model name or the compatible value 555 - * of the machine if found, else return error. 556 - * 557 - * Search for a machine model name or the compatible if model name is missing 558 - * in a device tree node and retrieve a null terminated string value (pointer 559 - * to data, not a copy). Returns 0 on success, -EINVAL if root of the device 560 - * tree is not found and other error returned by of_property_read_string on 561 - * failure. 562 - */ 563 - int of_machine_get_model_name(const char **model) 564 - { 565 - int error; 566 - 567 - if (!of_node_get(of_root)) 568 - return -EINVAL; 569 - 570 - error = of_property_read_string(of_root, "model", model); 571 - if (error) 572 - error = of_property_read_string_index(of_root, "compatible", 573 - 0, model); 574 - of_node_put(of_root); 575 - 576 - return error; 577 - } 578 - EXPORT_SYMBOL(of_machine_get_model_name); 579 - 580 - /** 581 549 * __of_device_is_available - check if a device is available for use 582 550 * 583 551 * @device: Node to check for availability, with locks already held
-6
include/linux/of.h
··· 367 367 extern int of_alias_get_highest_id(const char *stem); 368 368 369 369 extern int of_machine_is_compatible(const char *compat); 370 - extern int of_machine_get_model_name(const char **model); 371 370 372 371 extern int of_add_property(struct device_node *np, struct property *prop); 373 372 extern int of_remove_property(struct device_node *np, struct property *prop); ··· 786 787 static inline int of_machine_is_compatible(const char *compat) 787 788 { 788 789 return 0; 789 - } 790 - 791 - static inline int of_machine_get_model_name(const char **model) 792 - { 793 - return -EINVAL; 794 790 } 795 791 796 792 static inline bool of_console_check(const struct device_node *dn, const char *name, int index)