summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/falcon/efx.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2021-05-23 11:24:09 +0800
committerDavid S. Miller <davem@davemloft.net>2021-05-23 17:18:42 -0700
commit4934fb7dc409c2b14dc49a1f6d9024bec87431a4 (patch)
tree76534c9ac7280f1c4696e8caf383989b598c8945 /drivers/net/ethernet/sfc/falcon/efx.c
parent3880fc37beba5d6878ef4c8d57f21683974a211b (diff)
downloadlinux-4934fb7dc409c2b14dc49a1f6d9024bec87431a4.tar.bz2
sfc: falcon: 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/falcon/efx.c')
-rw-r--r--drivers/net/ethernet/sfc/falcon/efx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index 5e7a57b680ca..9ec752a43c75 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -2254,12 +2254,12 @@ static struct notifier_block ef4_netdev_notifier = {
};
static ssize_t
-show_phy_type(struct device *dev, struct device_attribute *attr, char *buf)
+phy_type_show(struct device *dev, struct device_attribute *attr, char *buf)
{
struct ef4_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 ef4_register_netdev(struct ef4_nic *efx)
{