diff options
author | Wang Qing <wangqing@vivo.com> | 2020-09-26 08:49:18 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-29 00:14:42 +0200 |
commit | 414698f6aa31d69fe7fe0fda22ac41cb7777eab5 (patch) | |
tree | 5bd1dc05ec2b4b04fbb0aeb3f0eb81648902db44 /drivers/net/phy/spi_ks8995.c | |
parent | net: mvneta: try to use in-irq pp cache in mvneta_txq_bufs_free (diff) | |
download | linux-414698f6aa31d69fe7fe0fda22ac41cb7777eab5.tar.xz linux-414698f6aa31d69fe7fe0fda22ac41cb7777eab5.zip |
net: Use kobj_to_dev() API
Use kobj_to_dev() instead of container_of().
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/phy/spi_ks8995.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c index 7475cef17cf7..ca49c1ad3efc 100644 --- a/drivers/net/phy/spi_ks8995.c +++ b/drivers/net/phy/spi_ks8995.c @@ -300,7 +300,7 @@ static ssize_t ks8995_registers_read(struct file *filp, struct kobject *kobj, struct device *dev; struct ks8995_switch *ks8995; - dev = container_of(kobj, struct device, kobj); + dev = kobj_to_dev(kobj); ks8995 = dev_get_drvdata(dev); return ks8995_read(ks8995, buf, off, count); @@ -312,7 +312,7 @@ static ssize_t ks8995_registers_write(struct file *filp, struct kobject *kobj, struct device *dev; struct ks8995_switch *ks8995; - dev = container_of(kobj, struct device, kobj); + dev = kobj_to_dev(kobj); ks8995 = dev_get_drvdata(dev); return ks8995_write(ks8995, buf, off, count); |