diff options
author | YueHaibing <yuehaibing@huawei.com> | 2021-05-23 11:20:30 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-23 17:18:42 -0700 |
commit | 3880fc37beba5d6878ef4c8d57f21683974a211b (patch) | |
tree | 93cd024d1f2848a011c18e66d7850a87fa726fe2 /drivers/net/ethernet/sfc/efx.c | |
parent | 52af13a41489d7bbc1932d17583eff6e5fffc820 (diff) | |
download | linux-3880fc37beba5d6878ef4c8d57f21683974a211b.tar.gz |
sfc: use DEVICE_ATTR_*() macro
Use DEVICE_ATTR_*() helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/efx.c')
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 4fd9903ffe98..37fcf2eb0741 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c @@ -689,13 +689,13 @@ static struct notifier_block efx_netdev_notifier = { .notifier_call = efx_netdev_event, }; -static ssize_t -show_phy_type(struct device *dev, struct device_attribute *attr, char *buf) +static ssize_t phy_type_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct efx_nic *efx = dev_get_drvdata(dev); return sprintf(buf, "%d\n", efx->phy_type); } -static DEVICE_ATTR(phy_type, 0444, show_phy_type, NULL); +static DEVICE_ATTR_RO(phy_type); static int efx_register_netdev(struct efx_nic *efx) { |