mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
of: Add function for generating a DT modalias with a newline
The modalias sysfs attr is lacking a newline for DT aliases on platform devices. The macio and ibmebus correctly add the newline, but open code it. Introduce a new function, of_device_modalias(), that fills the buffer with the modalias including the newline and update users of the old of_device_get_modalias function. Signed-off-by: Rob Herring <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Frank Rowand <[email protected]> Cc: [email protected] Acked-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
bcf54d5385
commit
0634c29589
7 changed files with 24 additions and 22 deletions
|
|
@ -41,12 +41,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
|
|||
static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
int len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2);
|
||||
|
||||
buf[len] = '\n';
|
||||
buf[len+1] = 0;
|
||||
|
||||
return len+1;
|
||||
return of_device_modalias(dev, buf, PAGE_SIZE);
|
||||
}
|
||||
|
||||
static ssize_t devspec_show(struct device *dev,
|
||||
|
|
|
|||
Loading…
Reference in a new issue