* [PATCH net-next] net: usb: hso: use DEVICE_ATTR_RO macro
@ 2021-05-20 13:41 YueHaibing
2021-05-20 23:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2021-05-20 13:41 UTC (permalink / raw)
To: davem, kuba; +Cc: linux-usb, netdev, linux-kernel, YueHaibing
Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/net/usb/hso.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 63e394cafc17..d84258c70d0c 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -457,9 +457,8 @@ static const struct usb_device_id hso_ids[] = {
MODULE_DEVICE_TABLE(usb, hso_ids);
/* Sysfs attribute */
-static ssize_t hso_sysfs_show_porttype(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t hsotype_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct hso_device *hso_dev = dev_get_drvdata(dev);
char *port_name;
@@ -505,7 +504,7 @@ static ssize_t hso_sysfs_show_porttype(struct device *dev,
return sprintf(buf, "%s\n", port_name);
}
-static DEVICE_ATTR(hsotype, 0444, hso_sysfs_show_porttype, NULL);
+static DEVICE_ATTR_RO(hsotype);
static struct attribute *hso_serial_dev_attrs[] = {
&dev_attr_hsotype.attr,
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: usb: hso: use DEVICE_ATTR_RO macro
2021-05-20 13:41 [PATCH net-next] net: usb: hso: use DEVICE_ATTR_RO macro YueHaibing
@ 2021-05-20 23:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-20 23:00 UTC (permalink / raw)
To: YueHaibing; +Cc: davem, kuba, linux-usb, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Thu, 20 May 2021 21:41:16 +0800 you wrote:
> Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR,
> which makes the code a bit shorter and easier to read.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/net/usb/hso.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
Here is the summary with links:
- [net-next] net: usb: hso: use DEVICE_ATTR_RO macro
https://git.kernel.org/netdev/net-next/c/7567d603b3f1
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-20 23:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 13:41 [PATCH net-next] net: usb: hso: use DEVICE_ATTR_RO macro YueHaibing
2021-05-20 23:00 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.