Skip to content

Commit

Permalink
net: Use kobj_to_dev() API
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Qing authored and David S. Miller committed Sep 28, 2020
1 parent 632bb64 commit 414698f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/phy/spi_ks8995.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 414698f

Please sign in to comment.