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 <robh@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Frank Rowand <frowand.list@gmail.com> Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -34,8 +34,7 @@ extern void of_device_unregister(struct platform_device *ofdev);
|
||||
|
||||
extern const void *of_device_get_match_data(const struct device *dev);
|
||||
|
||||
extern ssize_t of_device_get_modalias(struct device *dev,
|
||||
char *str, ssize_t len);
|
||||
extern ssize_t of_device_modalias(struct device *dev, char *str, ssize_t len);
|
||||
extern int of_device_request_module(struct device *dev);
|
||||
|
||||
extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
|
||||
@@ -72,8 +71,8 @@ static inline const void *of_device_get_match_data(const struct device *dev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int of_device_get_modalias(struct device *dev,
|
||||
char *str, ssize_t len)
|
||||
static inline int of_device_modalias(struct device *dev,
|
||||
char *str, ssize_t len)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user