diff options
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r-- | drivers/of/device.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index b1e6bebda3f3..6e2f9113b1b7 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -176,7 +176,7 @@ const void *of_device_get_match_data(const struct device *dev) } EXPORT_SYMBOL(of_device_get_match_data); -ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len) +static ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len) { const char *compat; int cplen, i; @@ -223,9 +223,8 @@ ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len) str[i] = '_'; } - return tsize; + return repend; } -EXPORT_SYMBOL_GPL(of_device_get_modalias); int of_device_request_module(struct device *dev) { @@ -251,6 +250,21 @@ int of_device_request_module(struct device *dev) EXPORT_SYMBOL_GPL(of_device_request_module); /** + * of_device_modalias - Fill buffer with newline terminated modalias string + */ +ssize_t of_device_modalias(struct device *dev, char *str, ssize_t len) +{ + ssize_t sl = of_device_get_modalias(dev, str, len - 2); + if (sl < 0) + return sl; + + str[sl++] = '\n'; + str[sl] = 0; + return sl; +} +EXPORT_SYMBOL_GPL(of_device_modalias); + +/** * of_device_uevent - Display OF related uevent information */ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) |